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

Canonicalize param env before codegen #187

Open
3 tasks
fabianschuiki opened this issue Jun 13, 2020 · 0 comments
Open
3 tasks

Canonicalize param env before codegen #187

fabianschuiki opened this issue Jun 13, 2020 · 0 comments
Labels
A-codegen Area: Code generation. C-enhancement Category: Adding or improving on features. L-vlog Language: Verilog and SystemVerilog.

Comments

@fabianschuiki
Copy link
Owner

Codegen currently uses the ParamEnv to determine if two modules have the same parametrization. However, since most parameters are indirectly bound, i.e., they depend on outer parameters, these param envs look distinct in many cases, even though they will resolve to the exact same parametrization. To fix this, codegen should "canonicalize" the param envs, which would mean going through the param env data, converting each binding to a Direct one with the concrete value/type, and interning this as new param env. Then use this canonical param env for code generation.

Todo

  • Create a canonical_param_type and canonical_param_value query, which resolves one param
  • Create a canonical_param_env query which creates a canonicalized param env
  • Use the above in codegen before emitting a module
@fabianschuiki fabianschuiki added L-vlog Language: Verilog and SystemVerilog. C-enhancement Category: Adding or improving on features. A-codegen Area: Code generation. labels Jun 13, 2020
@fabianschuiki fabianschuiki added this to the v0.11 milestone Jun 18, 2020
@fabianschuiki fabianschuiki modified the milestones: v0.11, v0.12 Sep 2, 2020
@fabianschuiki fabianschuiki removed this from the v0.12 milestone Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation. C-enhancement Category: Adding or improving on features. L-vlog Language: Verilog and SystemVerilog.
Projects
None yet
Development

No branches or pull requests

1 participant