MTSVector.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Jean-Marc Frailong January 25, 1988 5:07:34 pm PST
DIRECTORY
Core USING [CellType],
IO USING [STREAM],
Ports USING [Port],
RefTab USING [Ref],
Rope USING [ROPE],
RosemaryUser USING [TestProc],
RosemaryVector USING [Target];
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
CaptureAndWrite:
PROC [capture: Capture];
Capture the vector for the target flatcell & append it to the vector file
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, fileBase: Rope.
ROPE]
RETURNS [file: File];
Open a new MTSVector file and return descriptor. The pin information is taken from fileBase.mtsPins and the vectors are written into fileBase.mtsVectors
WriteVector:
PROC [file: File];
Append file.vector to end of file.
WriteVectorFromPort:
PROC [file: File, port: Ports.Port];
Build file.vector from port information, then perform WriteVector[file].
Close:
PROC [file: File];
Close the file, including header setup and checksum computation.
Read:
PROC [ct: Core.CellType, fileBase: Rope.
ROPE, eachVector:
PROC [File]];
Open fileBase.mtsVectors using ct to describe the public. Call eachVector for each vector in the file. The file descriptor contains the current vector.
Types
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
Pin: TYPE ~ REF PinRep;
PinRep:
TYPE ~
RECORD [
name: Rope.ROPE, -- name of the pin
notConnected: BOOL ← FALSE,
hasPullup: BOOL ← FALSE,
group: [0..8), -- board number where this pin is located
pinNum: [0..64), -- pin number on the MTS board
rank: [0..64) -- index within CG data structure, differs from pinNum due to bit ordering
];
Description of a test pin in the MTS tester
File: TYPE ~ REF FileRep;
FileRep:
TYPE ~
RECORD [
id: Rope.ROPE, -- title of the simulation
dut: Core.CellType, -- the device under test
pins: LIST OF Pin, -- all pins stored in the file, including unconnected
wireToPins: RefTab.Ref, -- public atomic wire to pin mapping
vector: Vector, -- vector currently read or written
nGroups: PRIVATE CARD32 ← 0, -- number of groups (boards) to be put in the file
nVects: PRIVATE CARD32 ← 0, -- number of vectors in file
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
port: Ports.Port, -- into which captured data are stored
target: RosemaryVector.Target -- describing target CT and associated info
];