Skip to content

Support for Adding Parameter Annotations to Generated Modules (e.g., as Comments) #8525

Open
@farukyld

Description

@farukyld

Context

I'm using PyCDE to generate parameterized modules and test them using a handwritten Verilator testbench. To simplify the testbench logic, I instantiate different versions of the module under test using a single testbench. For that to work, all the modules must have the same top-level name.

To achieve this, I prefixed the module builder's argument with an underscore ("_"). With that, generated module's name doesn't contain parameters and is unified, but it creates another problem…

Problem

By removing the parameters from the module name, I lose visibility into what configuration a given module was generated from. This makes it difficult to track which parameters were used for which module, especially when dealing with multiple variations. As a result, debugging and traceability suffer.

Question/Feature Request

Is there a way to annotate the generated Verilog/SystemVerilog module with a comment that includes the parameter values? Ideally, I’d like to see something like this:

// Parameters: WIDTH=32, DEPTH=64
module my_module (...);

If this is already supported in PyCDE, could you provide an example of how to do it? If not, would it be feasible to add such a feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    PyCDEPython CIRCT Design Entry API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions