LogicUtils.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Last Edited by: Louis Monier September 30, 1987 7:01:11 pm PDT
Jean-Marc Frailong September 17, 1987 6:33:15 pm PDT
Bertrand Serlet June 4, 1987 2:51:40 pm PDT
This module provides basic utilities for all the implementation files of Logic.mesa
DIRECTORY
Core, CoreCreate, Ports, Rope, Rosemary, Sisyph;
LogicUtils: CEDAR DEFINITIONS
~ BEGIN OPEN CoreCreate;
Caches
All Logic functions try to cache their CellType results (this does not apply to wire icons). The convention is that the caching name should be "FunctionName Arg1=Value Arg2=Value ...".
The cache may be disabled, cleared or reloaded from a corelib using the Reset function.
CacheFetch: PROC [name: ROPE] RETURNS [CellType];
Fetch an already computed cell type from the Logic cache. Returns NIL if not found.
CacheStore: PROC [name: ROPE, ct: CellType];
Store a new entry in the cache. Will raise an error if the entry was already there...
cacheAction: TYPE ~ {leave, reload, erase, disable};
Reset: PROC [reloadDesign: BOOLFALSE, cache: cacheAction ← leave];
Initialize state of LogicUtils (default arguments are NoOp):
- reloadDesign TRUE => recreate the context from which Extract works and clear cache
- cache
leave => current state remains (but erase if reloadDesign=TRUE)
reload => reload cache from core file and check dates are consistent
erase => make the cache empty
disable => disable the cache
Accessing basic cells (with associated layout)
LibraryGet: PROC [lib, cell: ROPE] RETURNS [CellType ← NIL];
Retrieves the cell cell from library named lib (might read a .corelib file). Avoid this function, it might become obsolete.
MakeSC: PROC [nameInLib: ROPE] RETURNS [ct: CellType];
Fetches the basic cell from the CMOSB library.
Extraction utilities
Value: TYPE ~ RECORD [name: ROPE, val: INT];
A value to be stored into a Sisyph context
GetLogicContext: PROC RETURNS [Sisyph.Context];
Returns the context derived from the "Logic.dale" library. If needed only to extract a schematic with INT parameters, use the Extract function.
Extract: PROC [schName: ROPE, parms: LIST OF Value ← NIL] RETURNS [ct: CellType];
Extracts from the Logic library with the given (INT) parameters.
SCBlock: PROC [ct: CellType] RETURNS [shell: CellType];
Transforms a composite cell type into a basic element for placement. The effect of this procedure is controlled by a global switch (c.f. implementation)
Rosemary sugar
RoseClass: PROC [name: ROPE, init: Rosemary.InitProc ← NIL, evalSimple: Rosemary.EvalProc ← NIL, scheduleIfClockEval: BOOLFALSE, copy: Rosemary.StateCopyProc ← NIL] RETURNS [roseClassName: ROPE];
A thin veneer on top of Rosemary.Register so that all roseNames start with Logic...
Beware that the order is not the same as in Rosemary.mesa
SimulateGate: PROC [ct: CellType, roseClassName: ROPE];
Bind cell type at gate level with specified roseClassName
SimulateMacro: PROC [ct: CellType, roseClassName: ROPE];
Bind cell type at macro level with specified roseClassName
Error management
Error: PROC [msg: ROPE];
Display message on Terminal
Obsolete: PROC [msg: ROPE];
Display message on Terminal, raises a signal if debug flag set (see implementation)
END.