Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20735 Discussions

NIOS II SOC Simulation with altera_avalon_mm_master_bfm

Altera_Forum
Honored Contributor II
1,115 Views

I have designed an SOC with NIOS II using QSYS. The design works in HW with SW running. Now, 

I want to simulate the SOC using the altera_avalon_mm_master_bfm. What I am not clear about 

is, do I simply add in QSYS the verification bfm and connect it to the Avalon bus and it will be removed 

in synthesis? and then use a test program with the TB created by QSYS? 

Is there an example of NIOS II SOC being simulated with a altera_avalon_mm_master_bfm ? 

 

thanks, 

jacob
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
380 Views

This tutorial describes how to simulate with the BFM 

 

http://www.alterawiki.com/wiki/using_the_usb-blaster_as_an_sopc/qsys_avalon-mm_master_tutorial 

 

But does not discuss the NIOS processor. But if you have already simulated a system with a NIOS processor, the procedure should be no different. As far as the processor is concerned, so long as it has a clock, reset, and a boot memory, it should just boot as normal. 

 

If you have a NIOS processor, why do you need a Avalon-MM BFM? The NIOS processor is already an Avalon-MM master. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
380 Views

 

--- Quote Start ---  

This tutorial describes how to simulate with the BFM 

 

http://www.alterawiki.com/wiki/using_the_usb-blaster_as_an_sopc/qsys_avalon-mm_master_tutorial 

 

But does not discuss the NIOS processor. But if you have already simulated a system with a NIOS processor, the procedure should be no different. As far as the processor is concerned, so long as it has a clock, reset, and a boot memory, it should just boot as normal. 

 

If you have a NIOS processor, why do you need a Avalon-MM BFM? The NIOS processor is already an Avalon-MM master. 

 

Cheers, 

Dave 

--- Quote End ---  

 

 

I did run a simulation with the NIOS and some software but it is way too slow to be useful. In the mean time I added the BFM and QSYS did not complain. I just wonder how the BFM and NIOS will co-exist and if NIOS which now has no SW to run on will not interfere with the BFM. Will the BFM be removed in systhesis? The USB-Blaster example is close to what I'm looking for however its the NIOS/BFM combination that I'm after. If it works is should run much faster. 

 

Thanks for your help Dave :-P 

Shvitzer
0 Kudos
Altera_Forum
Honored Contributor II
380 Views

 

--- Quote Start ---  

I did run a simulation with the NIOS and some software but it is way too slow to be useful. 

 

--- Quote End ---  

 

 

No surprise there :) 

 

 

--- Quote Start ---  

 

In the mean time I added the BFM and QSYS did not complain. I just wonder how the BFM and NIOS will co-exist and if NIOS which now has no SW to run on will not interfere with the BFM. Will the BFM be removed in systhesis? The USB-Blaster example is close to what I'm looking for however its the NIOS/BFM combination that I'm after. If it works is should run much faster. 

 

--- Quote End ---  

 

 

If the simulation sets up the environment such that the NIOS processor can boot, then it will, i.e., it will boot and slow your simulation :)  

 

I'd recommend replacing the bootloader RAM image with something that causes the processor to go to sleep, eg., is there a halt instruction? (I don't use NIOS). 

 

Alternatively, create your Qsys system with either the NIOS processor or the BFM, not both, and you'll get the fastest simulation. 

 

The BFM can be left in the system for synthesis. If you read through the tutorial, you'll see comments to that effect. The BFM generates a bunch of warnings during synthesis, but those warnings can be ignored (the warnings are related to missing drivers, since the BFM IP is skipped). 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
380 Views

Thanks Dave ! This was very helpful. I adapted this method to my NIOS based SOC and I was able to stimulate the Avalon bus with the Avalon Master BFM and it works great. I confirmed that you can leave the BFM in for systhesis. To get around the NIOS interference I simply kept it in reset by connecting the .reset_n (1'b0), (in 

the simulation copy of the top-level). I used the QSYS generated testbench with all the generated external BFMs and simply added my own test_case_1.sv to it  

and to the msim_setup.tcl 

 

Shvitzer
0 Kudos
Altera_Forum
Honored Contributor II
380 Views

Glad to hear you got it working! 

 

Cheers, 

Dave
0 Kudos
Reply