Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHow to use Avalon-MM Master BFM?
Hello, all.
I want to use Avalon Verification IP Suite to check a Qsys custom componet, which have an Avalon salve interface and a Avalon conduit interface connecting a LSI. I wrote this program to test if the custom component can give right response to the Avalon Master BFM.
//Console messaging level
`define VERBOSITY VERBOSITY_INFO
//BFM hierachy
`define CLK_BFM top.tb.clock_source
`define RST_BFM top.tb.reset_source
`define MM_MASTER top.tb.avalon_mm_master
`define CONDUIT_BFM top.tb.conduit_bfm
module test_program();
import verbosity_pkg::*;
import avalon_mm_pkg::*;
event start_test;
event end_test;
//----------------------------------------------------------------------------------
// Set verbosity before the test starts
// Qsys-generated testbench activates clock and reset BMFs
//----------------------------------------------------------------------------------
initial begin
set_verbosity(`VERBOSITY);
// initialize BFMS
`MM_MASTER.init();
end
//----------------------------------------------------------------------------------
// Main test block
//----------------------------------------------------------------------------------
initial begin
// wait for reset inactive
wait(`RST_BFM.reset == 1);
-> start_test;
end
initial begin
@ start_test;
// start write access
`MM_MASTER.set_command_request(REQ_WRITE);
`MM_MASTER.set_command_address(16'h0);
`MM_MASTER.set_command_idle(2,0);
`MM_MASTER.set_command_init_latency(0);
`MM_MASTER.set_command_data(32'h0,0);
`MM_MASTER.push_command();
end
endmodule
Although this program can be compiled by ModelSim with no error, but it seems the write access was not started. Can you give me some hints or some examples about how to test custom components wit Avalon IP verification suite? Regards, feng51 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- For my previous post, I couldn't get the solution given by david for joel working as my model sim is only 6.5 version. I'Ll download the latest and try the solution. --- Quote End --- You cannot mix-and-match. If you are using Quartus 13.1 to generate the code, then you *HAVE* to use the same version of Modelsim as shipped with that version, whether it is the Altera Starter Edition, or full Modelsim-SE edition. I've had cases where models do not work correctly when mixing tool versions; its best to stick with the combination verified by Altera. Cheers, Dave - Altera_Forum
Honored Contributor
Hi Dave,
I am following the steps in the read me file give in the winzip folder by you , but Quartus-generated Modelsim simulation setup script modifications - Qsys creates the Modelsim setup script C:\temp\qsys_vip\qwork\qsys_vip\simulation\msim_setup.tcl I can't find this msim file in the simulation folder. Could you tel me what might be the reason? Thanks! - Altera_Forum
Honored Contributor
--- Quote Start --- C:\temp\qsys_vip\qwork\qsys_vip\simulation\msim_setup.tcl I can't find this msim file in the simulation folder. Could you tel me what might be the reason? --- Quote End --- Which version of the tools (Quartus and Modelsim) are you using now? Did you make sure to select the simulation option (pull-down menu) before you clicked the "generate" button in the Qsys GUI? Cheers, Dave - Altera_Forum
Honored Contributor
Hi Dave,
Just realized that i didn't install the model sim 10.1 v, previously was running on model sim 6.5 . Now it's there in the folder. Thanks ! - Altera_Forum
Honored Contributor
Hi Dave,
At this step: Modelsim simulation - Start Modelsim - Change directory to the simulation folder Modelsim> cd {C:\temp\qsys_vip\qwork\qsys_vip\simulation\mentor} - Source the (edited) msim_setup.tcl script Modelsim> source msim_setup.tcl - Build and elaborate the design Modelsim> ld when i type ld i am getting the following error ** Error: (vlog-19) Failed to access library 'altera_verification' at "altera_verification". # No such file or directory. (errno = ENOENT) # C:/altera/11.1/modelsim_ase/win32aloem/vlog failed. Thanks! - Altera_Forum
Honored Contributor
As I have repeatedly stated, you *MUST* use a valid combination of tools. You have not told me what tools you are using.
The error message above indicates c:/altera/11.1/, i.e., version 11.1. If you're not going to either use the version of tools clearly stated in the tutorial, or use the latest version of the tools, then its impossible to help you. Altera changes things between versions, so its impossible to write a one-size-fits-all tutorial. Cheers, Dave - Altera_Forum
Honored Contributor
Ya , sorry am using :
Quartus II 11.1sp1 Web Edition (32-Bit) and ModelSim-Altera 10.0c (Quartus II 11.1) Starter Edition. Thanks! - Altera_Forum
Honored Contributor
--- Quote Start --- Quartus II 11.1sp1 Web Edition (32-Bit) and ModelSim-Altera 10.0c (Quartus II 11.1) Starter Edition. --- Quote End --- The tutorial: http://www.alterawiki.com/wiki/using_the_usb-blaster_as_an_sopc/qsys_avalon-mm_master_tutorial was written using Altera Quartus 11.1sp1 and Modelsim-ASE (Altera Starter Edition) 10.0c, so it should work just fine. Cheers, Dave - Altera_Forum
Honored Contributor
Hi ,
Am using Quartus 11.1sp1 and Modelsim-ASE (Altera Starter Edition) 10.0c. Am following the steps given in the read me file provided in the qsys_vip.zip file in post 25 as i had the same error as posted by joel in post 21 . But now i have tried everything , but am not able to fix the following error # Loading ./..//submodules/bytestream_pli.dll # ** Error: (vsim-3170) Could not find 'C:\temp\qsys_vip\qwork\qsys_vip\simulation\mentor\libraries\work.qsys_vip_tb'. # Error loading design This error arises when i try loading i.e ModelSim>ld i checked the directory it does contain qsys_vip_tb Can some one help me with the error , am stuck !! Thanks! - Altera_Forum
Honored Contributor
--- Quote Start --- Am following the steps given in the read me file provided in the qsys_vip.zip file in post 25 as i had the same error as posted by joel in post 21 . --- Quote End --- Why are you using that zip file? If you *READ* the thread, you will see --- Quote Start --- The readme.txt file indicates the differences between Quartus 12.1sp1 and Quartus 13.1 --- Quote End --- You make it very difficult to help you, if you will not read, and follow instructions. Cheers, Dave