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

defines and compile order #55

Closed
mikrofyr opened this issue May 25, 2022 · 2 comments
Closed

defines and compile order #55

mikrofyr opened this issue May 25, 2022 · 2 comments

Comments

@mikrofyr
Copy link

Posted this question in the morty project pulp-platform/morty#39 , but probably is more related to this project.
Is it possible to add support for in-order/global defines?

#mydefines.sv:

// This would take presedence until undef, or new value defined by a file that is compiled later
`define DW=32

#mymodule.sv

// Define from previous compiles are available, unless undef. Requires control of compilation order.
module mymodule (
 input [`DW-1:0] data
);
endmodule

morty mydefine.sv mymodule.sv

@DaveMcEwan
Copy link

Yes, this is already fully supported. For example, see svlint: https://github.com/dalance/svlint/blob/master/src/main.rs#L224
In particular, see the use of the mutable defines and the returned value of parse_sv() called new_defines.

@mikrofyr
Copy link
Author

Thanks for clarification

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

2 participants