UPGRADE YOUR BROWSER
We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!
03-04-2018 10:36 PM
Hi, I'm running into a problem with getting my system verilog testbench to be part of the compile process for simulation. My files get labeled under "Non-Module files". Looking at similar posts, it seems that it happens often due to syntax errors, but I have cleaned up all of the syntax errors and checked using check_syntax -fileset sim_1
I have a tb_top in which I invoke my testbench:
module tb_top; sync_test_interface _intf(); testbench testbench_h; bit clk; CAN_router_top DUT( .clk(clk), .rstn(_intf.rst), .rx_in(_intf.rx_in), .rx_out_valid(_intf.rx_out_valid), .rx_out(_intf.rx_out), .error(_intf.error) ); initial begin testbench_h = new(_intf); testbench_h.execute(); end //10mhz sim clock initial begin clk = 0; end always begin #50ns clk = ~clk; end endmodule
I get an error when trying to run simulation:
ERROR: [VRFC 10-51] testbench is an unknown type [F:/CAN_network_router/CAN_network_router/CAN_network_router.srcs/sources_1/new/tb_top.sv:25]
And my testbench top level looks like:
class testbench; virtual sync_test_interface _test_signals; function new(virtual sync_test_interface _intf); _test_signals = _intf; endfunction : new task execute(); rx_sync_test test_h; test_h = new(_test_signals); #1ns _test_signals.rst = 1; #100ns _test_signals.rst = 0; test_h.execute(); endtask : execute endclass : testbench
Can anybody advise me on why the tool isn't bringing my testbench files into compile for sim? Thanks!
03-05-2018 12:52 AM
Hi @silverace99work,
You have added your class definition in file and added to project. There is no module/package definition present in the file So, Vivado is treat that file as non-module file and won't compile that file.
Write this class definition in the package, import in top file or cut and paste the class definition in top file will solve your problem.
Thanks,
Sunilkumar
03-05-2018 12:52 AM
Hi @silverace99work,
You have added your class definition in file and added to project. There is no module/package definition present in the file So, Vivado is treat that file as non-module file and won't compile that file.
Write this class definition in the package, import in top file or cut and paste the class definition in top file will solve your problem.
Thanks,
Sunilkumar
03-05-2018 12:51 PM