Running simulation – Altera IP Compiler for PCI Express User Manual
Page 303

Chapter 16: Qsys Design Example
16–15
Simulating the Qsys System
August 2014
Altera Corporation
IP Compiler for PCI Express User Guide
7. Open the file altera_pcie_bfm.v in a text editor.
8. Replace the following line of code:
parameter PIPE_MODE_SIM = 1’b1;
with the following replacement code:
parameter PIPE_MODE_SIM = 1’b0.
9. Save and close the file.
In the Qsys design flow, the altgxb_reconfig block must be instantiated outside the
Qsys system. Therefore, the design example Qsys system does not include an
altgxb_reconfig
block. When simulating the Qsys system in serial simulation mode,
you must force the busy_altgxb_reconfig signal to zero to ensure that the reset
controller never detects a busy_altgxb_reconfig signal falling edge; because the
transceiver reconfiguration block is not instantiated, the reset controller subsequent
actions would lead to failure. In PIPE mode, the altgxb_reconfig signal is ignored. In
the full design example, the altgxb_reconfig module is instantiated outside the Qsys
system.
Running Simulation
To run the Qsys testbench, follow these steps:
1. Start the ModelSim simulator.
2. In the ModelSim simulator, change directories to your testbench directory,
<project_dir
>/
hip_s4gx_gen1x8_qsys/testbench
. Call this directory <testbench
directory>.
3. To run the setup script, type the following command at the simulator command
prompt:
do mti_setup.tcl
r
4. To compile all the files and load the design in Modelsim, type one of the following
commands at the simulator prompt:
■
To prepare to debug with waveforms, type the following command:
ld_debug
r
■
To prepare to simulate in optimized mode, type the following command:
ld
r
5. To set up a waveform file if you have not already done so, follow these steps:
a. In the ModelSim Objects tab, highlight files you wish to display in your
simulation waveform.
b. Right-click on your selected signals, select Add > To Wave and click Selected
Signals
. The Wave tab displays with your selected signals.
c. On the File menu, click Save Format. The Save Format dialog box appears.
d. Change Pathname to <testbench directory>/wave_presets.do.
e. Click OK.
Your simulation run is set up to display these signals. In future runs, you can skip
step
.