APPLICATION NOTE #1

Quicksim repetitive input time saver.

Abstract

Each time the Quicksim package is loaded, the user must input the stimulus that they want their circuit to encounter.  If there are more than a couple signals to force, or clock, the data entry required to perform these tasks is very time consuming.  The time consumption is magnified if you run Quicksim many, many times in the debugging process.

This application note deals with the automation of repetitive input into the Quicksim package.

Author: McDermott, Ashley. Koziar, Kory. Stangeland, Duane.


When you have Quicksim open, any command that you enter into the program via the keyboard or mouse is echoed in an interpreted format to the window or terminal in which Quicksim was invoked.  In order to automate the data entry process for the next time that you want to apply the same stimulus, cut the corresponding echoed commands from the terminal window and paste them into a text editor of your choice.

To simplify the cutting and pasting process, before you enter a command that you are going to want to capture the interpreted format of, go into the terminal window where the echoed command will be placed and press enter a couple of times to insert blank lines onto the screen.  Then return to Quicksim and enter the command via the keyboard or mouse.   Once command entry is complete, return to the terminal window and cut the interpreted format from the screen.

Once you have finished cutting and pasting the commands from the terminal window, save the text file to disk. 

To test for the proper operation of the file that you created, exit and restart Quicksim.  Open the schematic as you regularly would and select the signals that you wish to view in the trace window.  Next, open the trace window, and type the command dof filename (for example: dof lab3.input).  dof stands for do-file.  When this command is entered, the file that you created will be inputted into Quicksim, and the commands in the file will be interpreted as if you had just taken the time to enter them one-by-one.

If taking the time to highlight the signals that you want to trace, and opening the trace window bugs you, you can also put these commands into your file using dof to read them back each time that you invoke Quicksim.  Beware that any new features that you have added to your design since the creation of your automation file will not be recognized until you update your file.  In other words, each time that you change a netname or add an interface port to your schematic you will have to update your automation file.

There is no reason that you cannot have multiple automation files, perhaps one for the setup of the trace window and one for the applied stimulus to your circuit.

The following is a copy of the automation file that I used in the simulation of a circuit with 4 inputs.  The code drives the 4 inputs A0, A1, B0, and B1 to all 16 possible combinations.

$set_clock_period(17.6);
$force("/CLOCK", "0", 0, void, void, @relative, @repeat, void);
$force("/CLOCK", "1", 8.8, void, void, @relative, @repeat, void);

$set_clock_period(35.2);
$$delete_forces(@noall, void, "/A0");
$force("/A0", "0", 0, void, void, @relative, @repeat, void);
$force("/A0", "1", 17.6, void, void, @relative, @repeat, void);

$set_clock_period(70.4);
$$delete_forces(@noall, void, "/A1");
$force("/A1", "0", 0, void, void, @relative, @repeat, void);
$force("/A1", "1", 35.2, void, void, @relative, @repeat, void);

$set_clock_period(140.8);
$$delete_forces(@noall, void, "/B0");
$force("/B0", "0", 0, void, void, @relative, @repeat, void);
$force("/B0", "1", 70.4, void, void, @relative, @repeat, void);

$set_clock_period(281.6);
$$delete_forces(@noall, void, "/B1");
$force("/B1", "0", 0, void, void, @relative, @repeat, void);
$force("/B1", "1", 140.8, void, void, @relative, @repeat, void);

I have no idea of what most of the text means in the above example, but the beauty of it is that you do not need to understand the format or the text.  It is generated for you by Quicksim.

Now each time  I enter Quicksim, I just have to highlight the signals of interest, and type dof mult4.dofile.  (mult4.dofile is the name of the text file that I saved to disk.)   After the file is loaded, typing run 600 finishes my simulation. 

Compare the effort of typing dof mult4.dofile and run 600 to the effort and time required to setup the clock and the 4 input signals of this circuit to operate in the same fashion indicated in mult4.dofile.


Reference: Gershom Birk