
#INCLUDE "/home/amu5/users/georget/Phd/Simul/Defs/defs.inc"

#USE "/home/amu5/users/georget/Phd/Simul/library"
#USE "/home/amu5/users/georget/Phd/Simul/Memory/Mem"

PROC Process6(CHAN OF LINK.TO.LINK to.process.3,from.process.3,
               to.process.2,to.process.8, to.io.process,from.io.process,
              VAL INT report,evaluation)


  CHAN OF BUNDLE MrrAin,MEMad, MEMd, MEMc, MemDabt0,MemDabt1,
                 MrrDin,MrrPAbtin,MEMa,AMemDabt1, AMemDabt0 :

  CHAN OF INT To.memory:

  [7]CHAN OF BUNDLE b.sink:
  [6]CHAN OF DEB.MESSAGE  d.sink:

  CHAN OF BYTE Out.Char:
  CHAN OF [3]INT Read.Write:



  CHAN OF DEB.MESSAGE mem.monitor:
  [15]CHAN OF DEB.MESSAGE screen:


  SEQ
    PAR


      Mem(MemDabt0,MemDabt1,AMemDabt1, AMemDabt0, 
              MrrDin, MrrPAbtin, MrrAin,
              MEMad, MEMd, MEMc, MEMa,
          To.memory, [screen FROM 0 FOR 2], Out.Char, Read.Write, report)

      monitor([screen FROM 0 FOR 2], mem.monitor, report,evaluation)

      ------------------------link 1 to/from Process3----------------------------

      --3-->6:MrrAin,MEMad, MEMd, MEMc
      --6-->3:MemDabt0,MemDabt1,MrrDin,MrrPAbtin,MEMa

      multiplexor([MemDabt0,MemDabt1,MrrDin,MrrPAbtin,MEMa],[d.sink[0]],to.process.3)
      demultiplexor(from.process.3, [MrrAin,MEMad, MEMd, MEMc,b.sink[0],b.sink[1],b.sink[2],b.sink[3],b.sink[4]], [d.sink[1]])
      ---------------------------------------------------------------------------

      ------------------------link 2 to/from Process2----------------------------
      --6-->2:AMemDabt1, AMemDabt0

      multiplexor([AMemDabt1, AMemDabt0],[d.sink[2]],to.process.2)
      ---------------------------------------------------------------------------
      ------------------------link 0 to/from io.process----------------------------
      Mem.multiplexor(Out.Char, Read.Write, to.io.process)
      Mem.demultiplexor(from.io.process, To.memory)
      ---------------------------------------------------------------------------


      ------------------------link 3 to the outside world---------------------------

      multiplexor([b.sink[5]],[mem.monitor],to.process.8)
      ---------------------------------------------------------------------------
:


