-- NewPadsImpl.sak
-- last edited by Suzuki: 20-Jan-82 16:35:48

DIRECTORY
  SakuraRT: TYPE, 
  NewPads: TYPE;

NewPadsImpl: MONITOR
  IMPORTS SakuraRT
  EXPORTS NewPads
  
  
  = BEGIN
  MAIN: PROC = {SakuraRT.SIMRead["newpads.sim"]}; 
  PadsFunc: PUBLIC PROC
       [Clock, Enable: SakuraRT.Handle, A, B: SakuraRT.Handle, Equal: SakuraRT.Handle] = {
    SakuraRT.SIMMultiConnectInit[A, 8];
    {ENABLE {ABORTED => GO TO Aborted};
     SakuraRT.SIMMultiConnectAssign[A, "A00", 0]; 
     SakuraRT.SIMMultiConnectAssign[A, "A01", 1]; 
     SakuraRT.SIMMultiConnectAssign[A, "A02", 2]; 
     SakuraRT.SIMMultiConnectAssign[A, "A03", 3]; 
     SakuraRT.SIMMultiConnectAssign[A, "A04", 4]; 
     SakuraRT.SIMMultiConnectAssign[A, "A05", 5]; 
     SakuraRT.SIMMultiConnectAssign[A, "A06", 6]; 
     SakuraRT.SIMMultiConnectAssign[A, "A07", 7]; 
     SakuraRT.SIMMultiConnectInit[B, 8]; 
     SakuraRT.SIMMultiConnectAssign[B, "B00", 0]; 
     SakuraRT.SIMMultiConnectAssign[B, "B01", 1]; 
     SakuraRT.SIMMultiConnectAssign[B, "B02", 2]; 
     SakuraRT.SIMMultiConnectAssign[B, "B03", 3]; 
     SakuraRT.SIMMultiConnectAssign[B, "B04", 4]; 
     SakuraRT.SIMMultiConnectAssign[B, "B05", 5]; 
     SakuraRT.SIMMultiConnectAssign[B, "B06", 6]; 
     SakuraRT.SIMMultiConnectAssign[B, "B07", 7]; 
     SakuraRT.SIMMultiConnectInit[Enable, 2]; 
     SakuraRT.SIMMultiConnectAssign[Enable, "AEnable", 0]; 
     SakuraRT.SIMMultiConnectAssign[Enable, "BEnable", 1]; 
     SakuraRT.SIMMultiConnectInit[Equal, 2]; 
     SakuraRT.SIMMultiConnectAssign[Equal, "AEqual", 0]; 
     SakuraRT.SIMMultiConnectAssign[Equal, "BEqual", 1]; 
     {criticalSection1: ENTRY PROC = {
        NULL}; 
      DO SakuraRT.GetNewChange[Clock]; criticalSection1[]; 
         SakuraRT.Delay[10]; 
         SakuraRT.SIMSet[Enable]; 
         SakuraRT.SIMSet[A]; 
         SakuraRT.SIMSet[B]; 
         SakuraRT.SIMStep[]; 
         SakuraRT.SIMGet[Equal]; 
         SakuraRT.Delay[5]
         ENDLOOP}; 
     SakuraRT.ProcessEnd[]}
    EXITS
      Aborted => SakuraRT.ProcessEnd[]};
  
  MAIN[]; 
  NULL
  
  END.