I need to have an inout
port with real
dataytype in my module. Also I need to have multiple driver resolution capability in that port. (Saw about nettype
, but didn't see usage of that in module ports in LRM)
Here is a sample code.
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
This is giving me the following error -
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.