--SRWC.Mesa --created by RoseTranslate from SRWC.Rose of 5-Mar-83 21:04:48 PST for Spreitzer.pa at 5-Mar-83 21:04:51 PST DIRECTORY Rosemary, IntTypes, SRHC; SRWC: CEDAR PROGRAM IMPORTS Rosemary, IntTypes, SRHC = BEGIN OPEN Rosemary, IntTypes; --Signal Type decls CreatePorts: PROC = BEGIN SRWCPorts[0] _ [0, 1, "phi1", IntType[1], TRUE, FALSE]; SRWCPorts[1] _ [1, 1, "phi2", IntType[1], TRUE, FALSE]; SRWCPorts[2] _ [2, 1, "input", IntType[4], TRUE, FALSE]; SRWCPorts[3] _ [3, 1, "output", IntType[4], FALSE, TRUE]; END; RegisterCells: PROC = BEGIN RegisterCellClass[className: "SRWC", expandProc: SRWCExpand, initProc: NIL, evalProc: NIL, interfaceTemplate: NEW [SRWCInterfaceRec _ [ phi1: NEW [NodeRep _ [name: "phi1", type: IntType[1]]], phi2: NEW [NodeRep _ [name: "phi2", type: IntType[1]]], input: NEW [NodeRep _ [name: "input", type: IntType[4]]], output: NEW [NodeRep _ [name: "output", type: IntType[4]]] ]], ioTemplate: NEW [SRWCIORec], ports: SRWCPorts]; END; --Interface --IO SRWCInterfaceRef: TYPE = REF SRWCInterfaceRec; SRWCInterfaceRec: PUBLIC TYPE = RECORD [ phi1: Node, phi2: Node, input: Node, output: Node]; SRWCIORef: TYPE = REF SRWCIORec; SRWCIORec: TYPE = MACHINE DEPENDENT RECORD [ fill0(0:0..14): [0..32767], phi1(0:15..15): BOOLEAN, fill1(1:0..14): [0..32767], phi2(1:15..15): BOOLEAN, fill2(2:0..11): [0..4095], input(2:12..15): [0..15], fill3(3:0..11): [0..4095], output(3:12..15): [0..15]]; SRWCExpand: ExpandProc = { OPEN NARROW[interfaceNodes, SRWCInterfaceRef]; middle: Node _ CreateNode[within: thisCell, name: "middle", type: IntType[4]]; [] _ CreateCell[within: thisCell, instanceName: "First", className: "SRHC", interfaceNodes: NEW[SRHC.SRHCInterfaceRec _ [input:input, clock:phi1, output:middle]]]; [] _ CreateCell[within: thisCell, instanceName: "second", className: "SRHC", interfaceNodes: NEW[SRHC.SRHCInterfaceRec _ [input:middle, clock:phi2, output:output]]]; }; SRWCPorts: Ports _ NEW [PortsRep[4]]; CreatePorts[]; RegisterCells[]; END.