From Verilog Quickstart: A Practical Guide to Simulation and Synthesis in Verilog, 3rd Edition
INTERACTIVE DEBUGGING
Interactive debugging is the ultimate way of finding problems in a simulation. You can look at any value; see what is driving a wire; change values on wires and regs; set breakpoints; add signals to a waveform display; and so on. The entire simulation becomes an open book for you to look at.
This book has attempted to be simulator-independent. This section provides details on interactive debugging using commands native to Verilog-XL TM. Some clone simulators may include some or all of these commands and features by the same name or by using other commands. Companies that primarily use simulators other than Verilog-XL often have some copies of Verilog-XL for debugging use.
Going Interactive
The main command for going interactive is $stop. The $stop command is a breakpoint that stops simulation and places the simulator into interactive mode. There are other ways to put the simulator into interactive mode. It is often desirable to start the simulator in interactive mode. You can start the simulator in interactive mode by using the -s command-line option. The -s stands for "stop at time 0." It is equivalent to having initial $stop; in one of your Verilog modules.
You can also put Verilog into interactive mode by interrupting it. You can start Verilog in the normal fashion, and they hit the interrupt key. The interrupt key can be a button in a graphical user interface, or a keyboard key. The interrupt key is most commonly
Products & Services
Topics of Interest
CATCHING PROBLEMS LATER IN A SIMULATION Catching an error in simulation can be difficult. If an error occurs early in a simulation, you might catch it with tracing from the start. If an error occurs...
SUMMARY OF DEBUGGING There is no magic secret to debugging a design. Debugging is a process of looking for common errors and then observing the operation of the circuit. With experience, you will...
It is obviously much easier and less expensive to find and debug an error in your Verilog code than in a completed chip. In Verilog you can watch the exact sequence of events, look at values buried...
OVERVIEW The hello simulation and the previous chapter's examples gave you a preview of one way to print out information: The $display system task. All of the commands to print out results are...
3.3 Testbenches and Simulation When the RTL code of a design is completed, the next step would be to create testbenches to simulate the design. Testbenches can be in many different forms. Some...