Hello! I want to check the interface type and make error if it’s not correct.
interface prm_if #(parameter int P_MODE_PRM = 0) ();
...
endinterface
// I want to write like this, but it's compile errror.
module prm_if_dut (prm_if #( .P_MODE_PRM(1) ) p);
...
endmodule
module top
prm_if #(.P_MODE_PRM(2)) prm_bus(); // P_MODE_PRM is not correct for prm_if_dut
prm_if_dut dut(prm_bus); // I want to make error because the Mode is not corect
// P_MODE_PRM must be 1 for prm_if_dut, but it's 2 so I expect to occur syntax error here.
Do I have some mistake or do you have any solution about this?
Thanks!