TRWireIcons.mesa
Copyright Ó 1987, 1988 by Xerox Corporation. All rights reserved.
Last Edited by: Gasbarro June 8, 1988 3:36:02 pm PDT
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: BOOLTRUE; --extract everything from schematics, don't use .core files
testSchematic: BOOLFALSE; --substitute simpler functions for things Rosemary can't simulate
Currently the only substituted cellTypes are: SampleUp and SampleDn in PE.
WirePosition: PROC [side: Side, index, size, inc, pos: NAT] RETURNS [wire: Wire] ~ {
posProp: ATOMSELECT 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.