Lattice_diamond_ Call modelsim_ Emulation

Source: Internet
Author: User

Pre-simulation: Add the lattice emulation library to Modelsim:
1. Remove the read-only attribute of Modelsim.ini under the Modelsim installation directory.
2. Open Modelsim, change directories File>change directory (this is where the library is to be stored, typically placed in the root directory of Modelsim, such as D:\modeltech_10.1a\Lattice)
3. Create a new library file>new>library, take a name (I use the MACHXO2 series chip, take the MACHXO2)
)


4. Compile the library compile>compile, the Compile dialog box appears, select the newly-created lattice in the library item; Look for scope Select the directory where you installed the Diamond Emulation library (my is D:\lscc\diamond\3.4_x64\cae _library\simulation\verilog\machxo2, if you are using VHDL to write code, then choose \VHDL). Select all, compile.
Wait for the compilation to complete. Keep the library machxo2 and compile the contents of the D:\LSCC\DIAMOND\3.4_X64\CAE_LIBRARY\SIMULATION\VERILOG\PMI. (Here are some of the IP core emulation libraries) waiting for the compilation to complete, click Done to complete. Exit Modelsim.


5. Open Modelsim.ini, in the [Library] more than a row Machxo2=machxo2
Change it to Machxo2 = D:\modeltech_10.1a\Lattice\machxo2


Saves the exit and restores the read-only property.
When we open the Modelsim, we will find the library queue more machxo2.

To create a new simulation file:
Or the second lesson in the Demo1 project, the following for this project to establish a corresponding simulation file.
1. Right-click Input files,add->new file, select Verilog files, enter the file name and save path (not Chinese).

Enter the simulation test program under the new simulation file:

Save, the above program you do not understand now it's OK, continue to learn you can read. Well, the simulation file we've set up, and then we're ready to simulate.

Start Simulation:
Open Lattice Diamond,
Tools>options>environment>directionaries>modelsim install directory/win32. Click OK


2. Click Simulation Wizard to enter a name and path


3 Select the tb_demo1_andgate.v file to add the Testbench file. Click Next.


4. Modelsim is automatically called and jumps to the project bar. Right-click one of them and choose compile all.

After compiling, the following results should appear to indicate no errors:

5. Select Simulate>start Simulation to add Machxo2 library under libraries

Then click the Design tab, expand Work, and left-click TB. Then click OK to start the simulation. (The optimization option below is not ticked)

If the following error occurs during the simulation, you can simply click Confirm to skip, without interfering with the subsequent emulation:

6. In the object bar, right-click the signal you want to view. Addto>wave>selected Signale. You can also hold down the CTRL key to select multiple files together.

7. Set the step emulation step and display unit.


Click the Run-all button on the toolbar:

Run to get simulation results.


Note: When writing a testbench file, you need to include the statement in the file.
GSR Gsr_inst (. GSR (1 ' B1));
pur pur_inst (. PUR (1 ' B1));

Lattice_diamond_ Call modelsim_ Emulation

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.