SIMULATING SCHEMATIC AND/OR VHDL MODELS IN QUICKSIM II
BASIC STEPS:
- Invoke QuickSim II on a designated component, which may be a schematic, VHDL model, or mixture. Specify the top-most component name.
Example:
- Unix command line: quicksim multiplier
or
- Design Manager: select multiplier in a navigator window and from that window's popup menu select: Open > QuicksimII.
- Open a window to display the component design.
- Open Trace, List, and/or Monitor Windows to display signals.
- Define "forces" (stimuli) to drive the component inputs.
- Run the simulation for a specified time.
- Examine/print the results.
You may also single-step through a model while setting/examining any schematic or VHDL signals and variables.
DESIGN VIEWPOINT FOR ASIC DESIGN KIT STANDARD CELLS
Quicksim II requires a "design viewpoint" to be explicitly created when using most technologies, including the ASIC Design Kit (ADK). This is created via the Design Viewpoint Editor (dve) as follows. Note that it need only be created the first time you simulate a new component. It does not need to be recreated after making changes to the component.
- Invoke the Design Viewpoint Editor (DVE) via the special script supplied with the ADK:
Unix command line: adk_dve my_design –technology ami05
my_design is your component name (as you named it in Design Architect)
ami05 is the AMI 0.5 micron technology (you may also use ami12 for 1.2 micron)
- This script creates several viewpoints. The Quicksim viewpoint is named ami05.
When invoking Quicksim II, specify both the component and viewpoint as follows: quicksim my_design/ami05
QUICKSIM II WINDOWS
- A number of different windows are available to display information related to the simulation of a design:
Schematic Sheet - schematic diagram
VHDL Sheet - VHDL architecture source code
Trace - signal values (logic analyzer form)
List - signal values (tabular form)
Monitor - signal values (current values only)
Report - different types of information about the simulation and the model
- A window is "selected" (activated) by clicking on it. Its border becomes highlighted. Only one window can be active at any time.
- The button palette and all popup menus contain commands applicable to the currently-active window.
- QUICKSIM II COMMAND BUTTON PALETTES
The palette of function buttons that appears is one of six that can be displayed. Each contains functions that pertain to a specific type of activity. We will use only the SETUP, STIMULUS, and DBG VHDL (debug vhdl) palettes.
- Change palettes by clicking on one of the top six buttons:
- SETUP - session control
- STIMULUS - define test stimuli (forces)
- WF EDITOR - edit input/output waveforms
- DESIGN CHG - make minor design changes
- DBG GATES - gate-level debugger
- DBG VHDL - VHDL debugger
- The ten blue buttons in the middle are applicable to all windows:
- RUN -> run simulation
- RESET -> reset the simulation state
- TRACE -> open a Trace Window and/or add signals to it.
- LIST -> open a List Window and/or add signals to it.
- DELETE,CHANGE,COPY,MOVE -> manipulate signals in a window.
- UNSELECT ALL -> unselect all currently-selected objects.
- SELECT COUNTS -> give a report of all currently-selected objects.
- The remaining buttons at the bottom of the palette pertain only to a specific mode of operation (gate-level or VHDL debugging, stimulus definition, etc.)
- NOTE: Commands can also be activated via pop-up menus, pull-down menus from the menu bar, or function keys (as displayed at the bottom of the main window).
- DISPLAYING THE COMPONENT DESIGN
- It is useful to display the design being simulated to help in selecting and evaluating the behavior of signals within the design.
Schematic Diagram:
- Open a SCHEMATIC SHEET window to display the schematic diagram of the component:
- SETUP palette: click on the OPEN SHEET button
(or from the menu bar: File > Open Sheet)
- To display the underlying model (schematic or VHDL) of a component represented by a symbol in a displayed schematic sheet:
- Click on the component symbol to select it.
(or from the popup menu: Open > Down)
- To display the parent schematic diagram of a displayed component model:
- From the popup menu: Open > Up
- Use the palette buttons or the pop-up menu as you would in Design Architect to alter the view (zoom in/out, view all/area, etc.)
VHDL Source Code:
- Open a VHDL VIEW window to display the VHDL source description of the component architecture:
- SETUP palette: click on the OPEN SHEET button
- OR, from the menu bar: File > Open Sheet)
- To display the VHDL archtecture source description of a component instantiated within a VHDL View Window:
- Click on the component label to select it.
- From the popup menu: Open > Down
- To display the parent architecture of a displayed component:
- From the popup menu: Open > Up
DISPLAYING SIGNAL VALUES & WAVEFORMS
Signal Values in Quicksim II
Signal values are represented in Quicksim II as a combination of one of three states and one of four strengths.
- States: 0, 1, and X (unknown state)
- Strengths:
s = strong
r = resistive
z = high impedance
i = indeterminate
- Examples:
0s = strongly pulled down to logic 0
1r = resistively pulled up to logic 1
Xi = unknown state/strength
Displaying Signal Values
- A Trace Window displays signals as logic analyzer waveforms.
- Signal states are indicated by the position of each line relative to the "tic" marks:
0 = below tic marks
1 = above tic marks
X = through tic marks
- Signal strengths are indicated by the line type and color:
S = solid light blue
I = solid yellow
R = dashed medium blue
Z = dotted green
- A List Window displays values in tabular form as strength/state pairs (1s, 0r, etc.) with one signal or bus per column.
- A Monitor Window displays the current signal values as strength/state pairs (1s, 0r, etc.).
Selecting/Unselecting Signals
A signal is "selected" in any window by clicking on it (it becomes highlighted). More than one signal can be selected at any one time.
- Select a signal by clicking on its net (wire) in a schematic or on its name in a VHDL Source Window, Trace Window, List Window, or Monitor Window. NOTE: A signal selected in one window is automatically selected and highlighted in all open windows.
- Unselect a selected signal by clicking on its net again.
- Select a group of signals by dragging a rectangle around them. (Ensure that the entire selected net is highlighted for each.)
- Unselect all selected signals by clicking on UNSELECT ALL in the palette.
Displaying signal values in a Trace, List, or Monitor Window:
- Select each signal(s) to be displayed.
- Select the window(s) in which the signal is to be displayed.
- Trace Window:
click on the TRACE button in the palette,
or select Add > Traces from the popup menu.
- List Window:
click on the LIST button in the palette,
or select Add > Lists from the popup menu.
- Monitor Window:
select Add > Monitors from the popup menu.
- The selected signals are added to the open window. If there is no open window, one is automatically created.
- To display a selected group of signals as a single "bus":
- From the popup menu select: Add > Bus
- In the dialog box, enter the desired bus name and the signals that make up the bus and then click on OK.
Example: For an 8-bit data bus:
- Bus name: D
- Components: D7,D6,D5,D4,D3,D2,D1,D0
- Select the window(s) in which the bus should be displayed:
- Trace Window: click on the TRACE palette button, or from the popup menu select: Add > Traces > Specified.
- List Window: click on the LIST palette button or select Add > Lists > Specified;
- Monitor Window: select Add > Monitors > Specified
- In the dialog box, indicate the display format:
- Enter the bus name. (Ex. D for the data bus)
- Click on the desire radix for the displayed values. (Hex, Octal, Binary, Decimal)
- Click on OK.
- To remove a signal from a Trace/List/Monitor window:
- Select the signal in that window.
- Click on the DELETE button in the palette.
Trace Window Manipulation
- Move a signal within a Trace Window:
- Select the signal in that window.
- Click on the MOVE button in the palette. (A red cross-hair appears)
- Move the coss-hairs to the desired position and click. (The signal is placed ABOVE the signal under the cross-hair)
- Change the view (zoom in/out, view area/all, etc.) via the palette buttons or the popup menu within the Trace Window.
- Change the time scale displayed along the bottom:
- From the popup menu select: Setup > Window
- Enter the desired time increment in the "Domain label" box.
- Enter the desired distance between time labels in box "Domain pixels/interval".
- Click OK when finished.
List Window manipulation
Use the "List Setup Window" to change the display in the List Window.
- Data update frequency ("List Update" box) - selects how often the simulator adds new information to the List Window.
- "On Change" (button) - causes an entry to the List Window every time a signal value changes.
- "Column Width" - number of signal columns displayed.
CREATING INPUT STIMULI ("FORCES")
A "Force" in Quicksim II is a signal value that is forced onto a component's input signal line. The "Forces Waveform Database" (WDB) contains waveforms of signal values to be applied to the circuit inputs during simulation. It can be created interactively or loaded from a previously-saved binary or ASCII file. Once in the WDB, any signal waveform can be modified as desired.
Interactive Creation of Forces
- Click on the STIMULUS button in the palette to bring up the Stimulus Palette.
- Create the Forces WDB with individual "force commands" (specified as time/value pairs.)
- Select a signal (optional).
- Click on the ADD FORCE button,
or from pulldown menu select: Force > Single Value or: Force > Multiple Values
- In the dialog box that appears, enter the signal name (if not previously selected) and one or more time/value pairs to define the desired signal waveform on that net.
Signal name: load
Value: 0 Time: 10
Value: 1 Time: 40
Value: 0 Time: 70
Click on OK
This forces signal "load" to a 0 value at time 10, to 1 at time 40, and then back to 0 at time 70.
- All times specified are relative to the current simulation time. So for the above example, if the current simulation time is T, the specified times actually refer to T+10, T+40, and T+70. (Time can also be specified as absolute values by clicking the Absolute button at the right.)
- Continue to move the cursor down to enter additional time/value pairs.
- Click OK to save these values in the Forces WDB.
To Define a "Clock" (repeating) Signal
- Select the signal (optional).
- Click on the ADD CLOCK button in the stimulus palette. (or from the popup menu select: Force > Clock)
- In the dialog box that appears:
- Enter the signal name (if not already slected in step 1).
- Enter the clock period.
- Enter the relative times within the period at which the clock should change to 1 and to 0.
- Click on OK to save in the Forces WDB.
Example Dialog Box:
Signal Name: clk
Period: 40
Multiple Transitions
Value: 1 Time: 20
Value: 0 Time: 0
Click on OK
This defines a clock with a 40ns period, which is 0 for the first half of the period and 1 for the second half.
To force a signal line to a value at the current time
Force > 1 (or 0 or X)
- Palette Button: FORCE TO STATE (then select value)
To Delete Force Values from the Forces WDB
- To completely "unload" the Forces WDB, from the pulldown menu select:
File > Unload > Waveform DB
- If forces (Force Target) is not highlighted in the dialog box, click on it.
- Click on OK.
Note: This step is required in preparation for loading either a new force file or a previously-saved WDB.
- To delete the forces for one or more selected signals:
- Select the signal(s).
- Click on the DELETE FORCES button in the stimulus palette, or from the popup menu select: Force > Delete
- In the dialog box, click on the Selected Signals button. (Or click on All Signals if you wish to delete them all.)
- Specify a range of times within which the signals are to be deleted.
- Click on OK.
Modifying Waveforms in the Forces WDB
The Forces WDB may be "edited" to change the currently-defined input patterns. (The Forces WDB can also be saved as an ASCII source file, edited with a standard text editor, and then reloaded as described above.)
- Display the waveform(s) to be altered in a trace window:
- Select the "WF EDITOR" Palette.
- Select the signals to be displayed.
- Click on the EDIT WAVEFORM button in the palette.
- Make changes within the Trace Window via the following palette buttons. In most of these cases, changes are made by positioning a crosshair and clicking at the desired location on the waveform.
ADD TOGGLE - click at position to toggle signal (bit)
ADD PULSE - drag a rectangle to represent the pulse
ADD EDGE - a new bus signal value change
CHANGE VALUE - change value of bus signal
MOVE EDGE - drag edge to new location
SHIFT EDGES - shift entire waveform
CUT EDGES - eliminate and save a signal change
COPY EDGES - save a signal change without eliminating
PASTE EDGES - add a saved signal change
DELETE EDGES - remove a change
Saving/Restoring the Forces WDB (internal non-ASCII form)
- Click on SAVE WDB or from the pulldown menu select:
File > Save > Waveform DB
- In the dialog box, click on "forces (Force Target)" if it's not already highlighted.
- In the "Pathname" box, enter the desired path/file name.
- Next to "File Type", click on the WDB button.
- Click on OK
- To restore a previously-saved Forces WBD:
- Click on the LOAD WDB button in the Stimulus Palette, or from the pulldown menu select: File > Load > Waveform DB
- In the dialog box that appears:
- In the "Pathname" box, enter the file name or use the navigator to select the file.
- Click on the button "Load into Forces WDB"
- Click on OK
ASCII Force Files
A "force file" is an ASCII text file, created with any text editor, that contains a list of force commands as they might be issued from within Quicksim.
- Basic force statement format: force signal-name state-value time
Examples:
force inbus 22 0
force inbus a5 20
force inbus 3f 40
force start 0 0
force start 1 10
force start 0 20
set clock period 40
force clk 1 20 -repeat
force clk 0 0 -repeat
NOTE: The last three lines of the example specify a clock signal "clk", as would be defined with the "Add Clock" force command described earlier. Note the use of -repeat.
- To read an ASCII "force file" into the Forces WDB:
- First unload the Forces WDB as described above.
- From the menu bar select: Add > Forces > From File
(or from the pop-up menu: Force > From File)
- In the dialog box that appears, enter the file name or use the navigator to select the file and click on OK.
- To save the Forces WDB in the form of an ASCII force file that can be examined/modified with a standard text editor and subsequently reloaded:
- Click on SAVE WDB or from the pulldown menu select: File > Save > Waveform DB
- In the dialog box, click on "forces (Force Target)" if it's not already highlighted.
- In the "Pathname" box, enter the desired path/file name.
- Next to "File Type", click on the Forcefile button.
- Enter the start and stop times delimiting the portion of the Forces WDB to be saved.
- Click on OK
SIMULATION TIMING MODES (Gate-Level Designs)
Specifying Simulation Timing and Constraint Parameters
- Select the simulation timing mode:
- Unit
- all rise/fall times = 1 time unit (.1ns) (ignore all gate timing parameters)
- Delay
- use timing parameters specified for each component
min: use minimum rise/fall times
typ: use typical rise/fall times
max: use maximum rise/fall times
- Constraint
- use component timing parameters and also check for spikes, hazards, setup/hold times, etc.
- Simulator resolution (i.e. the basic time step) may be changed from the default of 0.1ns.
- Transport Delays may be selected vs. the default of Inertial Delays. Inertial delay models are sensitive to spike while transport delay models are not.
- Spikes, hazards, etc. may be checked by clicking on the Visible button next to "Detail of Timing Mode"
To change the mode of operation for the simulation kernel
- Select Setup > Kernel > Analysis
- Click on Visible to display current settings.
- Timing Mode - select Unit, Delay, or Constraint.
- Select minimum, typical, or maximum rise/fall times.
- Enable/disable spike and hazard detection.
- Make changes on the form as desired.
RUNNING AND CONTROLLING A SIMULATION
To run the simulation for given number of time units (say 100)
- Click on the RUN button and then specify desired simulation time:
For Time: (enter number of time units)
Until Time: (enter stopping time)
Until Stop: (until the simulation stops by itself)
- You can also type a "run" command (ex. run 100) anywhere within the session window.
- A simulation can be run for additional time by repeating teh above steps.
NOTE: Simulation results are automatically displayed in the Traces/List Windows, and the signal values at the time the simulation stops are displayed in the Monitors Window.
To reset the state of the simulation to the beginning (for example to try some different force values.)
- Click on the RESET button in the palette.
- Click on the button next to "State" (if not already active)
- Deselect "Save results ...", unless you want to reload and view the current results at a later time.
- Click on OK.
To make design changes and resimulate
- Open a Design Architect window
- Make the changes to the schematic.
- "Check" the schematic.
- Save it.
- Return to QuickSim II and from the menu bar select File > Load New Models > All This loads the corrected circuit model, replacing the previous one.
Single stepping (use buttons from the DBG VHDL palette)
Step End => step simulation until end of current timestep Step Event => continue until next event Step Iteration => continue until next iteration Step Into => continue, stepping into activated statement Step Over => continue, stepping over activated statement Step Return => continue, stepping over activated statement until a return/wait statement is found and executed
Special VHDL debugging windows
1. Active statements: highlights VHDL statements as they are executed during single-stepping. 2. Assertions: displays all messages created by VHDL "assertion" statements. 3. Breakpoints: list of breakpoint definitions and current status. Create via: Report > Setup > Breakpoints 4. Examine: displays information about an object selected in a VHDL View Window. 5. VHDL Messages: other VHDL information Create via: Report > Design Messages ...
STUDYING AND PRINTING SIMULATION RESULTS
Studying simulation results in the Traces Window
- Click on the VIEW ALL icon in the palette or from the popup menu select View > All to make the entire simulation fit the window.
- Click on the VIEW AREA icon in the palette or from the popup menu select View > Area - two crosshairs appear. Use these to fix a corner of a rectangle and draw a box around the area to be expanded.
- Click on the ZOOM IN icon in the palette or from the popup menu select View > Zoom In to zoom in around the current point to get more detail about the activity at that time.
- Click on the ZOOM OUT icon in the palette or from the popup menu select View > Zoom OUT to zoom out around the current point to show a greater portion of the simulation results (with less detail).
- From the popup menu select View > Time > Specified - enter the time to appear at the left of the display.
- One or more "cursors" (vertical lines on the display) can be used to examine the relationships of all displayed signals at an instant of time.
- From the popup menu select Cursors > Add and enter a time value to place a new cursor at that point in time. Note that the value of each signal line at that time is displayed.
- If two cursors are displayed, the time between them is also indicated.
- To move a cursor, from the popup menu select Cursors > Slide. This makes a red movable cursor appear. Move it to the desired time and click to fix its place.
To produce a hard copy of a List Window (as an ASCII file)
- Click in List Window to make it the active window.
- From the menu bar select File > Write
- In the dialog box, enter file name
- Click on the "Highlight" button if you wish to have highlighted signals marked on the printout.
- Enter the beginning and ending times to be printed.
- Click on OK.
- Send your ASCII file to any printer.
To produce a hard copy of a Trace Window
- Click in the desired window to make it the active window.
- From the menu bar select File > Print > Active Window
- In the dialog box, enter Printer Name: mentor_ps (This will cause the printout to be sent to "emerald")
- Select a scale factor or rotation if the defaults are not satisfactory. (Try the defaults first!)
- Click on OK.
RUNNING QUICKSIM II SIMULATIONS IN "BATCH" MODE
QuickSim II can be run in batch mode, eliminating the time needed to bring up the window display. This is useful primarily if there will be no "debugging" in the simulation session. Batch mode simulation is used primarily to generate a simulation output listing for a given set of test vectors.
To invoke QuickSim II in batch mode, execute the following from a UNIX command line:
quicksim my_component -NODisplay < forces_dofile
Where:
my_component => Component to be simulated.
forces_dofile => Batch file containing list of quicksim commands for the simulator to "do".
Example: Sample forces_dofile to do a simple simulation run:
add lists clock clear b c d out
dofile force_file
run 1000
$set_active_window("List");
write report report_listing 0 1000 -Highlight
The above commands are executed by QuickSim as follows:
- add lists
clock clear b c d out
Create a list window for the 6 signals listed.
- dofile
force_file
Execute force commands from the ascii force file "force_file" (see handout on force files).
- run
1000
Run the simulation for 1000 time units.
- $set_active_window("List");
Activate the list window.
- write report
report_listing 0 1000 -Highlight
Write ascii file "report_listing" from the list window for time period 0-1000 and highlight signal changes.