Closed YikeZhou closed 7 months ago
Per the spec referenced, "the two modport list names shall be identical". In this case, the module header uses the modport list name oa_ib
, while the module instance b
implicitly uses the modport list name ia_ob
, as instances of module mid
are restricted to that view of the interface. Admittedly, I think the spec is ambiguous here. However, of the 4 commercial simulators on edaplayground.com, 2 generate an error, and 1 generates a warning, so sv2v's behavior is in the majority.
This test case can be fixed by changing the module header to:
module mid (SimpleInterface mid_int, output logic [15:0] mid_o);
I see your +1 above, so I assume you agree with sv2v's behavior here. Please feel free to reopen if necessary.
I'm uncertain if I'm using "modport" incorrectly or if sv2v has extra limitations on its usage.
I assume it describes a circuit like this:![image](https://github.com/zachjs/sv2v/assets/43945722/f43c7db3-135a-48dc-8e0d-376dc04856a6)
I simulate it with ModelSim. It compiles and works like this:![image](https://github.com/zachjs/sv2v/assets/43945722/71ad133e-52b8-4798-8b8b-73161fabada0)
However, sv2v would reject this.
I looked into 25.5 Modports in IEEE 1800-2017 and found that:
Does it mean this example is legal SystemVerilog since there is no conflict between
bottom b(mid_int)
andmodule bottom (SimpleInterface.oa_ib bottom_int);
? Could there be additional restrictions when using "modport" that I mistakenly ignored?