EUInnerImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Louis Monier June 14, 1986 5:21:09 pm PDT
Bertrand Serlet June 7, 1986 7:34:12 pm PDT
Last Edited by: Louis Monier February 19, 1987 1:24:23 pm PST
DIRECTORY CoreCreate, EUInner, EUUtils, Sisyph;
EUInnerImpl:
CEDAR
PROGRAM
IMPORTS CoreCreate, EUUtils, Sisyph
EXPORTS EUInner =
BEGIN OPEN EUInner, CoreCreate;
CreateEUInner:
PUBLIC
PROC [cx: Sisyph.Context]
RETURNS [ct: CellType] = {
ct ← EUUtils.Fetch["Inner"];
IF ct=
NIL
THEN {
ct ← Sisyph.ES["Inner.sch", cx];
EUUtils.Store["Inner", ct];
};
};
CreateDataPath:
PUBLIC
PROC [cx: Sisyph.Context]
RETURNS [ct: CellType] = {
ct ← EUUtils.Fetch["DataPath"];
IF ct=
NIL
THEN {
ct ← Sisyph.ES["DataPath.sch", cx];
EUUtils.Store["DataPath", ct];
};
};
-- ALU
CreateALU:
PUBLIC
PROC [cx: Sisyph.Context]
RETURNS [ct: CellType] = {
ct ← EUUtils.Fetch["ALU"];
IF ct=
NIL
THEN {
ct ← Sisyph.ES["ALU.sch", cx];
EUUtils.Store["ALU", ct];
};
};
-- Generates the DAG which connects L, M, R and B as needed to wire P and G for the ALU.
Tree:
PUBLIC
PROC []
RETURNS [tree: Wire] ~ {
left: Wire ← Seq[size: 32];
middle: Wire ← Seq[size: 32];
right: Wire ← Seq[size: 32];
bottom: Wire ← Seq[size: 32];
Connect:
PROC [root, deltaSon:
NAT]
RETURNS [wire: Wire] ~ {
IF deltaSon=0 THEN {left[root] ← bottom[root-1]; right[root] ← bottom[root]}
ELSE {
left[root] ← Connect[root-deltaSon, deltaSon/2];
right[root] ← Connect[root+deltaSon, deltaSon/2];};
RETURN[middle[root]];
};
[] ← Connect[16, 8];
right[0] ← middle[16];
tree ← Wires[left, middle, right, bottom];
};
END.