module ARCH_1B (FUNCTIONS, CHANNELS, VARIABLE, MESI_CACHE, VIRTUAL) is ------------------------------------------------------------------------------- -- Architecture of the system communicating by means of one shared variable, -- represented by a process Variable. ------------------------------------------------------------------------------- process Arch_1b [NCS: Pid, CS: Access, B: Operation, MU: Latency] is par NCS, CS, B in Protocol [NCS, CS, B] || L [NCS, CS, B, MU] end par end process ------------------------------------------------------------------------------- -- Auxiliary process for compositional generation: protocol without latencies ------------------------------------------------------------------------------- process Protocol [NCS: Pid, CS: Access, B: Operation] is par B in par P [NCS, CS, B] (0 of Pid) || P [NCS, CS, B] (1 of Pid) || P [NCS, CS, B] (2 of Pid) || P [NCS, CS, B] (3 of Pid) || P [NCS, CS, B] (4 of Pid) end par || Variable [B] (0 of Nat) end par end process ------------------------------------------------------------------------------- -- Auxiliary process for inserting latencies ------------------------------------------------------------------------------- process L [NCS: Pid, CS: Access, B: Operation, MU: Latency] is var b: Cache, pid: Pid, acc: Access, op: Operation, cop: Cached_Operation in b := Cache (Invalid); loop alt B (?op, ?any Nat, ?pid); cop := update_caches (pid, op, !?b); MU (cop, pid) [] CS (?acc, ?pid); if acc == Enter then MU (acc, pid) end if [] NCS (?pid); MU (Work, pid) end alt end loop end var end process end module