cxxrtl_eval icon indicating copy to clipboard operation
cxxrtl_eval copied to clipboard

compile issue in blink_basic_vhdl

Open ozel opened this issue 4 years ago • 5 comments

The blink_basic_vhdl example doesn't work out of the box with the current version of the oss-cad-suite-build toolchain. The name of the counter signal in the generated blink.cpp is changed to i_auto_24_ghdl_2e_cc_3a_805_3a_import__module_24_2 in my case and so the tb code in main.cpp throws an error:

main.cpp:22:35: error: no member named 'p_counter' in 'cxxrtl_design::p_blink
        uint32_t counter    = top.p_counter.get<uint32_t>();

An optimization level flag of -O4 and lower for write_cxxrtl fixes this, not sure whether the VHDL should be improved or this is simply expected behavior. Leaving this here just in case someone else runs into this. The disclaimer in the repo readme is pretty clear.

ozel avatar Dec 17 '21 21:12 ozel

hello, i have the same issue - please tell me where to put the optimization level for write_cxxrtl, more exactly what is the full command

laurentiuduca avatar Nov 21 '24 13:11 laurentiuduca

In the Makefile, where write_cxxrtl is called, you have to add -O4 or a lower number as a parameter just before the final $@. The default optimization level -O6 seems to be too high for this code example: https://yosyshq.readthedocs.io/projects/yosys/en/latest/cmd/write_cxxrtl.html

It would be interesting to know why @tomverbeure did not have this issue. #3 seems the same.

Note, I had to manually delete the generated blink.cpp after updating my old copy of this repo to the most recent commit ~since make clean does not delete it~. Otherwise I'd run into a different bunch of unrelated errors.

ozel avatar Nov 21 '24 20:11 ozel

it works, thank you

On Thu, Nov 21, 2024 at 10:37 PM Oliver Keller @.***> wrote:

In the Makefile, where write_cxxrtl is called https://github.com/tomverbeure/cxxrtl_eval/blob/a406543aa337c41f73ebfb2254e796f89ede652a/blink_basic_vhdl/Makefile#L14, you have to add -O4 or a lower number as a parameter just before the final @.*** The default optimization level -O6 seems to be too high for this code example:

https://yosyshq.readthedocs.io/projects/yosys/en/latest/cmd/write_cxxrtl.html

It would be interesting to know why @tomverbeure https://github.com/tomverbeure did not have this issue. #3 https://github.com/tomverbeure/cxxrtl_eval/issues/3 seems the same.

Note, I had to manually delete the generated blink.cpp after updating my old copy of this repo to the most recent commit since make clean does not delete it. Otherwise I'd run into a different bunch of unrelated errors.

— Reply to this email directly, view it on GitHub https://github.com/tomverbeure/cxxrtl_eval/issues/2#issuecomment-2492270684, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBRLNY3V3ASMSVBO47LVL32BZACLAVCNFSM6AAAAABSHAE5WGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJSGI3TANRYGQ . You are receiving this because you commented.Message ID: @.***>

laurentiuduca avatar Nov 22 '24 12:11 laurentiuduca

It would be interesting to know why @tomverbeure did not have this issue. #3 seems the same.

CXXRTL has seen some updates since I played with it but it's not used a lot and there isn't a lot of development activity around it.

If -O6 doesn't work but -O4 does then chances are that some bug was introduced in the core engine.

Tom

tomverbeure avatar Nov 22 '24 15:11 tomverbeure

i have also noticed that debug messages (for example writeline) from vhdl sources are not printed to the console during simulation with cxxrtl

is there any way to see the vhdl messages printed considering verilog-vhdl mixed simulation?

On Fri, Nov 22, 2024 at 5:15 PM Tom Verbeure @.***> wrote:

It would be interesting to know why @tomverbeure https://github.com/tomverbeure did not have this issue. #3 https://github.com/tomverbeure/cxxrtl_eval/issues/3 seems the same.

CXXRTL has seen some updates since I played with it but it's not used a lot and there isn't a lot of development activity around it.

If -O6 doesn't work but -O4 does then chances are that some bug was introduced in the core engine.

Tom

— Reply to this email directly, view it on GitHub https://github.com/tomverbeure/cxxrtl_eval/issues/2#issuecomment-2493987667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBRLN7OJ64OCN3ANAEHB2L2B5C7XAVCNFSM6AAAAABSHAE5WGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTHE4DONRWG4 . You are receiving this because you commented.Message ID: @.***>

laurentiuduca avatar Nov 23 '24 12:11 laurentiuduca