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

PROC Process2(CHAN OF LINK.TO.LINK to.process.1,from.process.1,
              to.process.5,from.process.5,
             to.process.3,from.process.3,
             from.process.6,
              VAL INT report, evaluation, preemption)


  CHAN OF BUNDLE  XPtoDec1A, FrAddIntA,PCToDec1, XLtoDec1D, FromApipe,
                  Dec1toXPD, ToAddIntD, Dec1PCA, Dec1XLA, ToApipe, FAddIntA,
                  FAdInWlx,ToAddInta,ToAddIntb,FAddIntD,FAddIntC,ToAddIntA,AIDabt0,
                  AMemDabt1, AMemDabt0:

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


  CHAN OF DEB.MESSAGE addint.monitor:
  [4]CHAN OF DEB.MESSAGE screen:
 

  SEQ
    PAR
    
      AddInt (ToApipe,ToAddInta,ToAddIntb,ToAddIntD,
            FAddIntD,FAddIntC, FromApipe,FrAddIntA, FAddIntA,
            ToAddIntA,PCToDec1,Dec1PCA,Dec1toXPD, XPtoDec1A,
            XLtoDec1D,Dec1XLA, AMemDabt1, AMemDabt0, AIDabt0,FAdInWlx,                       
            [screen FROM 0 FOR 4], report, evaluation, preemption) 

      monitor([screen FROM 0 FOR 4], addint.monitor, report, evaluation)

      ------------------------link0  to/from Process1----------------------------

      --1-->2: Dec1toXPD, ToAddIntD, Dec1PCA, Dec1XLA, ToApipe, 
      --2-->1: XPtoDec1A, FrAddIntA, PCToDec1, XLtoDec1D, FromApipe,


      multiplexor([XPtoDec1A, FrAddIntA,PCToDec1, XLtoDec1D, FromApipe], [d.sink[0]], to.process.1)
      demultiplexor(from.process.1, [Dec1toXPD, ToAddIntD, Dec1PCA, Dec1XLA, ToApipe,b.sink[0],b.sink[1],b.sink[2],b.sink[3]],[d.sink[1]])
      --------------------------------------------------------------------------
      ------------------------link 1 to/from Process5----------------------------

      --2-->5:FAddIntA,FAdInWlx
      --5-->2:ToAddInta,ToAddIntb,

      multiplexor([FAddIntA,FAdInWlx], [addint.monitor], to.process.5)
      demultiplexor(from.process.5, [ToAddInta,ToAddIntb,b.sink[4],b.sink[5],b.sink[6],b.sink[7],b.sink[8],b.sink[9],b.sink[10]], [d.sink[2]])
      --------------------------------------------------------------------------
      ------------------------link 2 to/from Process3----------------------------

      --2-->3:FAddIntD,FAddIntC,
      --3-->2:ToAddIntA,AIDabt0,

      multiplexor([FAddIntD,FAddIntC], [d.sink[3]], to.process.3)
      demultiplexor(from.process.3, [ToAddIntA,AIDabt0,b.sink[11],b.sink[12],b.sink[13],b.sink[14],b.sink[15],b.sink[16],b.sink[17]], [d.sink[4]])
      --------------------------------------------------------------------------
      ------------------------link 3 to/from Process6----------------------------

      --6-->2:AMemDabt1, AMemDabt0

      demultiplexor(from.process.6, [AMemDabt1, AMemDabt0,b.sink[18],b.sink[19],b.sink[20],b.sink[21],b.sink[22],b.sink[23],b.sink[24]], [d.sink[5]])
      --------------------------------------------------------------------------
:

  


