Forum Discussion
Downloading previous versions of documents
I am trying to download the Altera Verification IP Suite User Guide Version 2.0 January 2011 and its accompanying design file. But I am being directed to the latest Version 3.0 and design file if I use the link below:
http://www.altera.com/literature/ug/ug_avalon_verification_ip.pdf Is there a server with all previous versions of a document? I need the older version because the new one's tutorial is making use of QSys to verify a device with Avalon-ST, but I want to use SOPC Builder instead. I have not moved to QSys yet.21 Replies
- Altera_Forum
Honored Contributor
--- Quote Start ---
Any suggestion on how to handle this error? --- Quote End --- To the top of sopc_system_tb.sv add the line# ** Error: (vsim-3010) - Module 'sopc_system_tb' does not have a `timescale directive in effect, but other modules do.# Region: /sopc_system_tb/dut/the_master_bfm/master_bfm
Then Modelsim-ASE was happy for me. To build and run the code, on the Modelsim command line I used the commands;`timescale 1ns / 1ps
Enjoy! Cheers, Davedo setup_sim.do s vlog -sv sopc_system_tb.sv vsim -t ps -novopt +nowarnTFMPC sopc_system_tb do sopc_system_tb.do run -a - Altera_Forum
Honored Contributor
--- Quote Start --- I am using ModelSim Altera Starter Edition vsim 6.6c Simulator 2010.08 Aug 24 2010. --- Quote End --- I'll try it with a Modelsim-ASE version and see what I get. --- Quote Start --- Assuming we get this error cleared, do you think I can still achieve what I'm trying to do, i.e. read values from text file, simulate component, and save output to another text? --- Quote End --- Yep, absolutely. SystemVerilog is both a programming language and a hardware language. Whatever you can do in C/C++, there is something similar in SystemVerilog. You can even link C to SystemVerilog ... but I'm not sure if Modelsim-ASE supports that. --- Quote Start --- In your sopc_system_tb.sv file, I can see that I will have to modify the two tasks avalon_write_single and avalon_read_single to be able to do what I want, but I don't know how to do that yet and it does seem a bit complicated for a relatively simple thing to do if I was testing a code in C for example. I was just wondering whether this is the best way for me to test a hardware module. Or perhaps everything is complicated with FPGAs... damn I should have stuck with C coding :) --- Quote End --- I suspect you were just doing simple C code. The real world is much more complicated. Testing code at the component level, and then at the system-level takes extra effort. But that effort pays off big-time when you do not have to debug difficult problems; you avoided them by putting in the extra work up-front. For example, when you write C code, do you write 'unit tests' to ensure that every C function does what it is supposed to do given correct inputs and incorrect inputs? Do you have a 'make check' build command that confirms every test passes. Do you have a continuous-integration build system, where your system-level code is checked out of a code repository and is continually built and checked ... The complexity of real-world development occurs everywhere :) Cheers, Dave - Altera_Forum
Honored Contributor
I am using ModelSim Altera Starter Edition vsim 6.6c Simulator 2010.08 Aug 24 2010.
I don't get the error if I 's' after using do on the generated setup_sim.do. Assuming we get this error cleared, do you think I can still achieve what I'm trying to do, i.e. read values from text file, simulate component, and save output to another text? In your sopc_system_tb.sv file, I can see that I will have to modify the two tasks avalon_write_single and avalon_read_single to be able to do what I want, but I don't know how to do that yet and it does seem a bit complicated for a relatively simple thing to do if I was testing a code in C for example. I was just wondering whether this is the best way for me to test a hardware module. Or perhaps everything is complicated with FPGAs... damn I should have stuck with C coding :) - Altera_Forum
Honored Contributor
--- Quote Start --- But at step (d) when I type s, I get the following error message:
Any suggestion on how to handle this error? --- Quote End --- The vsim command should have a '-t ps' option in its command line, so it should work. I've seen this as a warning in simulations, but not as an error, so perhaps there is an option that can be changed to suppress this error. Which version of Modelsim are you using, i.e., what do you get for vsim -version? Note that the error is in the Altera-generated BFM code. Cheers, Dave# ** Error: (vsim-3010) - Module 'sopc_system_tb' does not have a `timescale directive in effect, but other modules do.# Region: /sopc_system_tb/dut/the_master_bfm/master_bfm - Altera_Forum
Honored Contributor
Thanks for the example. I will try to learn as much as I can from this. But at step (d) when I type s, I get the following error message:
Any suggestion on how to handle this error? Thank you.# ** Error: (vsim-3010) - Module 'sopc_system_tb' does not have a `timescale directive in effect, but other modules do.# Region: /sopc_system_tb/dut/the_master_bfm/master_bfm - Altera_Forum
Honored Contributor
Here's a verification example. The SOPC System contains an Avalon-MM BFM master, an on-chip RAM, and a PIO component. The readme.txt file explains how to rebuild the system.
The SystemVerilog testbench sopc_system_tb.sv in the folder sopc_system_sim/ shows you how to create an instance of your design and issue the BFM calls. Cheers, Dave - Altera_Forum
Honored Contributor
--- Quote Start --- I create an SOPC System with the Avalon BFM components, and then I let Quartus generate the simulation scripts for me (check the checkbox in SOPC Builder before clicking generate), eg., for a system called sopc_builder, a folder called sopc_builder_sim will be created in your project folder. Within that folder is a setup_sim.do script. Use this as a template for a new Tcl script to build the sopc_system files. Throw everything else away. Within the generated sopc_system.v file, there is a testbench. Ignore it, its useless (well, mostly useless, see the comment below). Create your own SystemVerilog testbench and instantiate a copy of the sopc_system. Use the hierarchical path to the BFMs to call their Verification IP API functions. --- Quote End --- Thanks for the suggestions Dave. I've followed the initial steps but got lost at the stage of creating my own SystemVerilog testbench because I don't how how to write it. I looked at SystemVerilog tuts and I could only write the lines below. Could anybody give a few pointers on how to do the full testbench code?
The module I want to test is a University Program IP module called Video Edge Detection (see attachment) which takes in 8-bit values and outputs 8-bit values as well. But the module takes in a series of data values to represent a frame of data values. I found out that $readmemh is useful in my case. I want to be able to read the data values from a text file using $readmemh, and write the results also back to another text file. Will I be able to do that in SystemVerilog and BFM? As I couldn't get anywhere with the BFM components, I tried creating a testbench for that component as below without using BFM or SystemVerilog. But here again, I don't think it is good as I am not getting any meaningful results when I try to run it in ModelSim. Any suggestion is greatly appreciated.// console messaging level `define VERBOSITY VERBOSITY_INFO //BFM related parameters `define ST_SYMBOL_W 8 `define ST_NUMSYMBOLS 1 `define ST_CHANNEL_W 1 `define ST_ERROR_W 1 `define ST_READY_LATENCY 0 //local parameters `define ST_DATA_W `ST_SYMBOL_W * `ST_NUMSYMBOLS module learn_verification_ip_test(); import verbosity_pkg::*; endmodule// Simulation tool : ModelSim-Altera (Verilog) // `timescale 1 ps/ 1 ps module main_edge_detection_streaming_vlg_tst(); // constants // general purpose registers reg eachvec; // test vector input registers reg clk; reg in_data; reg in_empty; reg in_endofpacket; reg in_startofpacket; reg in_valid; reg out_ready; reg reset; // wires wire in_ready; wire out_data; wire out_empty; wire out_endofpacket; wire out_hw_counter; wire out_startofpacket; wire out_valid; // assign statements (if any) main_edge_detection_streaming i1 ( // port map - connection between master ports and signals/registers .clk(clk), .in_data(in_data), .in_empty(in_empty), .in_endofpacket(in_endofpacket), .in_ready(in_ready), .in_startofpacket(in_startofpacket), .in_valid(in_valid), .out_data(out_data), .out_empty(out_empty), .out_endofpacket(out_endofpacket), .out_hw_counter(out_hw_counter), .out_ready(out_ready), .out_startofpacket(out_startofpacket), .out_valid(out_valid), .reset(reset) ); reg storage_values ; //153600 values for 640x240 image integer fileId, fileOutput; initial begin // code that executes only once clk = 1'b1; // Do the hexadecimal reads from the txt file $readmemh("hexval_test_1d.txt", storage_values); // ouput result will be sent to a text file fileOutput = $fopen("result_sobel.txt", "w"); reset = 1'b0; in_empty = 1'b1; in_startofpacket = 1'b1; in_valid = 1'b1; in_endofpacket = 1'b0; //in_ready = 1'b1; //Stop after 1536000 clock cycles ??# 1536000 in_endofpacket = 1'b1; $display("Running testbench"); end // Control the clock signal initial begin forever# 5 clk = ~clk; end integer i; initial begin for (i=0; i < 153600; i=i+1) begin @(posedge clk); in_data = storage_values; $fwrite(fileOutput,"%d\n",out_data); end @eachvec; end endmodule - Altera_Forum
Honored Contributor
--- Quote Start --- Have you just dowloaded them from somewhere or do you just happen to have these files on your computer? --- Quote End --- I had copies on my computer. --- Quote Start --- To get to the verification tool itself, I was able to run the tutorial files. Now I want to do the same thing on my own component which has Avalon ST interface. I followed all the steps ... --- Quote End --- Ignoring the VIP manual, here's what I do. I create an SOPC System with the Avalon BFM components, and then I let Quartus generate the simulation scripts for me (check the checkbox in SOPC Builder before clicking generate), eg., for a system called sopc_builder, a folder called sopc_builder_sim will be created in your project folder. Within that folder is a setup_sim.do script. Use this as a template for a new Tcl script to build the sopc_system files. Throw everything else away. Within the generated sopc_system.v file, there is a testbench. Ignore it, its useless (well, mostly useless, see the comment below). Create your own SystemVerilog testbench and instantiate a copy of the sopc_system. Use the hierarchical path to the BFMs to call their Verification IP API functions. I've only been working with Avalon-MM BFM masters, but this technique should work with Avalon-ST BFM masters too. The key thing to understand is that the Verification Suite cannot read your mind, so the automatic testbench it provides is pretty simple, but only because it has to be. Just think of it as a tool compilation test, i.e., you can build the design with Modelsim and vsim it, but it does not do anything interesting, eg., like actually test your design :) Cheers, Dave - Altera_Forum
Honored Contributor
Thanks for the files Dave. Have you just dowloaded them from somewhere or do you just happen to have these files on your computer?
To get to the verification tool itself, I was able to run the tutorial files. Now I want to do the same thing on my own component which has Avalon ST interface. I followed all the steps until I reach page 13-5, Step 11: 'In the Compile Source Files dialog box, select st_bfm_top.v and click Compile. Next select st_bfm_sopc.v and click Compile. Finally, select st_bfm_test.v and click Compile.' Do I have to manually write these top level test modules for my component or can they be automatically generated? If the latter, how? Thanks - Altera_Forum
Honored Contributor
if possible, please feed this back to Altera. i have had similar problems