日常记录(90)vcs workshop(未完)
vcs -f adder.f -Xman=4
将所有编译的代码整合到一个文件中,生成tokens.v
PLI files are not included in tokens.v. You will need to submit them separately.
-Xman=4命令会生成tokens.v文件,但是这个文件是将完全的展开,里面并没有`define XXX和使用XXX的过程了。
-race
The Dynamic Race Detection Tool
动态竞争检查工具。(还有一个静态的工具)
Makefile
taa:
vcs -R taa.sv -race +rad +simprofile
tbb:
vcs -R tbb.sv +race=all -race
taa文件和tbb文件(错误代码示例)
module taa ();
reg a, clk;
always @(clk) begin
a <= 1;
end
always @(posedge clk) begin
a <= 0;
end
initial begin
clk = 0;
repeat (100) begin
#10 clk = ~clk;
end
$display("111");
$finish;
end
initial begin
$monitor("value a is %0d", a);
end
endmodule
module tbb ();
reg a;
initial begin
a = 0; #10 a = 1;
end
initial begin
#10 if (a) begin
$display("May not print");
end
end
endmodule
tbb的report(taa有亿点长)
Synopsys VCS RACE REPORT
10 "a": write tbb (tbb.sv: 4) && read tbb (tbb.sv: 7)
END RACE REPORT
-simprofile
检查耗时详细信息。
输出profileReport文件。txt部分信息例如:
mailbox和queue的区分
mailbox通常还是在外部定义,在new中初始化,在task中无参数使用。
queue作为function的参数,调用push_back;pop_front等非阻塞语句,还需要用ref使得能传出function外。
parameter与localparam的区别
parameter可用作在顶层模块中例化底层模块时传递参数的接口,localparam的作用域仅仅限于当前module,不能作为参数传递的接口。
Le vent se lève! . . . il faut tenter de vivre!
Le vent se lève! . . . il faut tenter de vivre!