zachjs / sv2v

SystemVerilog to Verilog conversion
BSD 3-Clause "New" or "Revised" License
540 stars 52 forks source link

Circular package dependencies when referencing the package in its own implementation #139

Closed flaviens closed 3 years ago

flaviens commented 3 years ago

Hello!

I have noticed a minor issue when treating sv packages: if a package references itself (which is redundant but generally accepted), then sv2v aborts because it detects a circular dependency.

A real example is here: https://github.com/openhwgroup/cva6/blob/6265f1d/include/riscv_pkg.sv on lines 44 and 46.

zachjs commented 3 years ago

Thank you for pointing out this oversight! Support for these self-references has been added in eeeade3e19a7ef99b19e6c451d1dc731867ed3ea. Please let me know if it works for you!

flaviens commented 3 years ago

Indeed, it works now where it failed before. Great job, thank you very much!