请教一个奇怪的VerilogA的问题
录入:edatop.com 阅读:
想写一个VerilogA的文件,主要作用是每隔0.05us就把一个节点的电压打印出来。文件如下:
module period_probe_vol(IN, GND);
input IN, GND;
electrical IN, GND;
real vol, t;
parameter real period = 0.05e-6;
analog begin
@(timer(0, period)) begin
t = $realtime;
vol = V(IN, GND);
$strobe("\t%r\t net voltage =\t%r", t, vol);
end
end
endmodule
仿真时打印的值却如下:
.
.
.
16.95u net voltage = 16.95u
17u net voltage = 17u
17.05u net voltage = 17.05u
17.1u net voltage = 17.1u
17.15u net voltage = 17.15u
17.2u net voltage = 17.2u
17.25u net voltage = 17.25u
.
.
.
搞不懂为什么该打印电压的地方总是和前面的时间一样。
请比较熟悉VerilogA的高手帮忙看看。
谢谢!
module period_probe_vol(IN, GND);
input IN, GND;
electrical IN, GND;
real vol, t;
parameter real period = 0.05e-6;
analog begin
@(timer(0, period)) begin
t = $realtime;
vol = V(IN, GND);
$strobe("\t%r\t net voltage =\t%r", t, vol);
end
end
endmodule
仿真时打印的值却如下:
.
.
.
16.95u net voltage = 16.95u
17u net voltage = 17u
17.05u net voltage = 17.05u
17.1u net voltage = 17.1u
17.15u net voltage = 17.15u
17.2u net voltage = 17.2u
17.25u net voltage = 17.25u
.
.
.
搞不懂为什么该打印电压的地方总是和前面的时间一样。
请比较熟悉VerilogA的高手帮忙看看。
谢谢!
奇怪,我把打印语句分开写就没问题了。这strobe打印不能支持2个参数么?
修改后代码:
analog begin
@(timer(0, period)) begin
t = $realtime;
vol = V(IN, GND);
$write("\t%r\t", t);
$strobe("net voltage =\t%r", vol);
end
申明:网友回复良莠不齐,仅供参考。如需专业解答,请学习本站推出的微波射频专业培训课程。

