Nios Sim
Nios Sim
Designs
f For more information about the Nios II SBT for Eclipse, refer to the Nios II
Software Developer’s Handbook.
f For more information about the SignalTap II embedded logic analyzer, refer
to AN 323: Using SignalTap II Embedded Logic Analyzers in SOPC Builder
Systems and AN 446: Debugging Nios II Systems with the SignalTap II Embedded
Logic Analyzer.
© 2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS,
QUARTUS and STRATIX are Reg. U.S. Pat. & Tm. Off. and/or trademarks of Altera Corporation in the U.S. and other countries.
All other trademarks and service marks are the property of their respective holders as described at
www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in
101 Innovation Drive accordance with Altera’s standard warranty, but reserves the right to make changes to any products and services at any time
without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or
San Jose, CA 95134 service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest
version of device specifications before relying on any published information and before placing orders for products or services.
www.altera.com
Subscribe
Page 2 Before You Begin
1 The design example used for this application note is a complete Qsys
system. Ensure that you have completed building your Qsys system before
you start to generate the simulation models.
1 If your system has exported ports other than the clock and reset, choose
Standard, BFMs for standard Avalon interfaces.
3. Select the SOPC Information (.sopcinfo) file name by browsing to <your project
directory>/an351_design, and then select niosii_system.sopcinfo.
4. For Project Name, type hello_world_an351.
5. Select Hello World from the Templates option.
6. Click Finish.
7. Right-click on hello_world_an351 in Project Explorer and then click Build Project.
Now you have successfully built the Hello World project. In the next step, you will
invoke ModelSim simulation from the Nios II SBT for Eclipse. This function populates
the Memory Initialization File (.mif) with the Hello World program and starts the
ModelSim software.
8. Right-click on hello_world_an351 in Project Explorer. Point to Run As, and then
click Nios II ModelSim.
Run the simulation in the ModelSim simulator by performing the following steps:
1. In the ModelSim software, on the File menu, click Load. Browse to <your project
directory>/an351_design and select wave.do. This step opens a waveform viewer
with all the JTAG UART signals.
2. In the Transcript window, type run 2 ms. This step starts the simulation for two
milliseconds.
At the end of the simulation, you should see a “Hello from Nios II!” message in the
Transcript window. You can observe the simulation results from the waveform viewer
as well. Figure 1 shows the simulation result. The waveform is zoomed in at a specific
simulation time in which the Nios II processor writes the first H character to the
JTAG UART component.
Conclusion
Simulation and verification are vital parts of the design process. You can
comprehensively verify the Nios II processors with board-level debugging, and RTL
simulation with the ModelSim simulator. RTL simulation is an important part of the
design process, particularly for configurable systems, because it enables you to probe
deeply embedded signals in the processor and your peripheral set. RTL simulation
also helps verify your system before you try out your design in the actual hardware.