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

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

unsetenv PATH
unsetenv LD_LIBRARY_PATH
set path = (. /bin /usr/bin /tools/lsc/bin)
setenv NOVAS_HOME /disks/depot3/novas/verdi200907

vcs -R -fsdb +v2k +FSDB_EN=1 test.sv

################################################################################
#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
Posted in Uncategorized | Leave a comment

在modelsim中使用debussy保存仿真波形

仿真时需要在vsim中加-pli参数

#!/bin/bash

if [ $# != 1 ]; then
cat <<EOF
No Argument is passed
Usage: ./make.sh \$tc_name
EOF
exit
fi

LOG_FILE=./log/${1}.log
WAVE_FILE=./wave/${1}.fsdb
TEST_FILE=../tc/test_seq_${1}.v
if [ ! -e $TEST_FILE ]; then
echo “file $TEST_FILE does not exist”
exit
fi

if [ -e work ]; then
rm -rf work
fi
vlib work
vmap work work

export rtl_path=../../../design/rtl
export sim_path=../env
RTL_FILE=$sim_path/file.lst
VER_FILE=$rtl_path/file.lst

DEBUSSY_PATH=../../../../../Novas/Debussy
DEBUSSY_PLL=$DEBUSSY_PATH/share/PLI/modelsim_pli/WINNT/novas.dll

echo “****************************************************************”
echo “***** Pattern 1 *****”
echo “***** $TEST_FILE *****”
echo “****************************************************************”

rm -f test_seq.v
cp $TEST_FILE test_seq.v
vlog -sv -novopt -work work +incdir+./ \
-f $RTL_FILE -f $VER_FILE
vsim -c -novopt -pli $DEBUSSY_PLL -l $LOG_FILE \
+FSDB_FILE=$WAVE_FILE \
work.A1test -do do.tcl

Posted in Uncategorized | Leave a comment

在vcs中使用debussy保存仿真波形

需要设置NOVAS_HOME环境变量,并且在仿真时加-fsdb参数

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

unsetenv PATH
unsetenv LD_LIBRARY_PATH
set path = (. /bin /usr/bin /tools/lsc/bin)

setenv NOVAS_HOME /disks/depot3/novas/verdi200907

vcs -sverilog -R -fsdb test.sv

#############################################################
#test.sv
#############################################################
module test();
reg a;

initial begin
a = 0;
#1 a = 1;
#1 a = 0;
#1 $finish();
end

initial begin
$fsdbDumpfile(“./wave.fsdb”);
$fsdbDumpvars(0, test);
$fsdbDumpon();
end

endmodule

Posted in Uncategorized | Leave a comment

在IUS中使用debussy保存仿真波形

需要设置LD_LIBRARY_PATH环境变量

#######################################################################
#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
else
irun -sv -access +rwc test.sv
endif

#######################################################################
#test.sv
#######################################################################
module test();
reg a;

initial begin
a = 0;
#1 a = 1;
#1 a = 0;
#1 $finish();
end

initial begin
$fsdbDumpfile(“./wave.fsdb”);
$fsdbDumpvars(0, test);
$fsdbDumpon();
end

endmodule

Posted in Uncategorized | Leave a comment

产生clk jitter的方法

//clk jitter must be smaller than clk width

parameter clk_width = 4000;

parameter clk_jitter_width = 4;

logic clk_base;

int unsigned clk_dly;

initial begin

clk_base = 0;

forever #(clk_width / 2) clk_base = ~clk_base;

end

always @(clk_base) begin

clk_dly = $urandom() % clk_jitter_width;

i2c_intf.scl = #clk_dly clk_base;

end

Posted in Uncategorized | Leave a comment

查询rpm包的依赖关系

# 查询未安装软件包的依赖关系
rpm -qRp vim-common-6.3.046-2.el4.1.x86_64.rpm

# 查询已安装软件包的依赖关系
rpm -qR vim-common-6.3.046-2.el4.1

Posted in Uncategorized | Leave a comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment