-- File: [Indigo]<Sakura>Dragon>DragonImpl1.sak
-- 11-Mar-82  9:32:43

DIRECTORY
  DragonArbiter1: TYPE, 
  DragonCache: TYPE, 
  DragonClock: TYPE, 
  DragonMap: TYPE, 
  DragonMemory: TYPE, 
  DragonProcessor: TYPE, 
  SakuraRT: TYPE, 
  SimIO: TYPE;

DragonImpl1: MONITOR
  IMPORTS DragonArbiter1, c1: DragonCache, c2: DragonCache, DragonClock, 
          DragonMap, DragonMemory, p1: DragonProcessor, p2: DragonProcessor, SakuraRT, 
          SimIO
  = BEGIN
  SimIO.Start[]; 
  {op1: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcexception1: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcreject1: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcdata1: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcreq1: SakuraRT.Handle ← SakuraRT.Create[]; 
   op2: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcexception2: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcreject2: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcdata2: SakuraRT.Handle ← SakuraRT.Create[]; 
   pcreq2: SakuraRT.Handle ← SakuraRT.Create[]; 
   cmshared: SakuraRT.Handle ← SakuraRT.Create[]; 
   cmd: SakuraRT.Handle ← SakuraRT.Create[]; 
   cmdata: SakuraRT.Handle ← SakuraRT.Create[]; 
   clockA: SakuraRT.Handle ← SakuraRT.Create[]; 
   clockB: SakuraRT.Handle ← SakuraRT.Create[]; 
   arqp1: SakuraRT.Handle ← SakuraRT.Create[]; 
   agrp1: SakuraRT.Handle ← SakuraRT.Create[]; 
   arqp2: SakuraRT.Handle ← SakuraRT.Create[]; 
   agrp2: SakuraRT.Handle ← SakuraRT.Create[]; 
   proc1, proc2, cache1, cache2, arbiter, clock, map, memory: PROCESS; 
   SakuraRT.IncCurrent[];
   proc1 ← FORK p1.Processor
     [ClockA: clockA, ClockB: clockB, Op: op1, Fault: pcexception1, Reject: pcreject1, 
      InData: pcdata1, RQ: pcreq1, OutData: pcdata1];SakuraRT.CatalogProcId[proc1]; 
   SakuraRT.IncCurrent[];
   proc2 ← FORK p2.Processor
     [ClockA: clockA, ClockB: clockB, Op: op2, Fault: pcexception2, Reject: pcreject2, 
      InData: pcdata2, RQ: pcreq2, OutData: pcdata2];SakuraRT.CatalogProcId[proc2]; 
   SakuraRT.IncCurrent[];
   cache1 ← FORK c1.Cache
     [Op: op1, PDataIn: pcdata1, MDataIn: cmdata, ClockA: clockA, ClockB: clockB, 
      CMDIn: cmd, RQ: pcreq1, SharedIn: cmshared, Grant: agrp1, Exception: pcexception1, 
      Reject: pcreject1, SharedOut: cmshared, CMDOut: cmd, Rq: arqp1, PDataOut: pcdata1, 
      MDataOut: cmdata];SakuraRT.CatalogProcId[cache1]; 
   SakuraRT.IncCurrent[];
   cache2 ← FORK c2.Cache
     [Op: op2, PDataIn: pcdata2, MDataIn: cmdata, ClockA: clockA, ClockB: clockB, 
      CMDIn: cmd, RQ: pcreq2, SharedIn: cmshared, Grant: agrp2, Exception: pcexception2, 
      Reject: pcreject2, SharedOut: cmshared, CMDOut: cmd, Rq: arqp2, PDataOut: pcdata2, 
      MDataOut: cmdata];SakuraRT.CatalogProcId[cache2]; 
   SakuraRT.IncCurrent[];
   arbiter ← FORK DragonArbiter1.Arbiter
     [ClockA: clockA, ClockB: clockB, Proc1Rq: arqp1, Proc1Gr: agrp1, Proc2Rq: arqp2, 
      Proc2Gr: agrp2];SakuraRT.CatalogProcId[arbiter]; 
   SakuraRT.IncCurrent[];
   clock ← FORK DragonClock.ClockGenerator[ClockA: clockA, ClockB: clockB];
   SakuraRT.CatalogProcId[clock]; 
   SakuraRT.IncCurrent[];
   map ← FORK DragonMap.MapProcessor[ClockA: clockA, ClockB: clockB, CMDIn: cmd, 
                                     MDataIn: cmdata, CMDOut: cmd, MDataOut: cmdata];
   SakuraRT.CatalogProcId[map]; 
   SakuraRT.IncCurrent[];
   memory ← FORK DragonMemory.Memory
     [ClockA: clockA, ClockB: clockB, CMDIn: cmd, SharedIn: cmshared, MDataIn: cmdata, 
      MDataOut: cmdata];SakuraRT.CatalogProcId[memory]; 
   SakuraRT.DecCurrent[]; 
   SakuraRT.Join[proc1]; 
   SakuraRT.Join[proc2]; 
   SakuraRT.Join[cache1]; 
   SakuraRT.Join[cache2]; 
   SakuraRT.Join[arbiter]; 
   SakuraRT.Join[clock]; 
   SakuraRT.Join[map]; 
   SakuraRT.Join[memory]; 
   SakuraRT.IncCurrent[]}; 
  SimIO.Stop[]
  END.