A Digital Circuit Simulator

N. Wirth

The program Simulator serves to simulate synchronous digital circuits described in the language Lola . One proceeds as follows:

0. The circuit is specified by a text written in the language Lola.
1. The specification is compiled. The result is a data structure in the form of a binary tree.
2. The command Simulator.Start must be issued after each compilation.
3. The command Simulator.Select v0, v1, ... ~ specifies the variables whose values are to be listed.
4. The command Simulator.Set serves to assign initial values to the input variables.
5. The command Simulator.Label lists the names of the selected variables.
6. The command Simulator.Step n issues n clock ticks and lists the resulting values.

The following example is a 2-bit counter

MODULE Counter
IN rst': BIT;
OUT q0, q1: BIT;
BEGIN q0 := REG(rst' * ~q0); q1 := REG(rst' * (q1 - q0))
END Counter.

The commandLola.Compile compiles the text. Lola.Show lists the result (CK is the default clock):

q1 := (CK^('1:(rst'*(q1-q0))))
q0 := (CK^('1:(rst'*(~q0))))

Simulator.Start initialisiert den Simulator.

Selecting q0, q1, rst', initializing rst' to 1, and repeatedly issuing Simulator.Step 1 produces


Modul Simulator implements the following commands:

StartMust be called after every compilation
Select {name}select variables to be traced
Set {name = value}assign initial input values
Labellist names of selected variables
Step nexecute n steps
Resetreset all registers to 0
SetTabsset tabs

Note: Register clock inputs specified in the Lola text are ignored.


The software is available as a tar gzipped file or as an Oberon AsciiCoded file

[ CS-Department | Institut for Computer Systems | CAD Tools ]

ETH Zürich: Department of Computer Science
Comments to Jacques Supcik <supcik@inf.et hz.ch>
May 26, 1998