Modelsim simulation process

Source: Internet
Author: User

Modelsim simulation process

1. Introduction to Modelsim

.

2. Modelsim simulation process: the basic simulation process of Modelsim includes creating a library, creating a project, compiling, simulating, debugging, and running Modelsim In the libero environment, the software automatically maps the database and generates engineering files. The functional simulation, integrated simulation, and post-simulation map the presynth, postsynth, and postlayout libraries respectively.

The basic process is: Create a working database → compileSource code→ Start simulation → analyze and debug.

2.1 create and map databases

In Modelsim, any design implemented using languages such as VHDL, OpenGL, and SystemC is compiled into a library.

Method 1: Select File> New> library to create and map to the library;

Method 2: run the command vlib work2 at The Modelsim> prompt to create a library and vmap work work2 to create a ing library;

2.2 build a project

Modelsim simulation requires you to create your own project, and Modelsim also provides the folder management project function.

Step 1: File> New> Project, and specify the library file name;

Step 2: Create a new file or import a file;

2.3 compile files

After the project is created, use the compile function to compile the source file. When Modelsim is started in the libero environment, the system runs the run. Do script file to automatically compile the source file.

Right-click the file and select compile all to compile all the project files;

Start simulation, use the simulation> Start simulation> Select Design tab function to enable Modelsim to enter the simulation status, and then run simulation. In the libero environment, run Modelsim to directly start the simulation step.

You can set the simulation time or select all

TCL command: Do run. Do-after the design is modified, use this command to re-import the design;

Do Wave. Do-open the waveform list file or add a list to the current waveform;

Restart-reset the current simulation and re-simulate from 0;

Run 1 ms-1 ms of simulation time;

Run all-run all the simulation;

In the libero environment, you can write a script file instead of the run. Do file, which greatly simplifies the simulation operation when the project is large. ※Do wave. do adds the list of waveforms required by you. ※restart resets the current simulation time to 0. ※the file name must be different from run. do file; ※in Libero, set project> Settings> simulation to import your own files. do file;

2.4 analyze the data-wave and wave waveform windows. It is one of the most common windows for you to observe the simulation results intuitively and conveniently. You can use the menu View> wave or command view wave to open the Add signal: ※in the signal window, right-click to use the "add to wave" function;

※Use the Add wave command in the main window to add signals;

※Use the DO <FILENAME>. Do command in the main window to add a signal list;

※Use the drag-and-drop operation to drag and drop data directly from the signal, structure, and other windows to the wave window;

Shortcut operations: ※operations such as waveform zoom-in and zoom-in, keyboard "+", keyboard "-", full screen-keyboard "F", and mouse zoom-keyboard "C ";

※The area is enlarged and the selected area is displayed in full screen;

※To Add a cursor, you can use the cursor time difference to calculate the period and other parameters;

※Display/hide the signal path for easy reading;

Set breakpoint: ※right-click the variable and select 'insert breakpoint'. When the waveform value of the selected variable changes, the simulation is automatically paused.

Save/open the list: ※the waveform list is. do executable script file; you can use do <FILENAME> to open the list. do command execution; ※the waveform formats option saves attributes such as variables, display methods, and relative positions of variables;

Save/open the waveform: ※the waveform file is. for wlf format files, use File> datasets> saveas to save the waveforms. ※the waveform files can be used for Waveform Comparison objects. Use File> datasets> open to open them;

Waveform Comparison: ※in AE, only manual Waveform Comparison can be performed;

※Use File> datasets to open the waveform file and add the signal to be compared to the wave window;

Analysis Data-list: displays data in tabular form. You can search for data with special values or conditions to simplify the data analysis process. The List window can be opened through the menu View> list or the command View list.

Data analysis-Source: the source window has full editing capabilities and provides some operations for data analysis. The source window can be opened by double-clicking the workspace's total file or signal. ※View variable value: hover your mouse over the variable to display the current value. ※set breakpoint: sourceCodeWindow setting condition breakpoint;

Analysis Data-memories: The Memory window lists the data of storage units in the project, facilitating debugging of memory operations. ※Step 1: Expand the module that calls the ram unit and expand it to ram_roc> statconfig. ※step 2: Select mem_512_9 in the objects window and select view memory contonts;

Analysis Data-Watch: The Watch window can monitor variable changes. The watch window can be opened through the menu View> watch or the command view watch. Objects in the watch window can be dragged in the Object window, wave window, and source window by dragging;

Analysis Data-signals: The signals window displays the variables and variable values of the selected process module. In the signals window, choose View> signals or run view signals. ※Sort: supports ascending or descending order of letters. ※Drag-and-drop operation: You can drag the signal to the wave, list, and watch windows. ※filter: select the signal to be viewed (input and output signals ). ※Right-click the signal to view the source code;

3. Advanced Modelsim functions supported by the se version, but not supported by the AE version.

3.1 code coverage Modelsim se allows Statistics on code coverage. Code coverage refers to code coverage and is a measurement method.

※Statement coverage)

※Branch coverage)

 

※Condition coverage)

※Fsm coverage)

※Path coverage)

The Modelsim se version can test the code coverage rate. The code coverage rate is an important indicator of test and verification. The general opinion about test and verification is as follows: ※the coverage rate only indicates the code that has been tested, it does not mean that the code is tested. ※do not trust the coverage data too much. ※a stable and comprehensive test simulation requires that the coverage rate be as high as 100%. ※path coverage rate> Decision coverage> statement coverage.

Statistical coverage rate operation process: ※step1: Set the compilation option and select the code coverage rate to be calculated. ※step2: Enable the code coverage rate statistics function to start simulation. ※run simulation, analyze the data;

3.2 waveform compare Waveform Comparison can quickly locate the differences between the design before and after modification. Before Waveform Comparison, save the original design waveform file, which is used as the comparison file. ※Step 1: Open the Waveform Comparison wizard settings; tools> waveform compare> comparison wizard; ※step 2: import the waveform file as the comparison object; ※step 3: select the range of the comparison signal; ※step 4: select the signal to be compared based on the signal range. ※step 5: analyze the data;

3.3 tracking data streams: the data stream window can be used to visually trace the VHDL signal or the network variables of the Tilde. The process of driving signals or driving network variables on the interface is displayed on the left, the drive signal is displayed on the right. You can double-click the signal to be tracked in the wave window to open the dataflow window.

※Observing the connectivity of the design: You can check the physical connectivity of the design, and observe the input/output of signals, interconnected networks, or registers one by one.

※Tracking event: tracking an unexpected output event. Using an Embedded Waveform observer, you can trace the event source by means of a signal's jump-back tracing.

※Tracking unknown state: Unknown state is transmitted in the design. It is easy to track the sources of indefinite state with the trace> chasex function in dataflow.

※Display level: You can use a hierarchical instance to display the connectivity of the design.

Engineers prefer to use the trace> chasex feature in the dataflow window to track the source of the variable transmission at the driver level.

Summary:

Simulation Verification plays an important role in the entire project process. scientific and reasonable simulation methods and simulation techniques can achieve twice the result with half the effort. On the contrary, if you simply analyze the theory without integrating the advantages and features of multiple tools, the project may be unfeasible.

Achieve: ※reasonably simulate each module of the system to shorten the design cycle of the system. ※it fully supports the simulation function from before the function to after the layout and wiring.

 

(From: http://blog.eccn.com/space.php? Uid = 170730 & Do = Blog & id = 3950)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.