-
Notifications
You must be signed in to change notification settings - Fork 270
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
[GHDL] run.py --elaborate should not execute the design #466
Comments
I am not that knowledgeable about GHDL internals but it sounds like your fix of using the -e flag might work. Does the -e flag accept setting generics via -G flag? |
That's a very pertinent and somehow tricky question. Generics are a runtime option, not supported for elaboration yet. Please, see:
/cc @tgingold |
The goal of --elaborate is to run elaboration of the design hiearchy which requires top level generics to be defined. Maybe --elab-run --no-run did not achive this either. |
I think that GHDL is able to elaborate a design without knowing the actual values of the top level generics. It needs them to be defined (to have a name and a known type), but AFAIK it does not actually resolve them; all options are considered/compiled. However, this might not be valid for synthesis, so that's why @tgingold commented that it will be an elaboration option only, in the future. |
Coming from #465.
I'm not sure about this. This might be true for the mcode backend, since elaboration and run are merged in a single stage. This is because
mcode
does not save a binary to disk; it is created and executed in memory. However, it should not be true for GCC and LLVM backends, where elaboration generates a binary file and run does actually execute it. Precisely, with GCC and LLVM backendsghdl -r
is equivalent to calling the binary directly.I would expect
--elaborate
to be equivalent to GHDL's own-e
, but this is not the case. VUnit assumes that elaboration is part of execution, so--elab-run
is used instead of-e
: https://github.com/VUnit/vunit/blob/master/vunit/ghdl_interface.py#L189. As a result:--elaborate
==--elab-run --no-run
.Overall, yes, I can work around this by adding some logic to the main function. But I think it is sensible to improve VUnit, so that it is possible to use it as a build tool for GHDL design that outputs a binary.
The fix I suggest is to modify https://github.com/VUnit/vunit/blob/master/vunit/ghdl_interface.py#L227 so that
--elab-run
is replaced with-e
, instead of adding--no-run
. This will probably require to modify_get_sim_command
too, in order to ignore sim argumentsif elaborate_only
.The text was updated successfully, but these errors were encountered: