IRSIM version 9.7
IRSIM 9.7 Download
IRSIM 9.7 Installation
IRSIM 9.7 for Windows
Description of Version 9.7 Revisions
Features Specific to IRSIM Version 9.7
Specifying X resources for IRSIM
Using IRSIM With Tcl/Tk-Based Magic
Technology (.prm) Files for IRSIM Version 9.7
Things To Do
Bug Fixes
IRSIM is a tool for simulating digital circuits. It is a "switch-level" simulator; that is, it treats transistors as ideal switches. Extracted capacitance and lumped resistance values are used to make the switch a little bit more realistic than the ideal, using the RC time constants to predict the relative timing of events.IRSIM shares a history with magic, although it is an independent program. Magic was designed to produce, and IRSIM to read, the ".sim" file format, which is largely unused outside of these two programs. IRSIM was developed at Stanford, while Magic was developed at Berkeley. Parts of Magic were developed especially for use with IRSIM, allowing IRSIM to run a simulation in the "background" (i.e., a forked process communicating through a pipe), while displaying information about the values of signals directly on the VLSI layout.
For "quick" simulations of digital circuits, IRSIM is still quite useful for confirming basic operation of digital circuit layouts.
IRSIM version 9.5 was a long-standing and stable version that corresponded to the relatively stable Magic version 6.5. When magic was recast in a Tcl/Tk interpreter framework (versions 7.2 and 7.3), IRSIM could no longer operate as a background process. However, it was clear that if IRSIM could also be recast in the same Tcl/Tk interpreter framework, the level of interaction between it and Magic would be greatly increased.
I set about to create the "new" IRSIM, although it came along in fits and starts as I had time to work on it. Because the original "analyzer" graphic display window (and GUI, to a very limited extent) was written in Xt (the rather primitive window system that is an integral part of X11), it was scrapped for a while. In its place, I substituted graphs in "Blt" based on the same in "tclspice" (see SourceForge for the tclspice project). Unfortunately, "Blt" insists that all data vectors must be real-valued, which is 1) a severe waste of space for binary digital values, and 2) is unable to represent the concept of an "unknown" value that is so crucial to fast switch simulation. So, eventually I was forced to scrap BLT and actually sit down and code out a real Tcl-based analyzer window and GUI. The result is finally done in revision 9.7.3.
![]()
Screen shot of the analyzer graphic display in IRSIM 9.7.3
Stable Distribution Source:Prior releases:
File Revision Size Date irsim-9.7.14.tgz 14 (450KB) Februrary 12, 2006 irsim-9.7.0.tgz 0 (599KB) November 13, 2004
File Revision Size Date irsim-9.7.0.tgz 0 (523KB) November 13, 2004 irsim-9.6.11.tgz 11 (461KB) December 3, 2003 irsim-9.6.4.tgz 4 (764KB) February 19, 2003
Thanks to Eric Work for the RPM package version of IRSIM 9.7.12.
File Type Revision Size Date irsim-9.7.12-1.src.rpm RPM source 1 611KB January 4, 2006
IRSIM 9.7 is distribution code. Compiled normally (i.e., without the Tcl interface), it should compile and run like the long-standing standard version 9.5. However, the "make" process has been substantially cleaned up, and converted to GNU autoconf. The Tcl version of IRSIM compiles and runs by default. The Tcl version takes advantage of both the ability to script the simulation procedure, as well as having a better interface to magic. The compilation procedure should be immediately recognizable to anyone familiar with GNU autoconf:Note that the "user subcircuit" system has not been ported to the Tcl/Tk platform. My intention is to replace or augment the C-code based subcircuit system with a Tcl script-based version.
./configure make make install
Contains a binary distribution for the Cygwin package and complete instructions for installation.
IRSIM revision history: Version 9.6
IRSIM revision history: Version 9.7
- December 2, 2002
Original release of IRSIM version 9.6 with TCL.- December 9, 2002
Fixes error with revision 1 in which compilation will fail if the "user subcircuit" option is selected. Also fixes a problem with the print output to the tkcon console, which was sending garbage for arguments in error messages.- December 24, 2002
Fixes a few problems with the standard (non-Tcl) compile (thanks to Mike Godfrey for the fixes).- February 19, 2003
Corrects problems with refreshing the "analyzer" window by threading the graphics interface. This also speeds up the graphics initialization. This fix is not relevant to the Tcl version.- March 12, 2003
Updates the "make config" process to match that for Magic-7.2 revision 29. As per the notices posted above, the fixes may actually break the compile for some systems.- March 24, 2003
- April 9, 2003
This version was never officially released.- March 31, 2003
- September 23, 2003
Attempt to update varargs. This was a no-go, and superceded by revision 10.- September 26, 2003
Updates the deprecated "varargs" variable argument method, allowing compilation with gcc version 3, and overloads the Tcl "clock" command such that input command files (especially pre-version-9.6 ones) can be run without substituting "irsim::clock" for "clock".- December 3, 2003
Additional updates, especially to remove text after all #endifs to stop the compiler from complaining.
Also, corrected an error with the non-TCL-based version compile involving routine lprintf().
- November 13, 2004
Changed the "make" method to GNU autoconf. Changed the source directory structure, which now looks similar to magic's. Confirmed compile and run for both the Tcl and non-Tcl versions.- November 15, 2004
Removed all references to BLT, and began an actual port of the "analyzer" window to Tk. Not quite finished yet, but still more usable than the BLT version was. Fixed a number of other bugs left over from Revision 0.- January 10, 2005
More work on the Tk "analyzer" window. Most of the functionality of the original version has been put back in. It is once again possible to zoom and pan the window, and change the numerical base of vectors. More to come.- January 16, 2005
Finished work on the Tk "analyzer" window, including all of the original functionality, plus a nice "signal manager" window for selecting which signals to display in the analyzer window.- January 21, 2005
Added parameter files for the standard MOSIS processes, from Jeff Sondeen's collection.- January 24, 2005
Revisions by Jason Schonberg, to correctly check for "linux" in the configure script, and correctly include "string.h" for files that use the system string functions.- September 3, 2005
Changes to the Makefile process to get version and revision information from file VERSION, rather than the directory name. Also, switched the real directory name to the versioned string ("irsim-9.7.6") and the symbolic link to the package name ("irsim"), which is obviously the right way to do it, although that fact had to be pointed out to me.- September 29, 2005
Some minor fixes to get IRSIM to compile under gcc-4, as well as to avoid various compile-time warnings. Thanks to Prof. Dinesh Sharma for providing output from the gcc-4 compile.- October 1, 2005
Fixes by Professor Dinesh Sharma for compiling the non-Tcl version under gcc-4.- October 2, 2005
Added backwards-compatibility for the original IRSIM commands except for "set" and "flush"; however, those two commands are handled by substitution when using the old command-file sourcing command "@".- October 3, 2005
A few more fixes: 1) Fixed compilation when using "--disable-faultsim", 2) Correctly initialize and display the analyzer when using command "ana" from inside a command file, 3) Correctly parse comment lines in files using the original IRSIM syntax.- October 26, 2005
Corrected an error preventing single-character node names from being displayed in the analyzer window. Thanks to Mark Martin for pointing out this error.- January 1, 2006
Changes to correct the behavior with respect to DOCDIR as defined in the Makefile. Patch courtesy of Eric Work.- Februrary 2, 2006
Changes throughout the code base to clean up and standardize the system and local include files.
Also: Changed the top-level "configure" to not use optimization. Note that the cleanup may break non-Linux compiles. Any such problems need to be reported immediately.- Februrary 12, 2006
Various code changes for NetBSD, Cygwin, and Mac OS-X, and a correction to the "decay" command.
Tcl Command-Line Interface
(to be finished. . . )
The Tcl command-line commands first duplicate the original command-line interface, with a few exceptions due to syntactical incompatibility. The commands that are the same between both versions are the following. Differences from the original in usage or return value are noted.The commands that have changed to avoid conflicts with existing, common Tcl commands are as follows (the original command name is in parentheses). Note that if the original command "@" is used to source a command file, then the original "set" and "flush" commands are handled by text substitution. In other words, the command "@" should be used to execute files written in the original IRSIM command syntax, whereas the (Tcl) command "source" should be used to execute command files written in the new IRSIM command syntax.
- assert node
- Short form. Without an assertion, returns the value of node node. This can be used directly in conjunction with magic to query the simulation value of nodes without adding them to the watch or display lists. To return the value of a layout node, select paint and do (verbatim):
assert [getnode]Another set of commands has been renamed to more "normal" full-word command names. However, the IRSIM startup script defines the original command names for backward compatibility.
- histflush (flush)
- setvector (set)
A few entirely new commands have been added to IRSIM with the Tcl/Tk based version:
- restorestate (<)
- restoreall (<<)
- savestate (>)
- querygate (!)
- querysource (?)
- source (@)
The original "analyzer" graphics display was not associated with any command-line interface commands. This situation was rectified, by necessity, to enable the use of the analyzer and GUI under Tk. The commands are as follows:
- start [-s] param_file sim_file
- Because IRSIM is a Tcl package, it has an initialization function, which runs automatically upon loading, and a separate function which starts the simulator. This allows IRSIM to be loaded and ready to go before having a ".sim" file ready for input. The start command takes the same syntax as the standalone UNIX command prompt irsim command.
- listnodes
- This function returns a list of all the nodes in the (flattened) circuit. IRSIM version 9.7 Revision 4 and newer make use of this to enable a "signal manager" window displaying all traces and allowing traces to be added to or removed from the analyzer display.
- listvectors
- This function returns a list of all the vectors that have been defined in the simulation.
Original, unmodified IRSIM commands and their syntax are as follows:
- base get|set [trace] [base_type]
- Set or query the numerical base for printing vector values on the trace. Valid base_type names are: binary, octal, decimal, and hexidecimal.
- marker [1|2] option...
- Set or change the position of the two vertical markers. Valid options are:
- get
- Get the marker position
- set trace time
- Set the marker to mark signal trace at time time
- move time
- Move the marker to time time
- off
- Turn off the selected marker
- print [file|option...]
- Print a PostScript version of the screen to the indicated file named file.
Valid options all accept one boolean (true/false) option, and are as follows: banner, legend, times, title, and outline.- simtime option...
- Report or set the time value for various points in the analyzer window. Option scroll is followed by a boolean (true/false) and enables or disables scrolling.
Valid options are: begin, end, left, right, delta, marker, cursor, move, and scroll.- trace option...
- Add, modify, or remove a trace from the analyzer.
Valid options are as follows:
- top
- bottom
- order
- base
- class
- cursor
- input
- list
- select
- value
- bits
- remove
- characters
- move
- zoom [in|out]
- Change the time span of the window view, effectively zooming the time axis in or out.
If the "stats" packages has been compiled in (normally true), then the following additional commands are available:
- activity from [to]
- Report circuit activity in time interval from to to, if specified, or the current simulation time, if unspecified.
- alias
- print node aliases
- ana
- shorthand for analyzer
- analyzer [-b|-o|-h] node|vector...
- display node/vector(s) in analyzer
- assert node|vector [[mask] val]
- Assert that the indicated node or vector is equal to value val after bit-masking with mask. Without options arguments, reports the value of the indicated node or vector.
- assertWhen nodeT valT node val
- assert that the value of node is equal to val upon the condition that node nodeT switches to value valT
- back time
- move simulation time back to specified time
- c [n]
- simulate for n clock cycles (default 1) or continue last simulation command prior to stopping
- changes from [to]
- print nodes that changed in the indicated time interval
- clear
- remove all signals from analyzer window
- clock [node|vector [val]]
- define a clock bit sequence for the indicated node or vector.
- d [node|vector]...
- print node/vector(s) or the entire display list
- debug [options]
- print/set debug state (? for help)
- decay [file]
- write net history to file
- display [[-]option]
- print/set cmdfile and auto-watch-list display
- dumph [file]
- write network state history to file
- exit [status]
- exit program with given status (default: 0)
- h node|vector...
- drive node/vector(s) to 1 (high)
- has_coords
- print if transistor coordinates are available
- help [command]...
- print info on command(s) or available commands
- hist [on|off]
- display or set history collection mode
- inputs
- print currently driven (input) nodes
- ires [time]
- print/set incremental resolution to time
- isim [file]
- read changes from file and incrementally resimulate
- l node|vectoro...
- drive node/vector(s) to 0 (low)
- logfile [[+]file]
- start/stop log file (+file appends to file)
- model [linear|switch]
- print/change simulation model
- p
- step clock one simulation step (phase)
- path node|vector...
- critical path for last transition of node(s)
- print [text...]
- print specified text
- printp [n]
- print up to n pending events (default: all)
- printx
- print all undefined (X) nodes
- q
- terminate input from current stream
- R [n]
- simulate for n cycles (default: longest sequence)
- readh file
- read network state history from file
- report [args]
- print/set trace-info or decay report (? for help)
- s [time]
- simulate for specified time (default: stepsize)
- setlog [file|off]
- print/change net-changes log-filename
- setpath [[+] path]...
- print/set/add-to cmd files search path
- stats
- print event statistics
- stepsize [time]
- print/set simulation step size
- stop [-]node|vector...
- pause simulation when node/vector(s) change
- t [-]node|vector...
- start/stop tracing specified node/vector(s)
- tcap
- print all shorted transistors
- time [command...]
- time given command or program
- u [node|vector]...
- drive a node/vector(s) to X (undefined)
- unitdelay [time]
- force transitions to specified time (0 to disable)
- until node|vector [mask] val count
- simulated until the condition node or vector, optionally masked with mask is equal to value val.
- V [node|vector [val...]]
- define input sequence for node/vector
- vector name node...
- (re)define vector named name composed of indicated node(s)
- w [-]node|vector...
- add/delete node/vector(s) to display-list
- wnet [file]
- write network to file (smaller/faster than sim file)
- x node|vector...
- make node/vector(s) undriven (non-input)
- Xdisplay [Xserver]
- print/set X display (for analyzer)
If the "cl statistics" packages has been compiled in (normally true), then the following additional command are available:
- histev [clear|off|on]
- enable/disable/clear event activity record
- evstats [file]
- print event activity recorded
If the "fault simulator" package has been compiled in (normally true), then the following additional command is available:
- clstats [file]
- print connection-list statistics
If the "power estimation" package has been compiled in (normally true), then the following additional commands are available:
- faultsim infile [outfile]
- do stuck-at fault simulation
- powlogfile [[+]file]
- start/stop power logfile (+file appends to file)
- powtrace [-]node|vector...
- start/stop power tracing specified node/vector(s)
- sumcap
- print out sum of capacitances of all nodes
- vsupply [v]
- Set supply voltage = v Volts (no arguments displays value)
- powstep
- Toggle display of power estimate for each step
The Analyzer window in irsim accepts X11 resource settings like all X11 applications, that can be set in a user's home .Xdefaults or .Xresources file. Some wildcard entries in a defaults file, such as "*.background: white", can interfere with the analyzer display. The above example will produce a blank white-on-white display.X11 application resources known to irsim are listed below, along with their default settings.
- irsim.geometry: =1000x300+0+0
- irsim.background: black
- irsim.foreground: white
- irsim.reverseVideo: off
- irsim.highlight: red
- irsim.traceColor: white
- irsim.bannerBg: white
- irsim.bannerFg: black
- irsim.borderColor: black
- irsim.font: 6x13
- irsim.borderWidth: 2
(See a screenshot of IRSIM 9.6 running under magic 7.2 with Tcl/Tk (this is a bit out of date and needs to be updated to IRSIM 9.7 with the Tk-based analyzer window). The layout is the standard magic tutorial tut11a.mag and the setup was made with a slightly modified IRSIM command file tut11a.cmd, executed using the Tcl command source).
The IRSIM digital switch simulator was a casualty of the switch to the Tcl/Tk interpreter, until Magic 7.2 revision 14.The focus of the Tcl/Tk version of Magic is to take advantage of the interpreter's ability to load packages on the fly. The result is that disparate programs can run at the same time. Any program can call routines in any other program, although this is normally done via evaluation of interpreter commands.
To facilitate having other programs pass information back to magic for display, a new magic command "element" was added. This general-purpose method lets other programs print text, lines, and boxes on top of the magic layout.
To make use of IRSIM under Tcl/Tk-based Magic, it is necessary to have IRSIM version 9.6 Revision 1 or newer. IRSIM must be compiled with the Tcl interpreter (the default configuration).
IRSIM works in the following manner. IRSIM is, like magic, exttosim, and exttospice, compiled as a Tcl package, namely as a shared-object library (.so) file. There is a standalone script "irsim" which is normally in /usr/local/bin. Invoked from the script, IRSIM runs under Tcl by itself, and can simulate from any ".sim" file, but cannot interact with magic layout. However, there is also a command "irsim" in magic. Invoked as "irsim", IRSIM loads as an additional package in the Tcl interpreter which launched magic. Able to dectect the "magic" package in Tcl, IRSIM then adds a group of commands designed for interaction between magic and IRSIM. The "irsim" procedure is smart enough to go looking for a ".sim" file matching the magic layout in the window, and generate one automatically if it doesn't exist. Because the IRSIM and magic packages share space in the Tcl interpreter, commands for both are available at any time from the command line. There is no switching between modes to access the simulator. The only caveat is that some IRSIM commands conflict with magic or built-in Tcl/Tk commands. These commands require a prefix "irsim::". For example, "clock" is a command used by Tcl to time the execution of procedures. To get the "clock" command in IRSIM, it is necessary to use "irsim::clock". Several IRSIM commands conflict with Tcl syntax, and so have been renamed. These are indicated below.
The IRSIM/Magic procedures defined when running IRSIM under Magic are as follows:
- irsim [param_file [cellname]]
- This command runs irsim::start in a somewhat intelligent manner. If cellname is not supplied, it defaults to null. Under this condition, the toplevel cell in the magic layout window is assumed to be the one to be simulated. If param_file is missing, it will be substituted with the default value "scmos100.prm", corresponding to 1.0 micron technology.
- watchnode [node_name [magic_color]]
- This command causes IRSIM to display node values on top of the magic layout. With no arguments, "watchnode" expects a node to be (uniquely) selected in magic. It uses the magic "getnode" command to get the name of the node and map it to an IRSIM node name. The current value of the node is then printed on the layout, centered on the select box, and updated as needed by the simulation. If node_name is specified, IRSIM uses the magic "goto" command to find some valid label or paint in the layout belonging to the node, and displays the value there. magic_color is an optional color name from the "long names" column in the magic ".dstyle5" display styles file. If not specified, it defaults to "white".
Note that node_name may also be an IRSIM vector name, in which case the magic "goto" command fails and the value is placed at the position of the magic cursor box.
- unwatchnode node_name
- This erases the simulated node node_name from the magic layout.
- movenode node_name
- This command recenters the label for simulated node node_name to the position of the magic cursor box. This is useful if the value chosen by "watchnode" is in a poor position for viewing.
- watchtime
- This writes the simulation time in nanoseconds on top of the magic layout, placed at the position of the magic cursor box.
- unwatchtime
- Erases the simulation time display from the magic layout.
- movetime
- Recenters the simulation time display on the magic cursor box position.
IRSIM defines a callback function which returns values for all watched nodes and vectors on every update. This function is invoked as an extension of the IRSIM "display" command as follows:![]()
Results of "watchnode" and "watchtime" on the magic layout.
display tclproc procedure_nameThe Tcl procedure procedure_name must be defined as a procedure taking exactly three arguments:proc procedure_name { name value tval } {IRSIM will call procedure_name once for each variable needing a display update, and fill the values for name, value, and tval. Argument name is the name of the variable (node or vector) to be updated. Argument value is the value of the variable (one character for nodes, or a character string for vectors). Argument tval is the time of the update. In order to facilitate the batch processing of all nodes and vectors which are updated at the same time value, procedure_name will be called once more after all variables have been updated, with the syntax
... (procedure body) ...
}procedure_name time t tvalThe procedure procedure_name should check for the condition "${value}" == "t" to differentiate this call from calls on node and vector names.
I have incorporated the most recent set of files from Jeff Sondeen's collection into IRSIM 9.7.4. These represent the major processes available through MOSIS: AMI, TSMC, and HP, as well as the standard SCMOS set.You should always check the FTP site at ISI for the lastest and greatest: IRSIM parameter files.
Currently, there is no way to remove or reload a file being simulated by IRSIM. Fixing this is a high-priority item.
email: | ![]() |
Last updated: February 12, 2006 at 5:03pm