Hi, my name is Tzy Way and I am an application
engineer form Altera Corporation. The purpose of this video is to show how to
simulate a Nios II processor design through command line. This is the agenda of this video. This video shows the steps on simulating a
simple hello world program in Modelsim. A simple system which consists of Nios II,
onchip memory and JtagUart is built using Qsys. Once the system is done, we can generate testbench
in Qsys and the files necessary for simulation are generated. First, Qsys testbench system files contain
the information of the exported surfaces that connected to the Avalon bus functional model
as well as simulation model generated. Next, there is also tickle script that can
helps to set up simulation environment and create alias command to compile the require
libraries and system design files. There is also memory initialization file that
is used to initialize component in the system. This is Nios II command shell
Change to the project directory These are all the files included in this project
directory Invoke Qsys Select Qsys system Select Generate
Generate Testbench system Choose simple BFM for clocks and resets
Generate The testbench generation is done Once we have completed the testbench generation
in Qsys, we can start to create Nios II software. First, we need to create a software folder
which contains of application folder and board support package folder in the project directory. Place the hello world c program script into
the application folder. Then, create the board support package followed
by application makefile. With the makefile generated, we can use command
make all to compile the source files. Next, we need to create a memory initialization
file which is used for initialize the memory with application instruction and data. Now go to the software folder
App folder is created, so we create the bsp folder Create the board support package Change the directory to app folder and create
the application makefile Compile the source file
Create the memory initialization file To perform simulation in Modelsim, invoke
modelsim and change the working directory to mentor folder. There is msim_setup.tcl script located in
this folder and we need to modify it in order to include the memory initialization file
created. With the modified tickle script, we can run
the tickle script. After that, compile, elaborates the design
and run the simulation. Invoke Modelsim Change the directory to mentor folder There is msim_setup.tcl in this folder, modify
the tickle script so that the memory initialization file will be included into the simulation
directory Save it Run the tickle script Compile and elaborates the design Load the wave.do file to see the waveform of the selected signal and run the simulation We can see that Hello from Nios II is printed on the transcript window We have reaching the end of the video. For more information, we can refer to application
note 351 and also Nios II software developer handbook. Thank you for watching.

Simulating a Nios II processor design
Tagged on:                         

Leave a Reply

Your email address will not be published. Required fields are marked *