【发布时间】:2020-09-16 01:17:25
【问题描述】:
我需要在我的模块中有一个带有real 数据类型的inout 端口。此外,我需要在该端口具有多个驱动程序解析能力。 (看到了nettype,但在 LRM 的模块端口中没有看到它的用法)
这是一个示例代码。
module abc (
input real vref1,
output real vout);
assign vout = vref1 * 3.17;
endmodule
module def (
input logic out_en,
input logic data,
output logic vref1);
bufif1 b1 (vref1, data, out_en);
endmodule
module top (
inout real vref1,
input logic out_en,
input logic data,
output real vout);
logic vref1_dig_l;
assign vref1 = (vref1_dig_l === 1'bz) ? 100.0 : ((vref1_dig_l == 1'b0) ? 0.0 : 20.0);
abc a1 (vref1, vout);
def d1 (out_en, data, vref1_dig_l);
endmodule
module temp ();
real vref1;
logic out_en;
logic data;
real vout;
top t1 (vref1, out_en, data, vout);
initial
$monitor("vref1 - %0f, out_en - %0b, data - %0b, vout - %0f", vref1, out_en, data, vout);
initial begin
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
#1 vref1 = 5.0; out_en = $random()%2; data = $random();
end
endmodule
这给了我以下错误-
inout real vref1,
|
xmvlog: *E,SVNTRL (../b.sv,25|17): A module port that is a net cannot be of type 'real' or 'shortreal' by SystemVerilog language rules.
【问题讨论】:
标签: verilog system-verilog register-transfer-level