Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCS and Verilator support #358

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

LucaRufer
Copy link

Minimal changes required to compile sources and simulation targets for VCS (version W-2024.09-1) and Verilator (v5.028-44-g1d79f5c59):

  • Verilator requires the std:: prefix when using built-in classes like std::semaphore and std::mailbox.
  • Verilator cannot compute static variables at compile time when conditional operator is used.
  • Verilator cannot determine the default type for Associative Arrays if a parameter is used.
  • VCS requires parameter types to match when calling a function with a class object. If any of the axi_??_beat classes are instantiated directly and not from the typedefs in axi_driver, they cannot be passed to a function of a axi_driver object, as parameter and parameter int are not the same.

@LucaRufer LucaRufer marked this pull request as ready for review November 18, 2024 08:23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which tool is upset with using the values from the package?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verilator cannot compile with the following error:

%Error: Internal Error: src/axi_sim_mem.sv:119:34: ../V3Width.cpp:7074: Node has no type:
  119 |   axi_pkg::resp_t rerr[addr_t] = '{default: axi_pkg::RESP_OKAY};
      |                                  ^~
                        ... See the manual at https://verilator.org/verilator_doc.html for more assistance.

I tried different ways of re-writing using casting and other approaches, but it just does not work with Verilator.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, can you then keep the link to the package as a comment and write a note why this was changed? Please open an issue for that on the verilator page to have this eventually fixed in the simulator.

Copy link
Collaborator

@thommythomaso thommythomaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes. Can you change the parameters to int unsigned directly?
Also, why don't we reference the package anymore for the AXI response in the simulation memory?

@thommythomaso thommythomaso self-assigned this Dec 2, 2024
@LucaRufer
Copy link
Author

Thanks for the fixes. Can you change the parameters to int unsigned directly? Also, why don't we reference the package anymore for the AXI response in the simulation memory?

I updated the pull request as requested.
Verilator has problems with typed defaults for arrays. Even casting does not work. The only way I found to make it compilable with Verilator is to expand it to zero.

@thommythomaso thommythomaso merged commit afd6ee7 into pulp-platform:master Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants