--File: IP.mesa
--Last Edited by: CSChow, February 1, 1985 8:17:19 am PST
Preas, August 1, 1986 10:16:46 pm PDT
--IP = Interactive (or Intelligent, if you're a believer) Placer
--Most major/important records here have an 'any' field of REF ANY.
-- This is for holding various various data with the records.
-- Can be used by client or anybody. Client's responsibility to ensure no conflict.
DIRECTORY
CD USING [Orientation, Position, Rect],
Rope USING [ROPE];
IP: CEDAR DEFINITIONS = BEGIN
--Arithmetics
IntVector: TYPE = CD.Position;
-- RECORD [x, y: INT]
NatVector: TYPE = RECORD [x, y: NAT];
-- could have used NatVector: TYPE = IntVector, but this provides
-- more constraint to aid debugging
Orientation: TYPE = CD.Orientation; --Essentially [0..7] ← 0
--IPBasicsOps
CornerTypes: TYPE = {sw, se, ne, nw};
EdgeTypes: TYPE = {south, east, north, west};
PolarityTypes: TYPE = {neg, pos};
OrientationTypes: TYPE = {hor, ver};
--IPTypeTab: This is the 'Type' record.
CoTypeRep: TYPE = RECORD[
name: Rope.ROPE,
instances: LIST OF REF ComponentRep,
pins: LIST OF REF PinRep,
shapeInfo: ShapeInfoRec,
any: REFNIL
];
ShapeInfoRec: TYPE = RECORD[
shape: REF ShapeRep,
shapeFn: REF,
restriction: REF
];
ShapeRep: TYPE = RECORD[
dim: REF NatVector, --should not be NIL
cornerSpaces: RECORD[sw, se, ne, nw: REF NatVector ← NIL]
];
PinRep: TYPE = RECORD[
name: Rope.ROPE,
physicalPins: LIST OF REF PhysicalPinRep ← NIL,
auxInfo: REFNIL -- Haven't decided what to use this for
];
PhysicalPinRep: TYPE = RECORD[
coord: IntVector, --relative to owner
side: PinSideType ← unknown, --The closest edge
active: BOOLFALSE -- active <=> used in computation of net length
];
--IPNetTab--
NetRep: TYPE = RECORD[
name: Rope.ROPE,
pinNets: LIST OF REF PinNetRep ← NIL,
any: REFNIL
];
PinNetRep: TYPE = RECORD[
name: Rope.ROPE,
net: REF NetRep,
owner: REF ComponentRep, --Component
physicalPins: LIST OF REF PhysicalPinRep ← NIL,
any: REFNIL
];
--IPPortTab--
PortRep: TYPE = RECORD[
name,
eqClass: Rope.ROPE,
net: REF NetRep,
position: REF IntVector ← NIL, -- position = NIL iff port is not placed
any: REFNIL
];
--IPCoTab: this is the 'instance' record--
ComponentRep: TYPE = RECORD [
name: Rope.ROPE,
origin: IntVector,
active: BOOL,
prinChannels: RECORD [south, east, north, west: REF ChannelRep],
shape: ShapeRep,
cornerChannels: RECORD[sw, se, ne, nw: REF CornerChannelsRep ← NIL],
type: REF CoTypeRep,
orient: CD.Orientation,
pinNets: LIST OF REF PinNetRep,
any: REFNIL -- For holding anything
];
CornerChannelsRep: TYPE = RECORD[hor, ver: REF ChannelRep];
PinSideType: TYPE = {south, east, north, west, swHor, seHor, neHor, nwHor, swVer, seVer, neVer, nwVer, interior, unknown};
--IPCTG: This is the channel record--
ChannelRep: TYPE = RECORD[
type: ChType,
name: Rope.ROPE,
slack: RECORD[neg, pos: INT], --neg = (left/bottom)-most & pos = (right/top)most
width: NAT, --width is a property of the channel, slack is a result from geometrize
coord: INT,
boundary: REF ChBoundaryRep,
chNode: NAT ← 0,
statistics: ChStatRep, -- This is used in channel width estimation
any: REFNIL --For holding anything
];
ChType: TYPE = OrientationTypes;
IntersectionRep: TYPE = RECORD[ch: REF ChannelRep, type: IntersectionType];
IntersectionType: TYPE = [-1..1]; -- 1 => above/right, 0 = crossing, -1 => below/left
ChStatRep: TYPE = RECORD[
-- Use in channel width estimation
activePin, -- number of active pins on this channel
nonActivePin: INT ← 0, -- number of non active pins
netFactor: REAL ← 0.0 --contribution from intersection between net and channel
]; --interior pins are not counted
--IPCB --
ChBoundaryRep: TYPE = RECORD[
owner: REF ChannelRep,
negSideHd, negSideTl, posSideHd, posSideTl: LIST OF REF IntersectionNodeRep ← NIL,
negEnd, posEnd: REF IntersectionNodeRep ← NIL,
negComp, posComp: REF ComponentRep ← NIL
];
IntersectionNodeRep: TYPE = RECORD[
owner: REF ChannelRep,
intersection: REF IntersectionRep,
dual: REF IntersectionNodeRep ← NIL,
negComp, posComp: REF ComponentRep ← NIL
];
--Rectangle abstraction, a more efficient one compared to Misc.Rect
Rect: TYPE = CD.Rect; --RECORD [x1, y1, x2, y2: INT;
--So can use some of the packages in ChipNDale
-- Errors & Signals
-- Copied From ChipNDale: CD.mesa
Error: ERROR [ec: ErrorCode ← programmingError, explanation: Rope.ROPENIL];
ErrorCode: TYPE = {programmingError, callingError, noResource, doubleRegistration, missingRegistration, other};
END.