在IUS使用tcl进行交互

####################################################################
#make.csh
####################################################################

#!/bin/tcsh -f
#
#

set NOVAS_INST_DIR = /disks/depot3/novas/verdi200907
if($1 =~ “64”) then
set PLATFORM = LINUX64
else
set PLATFORM = LINUX
endif
setenv LD_LIBRARY_PATH ${NOVAS_INST_DIR}/share/PLI/nc_latest/${PLATFORM}/nc_shared:${LD_LIBRARY_PATH}

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

####################################################################
#input.tcl
####################################################################
#call fsdbDumpfile wave.fsdb
#call fsdbDumpvars 0 test
#call fsdbDumpon
run
exit

####################################################################
#test.sv
####################################################################
module add(a, b, c);
input a, b;
output c;

assign c = a + b;
endmodule

module test();
reg clk;

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

initial begin
#1000 $finish();
end

reg a, b;
wire c;

initial begin
a = 0;
b = 0;
#1 a = 0;
b = 1;
#1 a = 1;
b = 0;
#1 a = 1;
b = 1;
#1 a = 0;
b = 0;
end

add u_add (
.a(a),
.b(b),
.c(c)
);

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