You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FIRRTL] Add ReadDesignConfigInt intrinsic for post-Verilog configuration
This patch introduces a new FIRRTL intrinsic `circt.read_design_config_int` that enables post-Verilog configuration by generating a SystemVerilog package (DesignConfigPackage) containing configurable parameters. The intrinsic allows hardware designs to reference configuration values that can be modified after Verilog generation without requiring recompilation.
The implementation includes three main components. First, the ReadDesignConfigIntIntrinsicOp operation takes a parameter name, default value, and optional comment, returning an integer value. Second, the LowerToHW pass converts these intrinsics to sv.localparam operations that reference the generated package using the syntax `DesignConfigPackage::param_name`. Third, the CreateDesignConfigPackage pass collects all configuration parameters from modules under the effective DUT, generates a SystemVerilog package with parameter declarations, and creates OM metadata for tooling integration.
Configuration parameters are only generated for the effective DUT to avoid conflicts when compiling testbenches separately. The generated package uses standard SystemVerilog parameter syntax, allowing values to be overridden through compilation flags or configuration files without regenerating the design.
0 commit comments