在IUS中通过仿真命令参数传递变量

################################################################################
#make.csh
################################################################################
#!/bin/tcsh -f
#
#

set NOVAS_INST_DIR = /disks/depot3/novas/verdi200907

setenv LD_LIBRARY_PATH ${NOVAS_INST_DIR}/share/PLI/nc_latest/LINUX/nc_shared:${LD_LIBRARY_PATH}

if($1 =~ “”) then
irun -sv test.sv
else
irun -sv +FSDB_EN=1 -access +rwc test.sv
endif

################################################################################
#test.sv
################################################################################
module test();
reg clk;
integer en;

initial begin
clk = 0;
forever #1 clk = ~clk;
end

initial begin
if($value$plusargs(“FSDB_EN=%d”, en)) begin
$display(“value was %d”, en);
$fsdbDumpfile(“./wave.fsdb”);
$fsdbDumpvars(0, test);
$fsdbDumpon();
end
else begin
$display(“not need to dump wave”);
end
#1000 $finish();
end
endmodule

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s