--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.