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

Fix broken verilator permissive runtime arguments #563

Closed
colinschmidt opened this issue May 22, 2020 · 13 comments
Closed

Fix broken verilator permissive runtime arguments #563

colinschmidt opened this issue May 22, 2020 · 13 comments

Comments

@colinschmidt
Copy link
Contributor

So we do need permissive and its even slightly different for verilator so its good that its overrideable:

simulator-example-RocketConfig +max-cycles=5000 +verbose -- +permissive +verilator+V +permissive-off output/example.TestHarness.RocketConfig/rv64ui-p-addi
using random seed 1590055841
  Version: Verilator 4.016 2019-06-16
%Error: COMMAND_LINE:0: Exiting due to command line argument (not an error)
Aborting...
Aborted (core dumped)

versus

simulator-example-RocketConfig +max-cycles=5000 +verbose +verilator+V output/example.TestHarness.RocketConfig/rv64ui-p-addi
simulator-example-RocketConfig: invalid plus-arg (Verilog or HTIF) "+verilator+V"

Originally posted by @colinschmidt in #562

@colinschmidt
Copy link
Contributor Author

I'm not gonna run git blame but I believe this is a regression.

@jwright6323
Copy link
Contributor

I'll be that guy and point the finger at @jerryz123 340ed90 :)

@jwright6323
Copy link
Contributor

Why did it core dump if it wasn't an error?

@colinschmidt
Copy link
Contributor Author

Thats just the flag I passed to show it was working. If you give it one of the random init flags it just works silently.

@colinschmidt
Copy link
Contributor Author

Its a version flag

@jwright6323
Copy link
Contributor

Yeah, I get that, just don't get why the version flag causes a core dump. Not really a question directed at you, just seems odd.

@jerryz123
Copy link
Contributor

jerryz123 commented May 22, 2020

I believe I made that change to match existing project-template behavior, as the project-template verilator Makefile (and the Rocketchip verilator Makefile, too), do not set the permissive flags.

I'm not sure what the right thing to do here is, but it seems to stem from the fact that we really have two sets of arguments, 1 set of arguments for HTIF, and another for the simulator. Combining them into one set of args is convenient, but then we have to deal with these kinds of issues.

@colinschmidt
Copy link
Contributor Author

I think we should add this feature since we already have the infrastructure to support it and I did the work of finding what you would need to set them to.

@jwright6323
Copy link
Contributor

@colinschmidt so I'm interpreting this to mean that the simulation/emulator.cc doesn't barf on +permissive when you use a non-terminal +verilator+... option? Just asking because most other "Custom" plusargs need to be explicitly added to verilator's C code somehow (hence chipsalliance/rocket-chip#2453). Is +permissive a verilog thing or an htif thing?

@colinschmidt
Copy link
Contributor Author

Yes I can run verilator simulations to completion with this line:

simulator-example-RocketConfig +max-cycles=5000 +verbose -- +permissive +verilator+rand+reset+0 +permissive-off output/example.TestHarness.RocketConfig/rv64ui-p-addi

@colinschmidt
Copy link
Contributor Author

+permissive is a htif thing.

@jwright6323
Copy link
Contributor

cool... this seems like a really easy fix, no?

@colinschmidt
Copy link
Contributor Author

yeah I think its a few lines of PR, but I won't get to it until the weekend at the earliest

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

No branches or pull requests

4 participants