Renaming modules programatically #636
-
I have a module hierarchy and I want to generate verilog with a postfix to the module names. is there a way to do this at compile time ? Example:
Say I compile this 3 times, I want the generated verilog to be Note: these modules (and their sub-modules) use ifdefs. The values for these compile-time macros (ifdefs) can change every time I compile. that is, Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The approach I've seen is to avoid using macros and pass the parameters as type or value arguments:
If you must use macros, then I'm not aware of any options besides post-processing the Verilog. You can run your own scripts on the generated files, or BSC has a flag If you have a suggestion of a new feature that would help, you can suggest it. In theory, BSC could support a flag for specifying a prefix to add to generated module names, but I'd have to think about whether that's what we want to support or if there's a cleaner alternative. We'd also need to consider how it would interact with Bluetcl and BDW, where users might want to correlate generated module names in the design hierarchy in |
Beta Was this translation helpful? Give feedback.
I don't understand your concern about consumed macros. It sounded like you had a module like the following very simple example:
And you can compile it by providing a specific value for the macro:
This would generate a Verilog file
mk_abc.v
, containing a module that had1
as the initial value for the register.But you want to generate three different versions of this module:
but each time it will overwrite the existing
mk_a…