MTSVector.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Jean-Marc Frailong October 11, 1988 6:35:16 pm PDT
Generation of MTS tester files.
DIRECTORY
BasicTime USING [GMT],
Core USING [CellType],
IO USING [STREAM],
Ports USING [Port],
RefTab USING [Ref],
Rope USING [ROPE],
RosemaryUser USING [TestEvalProc, TestProc],
RosemaryVector USING [Target],
SymTab USING [Ref];
MTSVector: CEDAR DEFINITIONS
~ BEGIN
Vector file creation (high-level)
CreateCapture: PROC [ct: Core.CellType] RETURNS [capture: Capture];
Create the data structure necessary to capture the vectors for a flatcell within ct. Uses Core properties as follows:
Vectors: ROPE -- the base of the vector file name, file will be <Vectors>.mtsVectors. Defaults to name of ct.
DUT: ROPE -- resolving to a flat CT which is the device under test, must be present
EvalAndCapture: PROC [capture: Capture, Eval: RosemaryUser.TestEvalProc, memory: BOOLTRUE, useClockEval: BOOLTRUE, checkPorts: BOOLTRUE];
Capture DUT state at entry, Eval, capture DUT state after Eval and write resulting vector to capture file. If useClockEval is TRUE, two Evals are performed (clockEval: TRUE, then clockEval: FALSE) and only the second one is verified. If useClockEval is FALSE, a single Eval is performed. Capture should normally be done with a gate-level (not macro-level), while replay should be done at gate level...
CloseCapture: PROC [capture: Capture];
End of simulation, close vector file.
ReadPort: PROC [ct: Core.CellType, p: Ports.Port, eachVector: PROC[]];
Recover file name from Vectors Core property; for each vector, map it back into the Rosemary test port passed and call back the client. Normally, ct is the celltype corresponding to the flat CT that has been captured earlier.
Vector file creation & access (low-level)
Create: PROC [ct: Core.CellType, package: Rope.ROPE, vectors: Rope.ROPE, title: Rope.ROPENIL] RETURNS [file: File];
Open a new MTSVector file and return descriptor. The package information is taken from package.mtsPins (default suffix) and the vectors are written into vectors.mtsVectors (default suffix)
WriteVector: PROC [file: File];
Append file.vector to end of file.
WriteVectorFromPorts: PROC [file: File, before: Ports.Port, after: Ports.Port];
Build file.vector from port information, then perform WriteVector[file]. before is the DUT state before an Eval, after is the state after the Eval.
Close: PROC [file: File];
Close the file, including header setup and checksum computation.
Read: PROC [ct: Core.CellType, vectors: Rope.ROPE, eachVector: PROC [File]];
Open vectors.mtsVectors using ct to describe the public. Call eachVector for each vector in the file. The file descriptor contains the current vector.
TestProcs
MTSCaptureTP: RosemaryUser.TestProc;
Convert base.mtsVectors into base.mtsAscii.
MTSReplayTP: RosemaryUser.TestProc;
Convert base.mtsAscii into base.mtsVectors.
Specification descriptions
SyntaxError: SIGNAL [msg: Rope.ROPE, at: INT, s: IO.STREAM];
ReadPackage: PROC [file: Rope.ROPE] RETURNS [p: Package];
Reads specified file (default suffix is .mtsPackage) and return the corresponding package structure. Fixture file is read on the file (it is referenced in the package file by name)
Types
Use the following type definitions at your own risk. Things may change...
CGF: TYPE ~ MACHINE DEPENDENT RECORD [ -- Channel Group Field
SELECT OVERLAID * FROM
bytes => [bytes: PACKED ARRAY [0..8) OF BYTE],
bits => [bits: PACKED ARRAY [0..64) OF BOOL],
ENDCASE
];
The order of bits within a CGF is strictly small-endian:
byte 0: bit 7, bit 6, ... bit 0
byte 1: bit 15, bit 14, ... bit 8 and so on.
The bit ordering is taken in account when reading the pin description file, and only there.
CG: TYPE ~ REF CGRep;
CGRep: TYPE ~ RECORD [ -- Channel Group test information
tristate: CGF,
data: CGF,
mask: CGF
];
The semantics of a CG are:
Setup TV[i].tristate;
Setup TV[i].data;
Clock tester;
IF TV[i].mask ' TesterData ` TV[i].mask ' TV[i].data THEN ERROR;
Vector: TYPE ~ REF VectorRep;
VectorRep: TYPE ~ RECORD [cg: SEQUENCE ngrps: NAT OF CG];
A test vector comprises one Channel Group per channel
Test vectors are emited on the file in 16K bytes chunks
Package: TYPE ~ REF PackageRep;
PackageRep: TYPE ~ RECORD [
name: Rope.ROPE, -- informative only
fixtureName: Rope.ROPE, -- informative only
signals: SymTab.Ref -- wire names to wireDescription
];
WireFlag: TYPE ~ {signal, pullup, gnd, vdd, ignore};
WireDescription: TYPE ~ REF WireDescriptionRep;
WireDescriptionRep: TYPE ~ RECORD [
name: Rope.ROPE, -- informative only
flavor: WireFlag, -- flavor of this wire
pins: LIST OF PinDescription -- the pins connected to this wire (usually a single one)
];
PinDescription: TYPE ~ REF PinDescriptionRep;
PinDescriptionRep: TYPE ~ RECORD [
pkgName: Rope.ROPE, -- name on package (e.g. K12)
conName: Rope.ROPE, -- name on connector (e.g. P7.24)
group: [0..8), -- tester board to which this pin is connected
byte: [0..8), -- byte on the board to which this pin is connected, used only on PC
mask: BYTE, -- to mask out this bit in the byte, PC use only
bit: [0..60) -- bit number on board, redundant with byte & mask
];
File: TYPE ~ REF FileRep;
FileRep: TYPE ~ RECORD [
id: Rope.ROPE, -- title of the simulation
dut: Core.CellType, -- the device under test
package: Package, -- describing the DUT and its test environment
wireToPins: RefTab.Ref, -- public atomic wire to pin mapping
vector: Vector, -- vector currently read or written
nGroups: PRIVATE INT ← 0, -- number of groups (boards) to be put in the file
nVects: PRIVATE INT ← 0, -- number of vectors in file
hdrSize: PRIVATE INT ← 0, -- size of header, ceiling to 1K boundary
timeStamp: PRIVATE BasicTime.GMT, -- file creation time
ckSum: PRIVATE CARD16 ← 0, -- current file checksum
block: PRIVATE REF TEXT, -- IO buffer
stream: PRIVATE IO.STREAM -- output to MTS vector file
];
Capture: TYPE ~ REF CaptureRep;
CaptureRep: TYPE ~ RECORD [ -- this record is not of any use to a normal client
mtsFile: File, -- to store computed vectors
before, after: Ports.Port, -- into which captured data are stored
target: RosemaryVector.Target -- describing target CT and associated info
];
END.