Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

NIOS II SOC Simulation with altera_avalon_mm_master_bfm

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

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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