nickg / nvc

VHDL compiler and simulator
https://www.nickg.me.uk/nvc/
GNU General Public License v3.0
589 stars 75 forks source link

VHPI: Iterating declarations inside `for generate` no longer returns any #868

Closed marlonjames closed 3 months ago

marlonjames commented 3 months ago

In v1.11.3, iterating for vhpiDecls, vhpiSigDecls, or vhpiConstDecls from a reference handle of kind vhpiForGenerateK would give an iterator handle that then gives declaration handles.

On master, these iterators no longer return any handles to declarations when iterating with vhpi_scan.

I don't have a minimal example, but the VHDL used by the cocotb regression test suite is here:

https://github.com/cocotb/cocotb/blob/785e0896930039023db3c2e2be47bed5375326c5/tests/designs/array_module/array_module.vhd#L149-L156

If you want, I can try to put together a test for NVC.

nickg commented 3 months ago

I think this was broken by 7dd41079090dcf. There's still a few failures if I run the cocotb testsuite with the current master but I'm using #857 to track that. Once that's fixed I'll add cocotb's full testsuite to the CI to avoid regressions in the future (at the moment it only runs the examples).

I also implemented vhpiParamDecl for vhpi_handle() and vhpiGenerateIndexP for vhpi_get but cocotb doesn't seem to be using those at the moment.

marlonjames commented 3 months ago

Thanks for the fix! cocotb runs its regression suite on the master branch of several open source simulators weekly: https://github.com/cocotb/cocotb/actions/workflows/experimental.yml