Forum Discussion
Altera_Forum
Honored Contributor
15 years agoI like VHDL better. The only stuff that SystemVerilog has better than VHDL is the interfaces, but interfaces are limited like you have found out. Mentor Graphics (The company behind Modelsim) wrote a white paper complaining that interfaces are actually evil. I would present a link here, but I can not find it right now. Maybe Ben Cohen has it ?
Anyway, inside the module just do:
initial begin
// only works in proper simulators
assert(ArbiterPort.DATA_WIDTH == 32)
else $fatal(2,"DATA_WIDTH must be 32bits for this module to work");
// This should make Quartus complain (a.k.a. poor man's assertion )
if (ArbiterPort.DATA_WIDTH != 32) Call_undef_function();
end