Forum Discussion
Possible Quartus 24.1 bug?
Here is the code:
interface myif
#(
parameter int W = 1
)();
typedef struct packed { logic [W-1:0] x; } MYSTRUCT;
MYSTRUCT s;
modport src ( output s );
modport dst ( input s );
endinterface
module top;
myif #( .w( 5 ) ) test_if();
test test_module
(
.foo( test_if )
);
endmodule
module test
(
myif.dst foo
);
typedef foo.MYSTRUCT MYSTRUCT_COPY;
$info( "%0d %0d", $bits( foo.MYSTRUCT ), $bits( MYSTRUCT_COPY ) );
MYSTRUCT_COPY q;
assign q = foo.s;
endmodule
Surprisingly, the info message will print "5 1" instead of "5 5". And for the assign Quartus will complain that it had to crop the 5 bit wide foo.s to match the 1 bit wide q.
When processing the typedef, Quartus uses the interface definition's default W value instead of the actual value of the actual interface port. I believe that, according to the standard, that is not the expected behaviour.
1 Reply
- ZiYingE_Altera
Occasional Contributor
Hi Kocsonya,
Could you please share the full Quartus warning/error message that is being reported?
In the meantime, could you also try compiling the design with the latest Quartus version 26.1 and let us know whether the behavior is still reproducible?
If the issue persists in Quartus 26.1, would it be possible to share a minimal reproducible test case?
Thank you.
Regards,
ZiYingE_Altera