#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/Reg/Reg"


PROC Process4(CHAN OF LINK.TO.LINK  to.process.5,from.process.5,
                                    to.process.1,from.process.1,
                                    to.process.7,  
              VAL INT report, evaluation)

  CHAN OF BUNDLE FRegBA,FWCtrlD,FWCtrlC,ToRegBI,ToRegBPC,ToRegack,FromRGA,
                 FromRegA,FromRegB:


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


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

  SEQ
    PAR

      Reg (FWCtrlD, FWCtrlC,FRegBA,ToRegBI,ToRegBPC,FromRGA,
           FromRegA,FromRegB,ToRegack,                       
           [screen FROM 0 FOR 6], report, evaluation)
      monitor([screen FROM 0 FOR 6], reg.monitor, report, evaluation)

      ------------------------link 0 to/from Process5----------------------------
      --4-->5:FRegBA
      --5-->4:FWCtrlD,FWCtrlC


      multiplexor([FRegBA], [d.sink[0]], to.process.5)
      demultiplexor(from.process.5,[FWCtrlD,FWCtrlC,b.sink[0],b.sink[1],b.sink[2],b.sink[3],b.sink[4],b.sink[5],b.sink[6] ], [d.sink[1]] )
      ---------------------------------------------------------------------------
      ------------------------link 3 to/from Process1----------------------------
      --1-->4: ToRegBI,ToRegBPC,ToRegack
      --4-->1:FromRGA,FromRegA,FromRegB

      multiplexor([FromRGA,FromRegA,FromRegB], [d.sink[2]], to.process.1)
      demultiplexor(from.process.1, [ToRegBI,ToRegBPC,ToRegack,b.sink[7],b.sink[8],b.sink[9],b.sink[10],b.sink[11],b.sink[12]],[d.sink[3]])
      ---------------------------------------------------------------------------
      ------------------------link 1  to the outside world----------------------------
      multiplexor([b.sink[13]],[reg.monitor],to.process.7)

      ---------------------------------------------------------------------------
:
           


