IFUMintTest.mesa
Don Curry May 11, 1987 8:08:08 pm PDT
Last Edited by: Don Curry October 20, 1987 9:04:41 pm PDT
DIRECTORY Core, CoreFlat, IO, Mint, MintCmds, PWCore, Rope, TerminalIO, WriteCapa;
IFUMintTest: CEDAR PROGRAM
IMPORTS CoreFlat, IO, Mint, MintCmds, PWCore, Rope, TerminalIO, WriteCapa
SHARES MintCmds =
BEGIN
DoIt: PROC[ct: Core.CellType] = {
circuit:  Mint.Circuit;
knowns:  Mint.NodeList ← NIL;
worst:   Mint.ps;
pathArray:  Mint.PathArray;
TerminalIO.PutF["Get Layout (%g).\n", IO.time[]];
[]←PWCore.Layout[ct];
TerminalIO.PutF["Mint WriteCapa (%g).\n", IO.time[]];
WriteCapa.WriteWireCapa[ct];
TerminalIO.PutF["Mint Create Circuit (%g).\n", IO.time[]];
circuit ← Mint.CreateCircuit[ct];
TerminalIO.PutF["Mint Prepare Circuit (%g).\n", IO.time[]];
MintCmds.PrepareCircuit[circuit, TRUE];
TerminalIO.PutF["Mint Check Circuit (%g).\n", IO.time[]];
Mint.CheckLibrary[circuit];
TerminalIO.PutF["Mint Check Complete (%g).\n", IO.time[]];
knowns ← AddClocks[circuit: circuit, phA: TRUE];
TerminalIO.PutF["Mint Check PhA (%g).\n", IO.time[]];
[worst, pathArray] ← Mint.FindSlowestPaths[circuit];
Mint.PrintPathArray[pathArray, circuit];
knowns ← AddClocks[circuit: circuit, phA: FALSE];
TerminalIO.PutF["Mint Check PhB (%g).\n", IO.time[]];
[worst, pathArray] ← Mint.FindSlowestPaths[circuit];
Mint.PrintPathArray[pathArray, circuit];
Mint.KillCircuit[circuit]};
AddClocks: PROC[circuit: Mint.Circuit, phA: BOOL] RETURNS[list: Mint.NodeList ← NIL]={
list ← AddSignal[list, circuit, "Clk",       TRUE];
list ← AddSignal[list, circuit, "PhA",       phA];
list ← AddSignal[list, circuit, "PhB",       NOT phA];
list ← AddSignal[list, circuit, "DrControlBot[0].PhA",  phA];
list ← AddSignal[list, circuit, "DrControlBot[0].PhB",   NOT phA];
list ← AddSignal[list, circuit, "DrControlBot[0].NotPhA", NOT phA];
list ← AddSignal[list, circuit, "DrControlBot[0].NotPhB",  phA];
list ← AddSignal[list, circuit, "DrControlBot[2].DShA",  FALSE];
list ← AddSignal[list, circuit, "DrControlBot[2].DShB",  FALSE];
list ← AddSignal[list, circuit, "DrControlBot[2].DShRd",  FALSE];
list ← AddSignal[list, circuit, "DrControlBot[2].DShWt",  FALSE];
list ← AddSignal[list, circuit, "DShA",       FALSE];
list ← AddSignal[list, circuit, "DShB",       FALSE];
list ← AddSignal[list, circuit, "DShRd",      FALSE];
list ← AddSignal[list, circuit, "DShWt",      FALSE];
RETURN[list]};
AddSignal: PROC[orig: Mint.NodeList, circuit: Mint.Circuit, name: IO.ROPE, value: BOOL]
RETURNS[Mint.NodeList] = {
found: BOOLTRUE;
node: Mint.Node;
node ← Mint.NodeFromRope[Rope.Cat["public.",name], circuit ! CoreFlat.PathError=>{
TerminalIO.PutF["Mint Node: %g not found\n", IO.rope[name]]; found←FALSE; CONTINUE}];
IF NOT found THEN RETURN[orig];
Mint.SetNode[node, value];
RETURN[CONS[node, orig]]};
END.