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