<> <> <> <<>> DIRECTORY Atom, Core, CoreCreate, CoreOps, CoreProperties; TRWireIcons: CEDAR PROGRAM IMPORTS CoreCreate, CoreOps, CoreProperties ~ BEGIN Wire: TYPE = Core.Wire; Side: TYPE = {Top, Bottom, Left, Right}; extractSchematic: BOOL _ TRUE; --extract everything from schematics, don't use .core files testSchematic: BOOL _ FALSE; --substitute simpler functions for things Rosemary can't simulate <> WirePosition: PROC [side: Side, index, size, inc, pos: NAT] RETURNS [wire: Wire] ~ { posProp: ATOM _ SELECT side FROM Top => $TopPosition, Bottom => $BottomPosition, Left => $LeftPosition, Right => $RightPosition, ENDCASE => NIL; IF size=0 THEN ERROR; IF inc=0 THEN ERROR; IF pos+1>inc THEN ERROR; IF size>1 THEN { wire _ CoreCreate.Seq[name: "X", size: size]; FOR i: NAT IN [0..size) DO CoreProperties.PutWireProp[wire[i], posProp, NEW[INT _ (index+i)*inc+pos]]; ENDLOOP; } ELSE wire _ CoreOps.CreateWire[name: "X", props: CoreProperties.Props[[posProp, NEW[INT _ index*inc+pos]]]]; }; END.