llvm / llvm/circt

Share HW Parameter List Parsing and Printing

Open
#3,629 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

Currently, the code for parsing/printing HW parameter lists is duplicated between the [MSFT dialect](https://github.com/llvm/circt/blob/f1ed562e0e2e3b36ecca51e1d38d069e6836962d/lib/Dialect/MSFT/MSFTOps.cpp#L549) and the [HW dialect](https://github.com/llvm/circt/blob/d8a8bf1296dbc5e740ba2a5e8e265038c49b195d/lib/Dialect/HW/HWOps.cpp#L763). Soon, the [Calyx dialect](https://github.com/llvm/circt/pull/3565) will also need to parse/print HW parameter lists, resulting in the code being duplicated again.

The parsing/printing code for these parameters should be shared instead of duplicated. A few solutions have been proposed in #3565, including moving the parsing into the `HWInstanceLike` interface or something like `Support/PrinterParsers.h`.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the duplicated parameter-list parsing and printing in lib/Dialect/MSFT/MSFTOps.cpp and lib/Dialect/HW/HWOps.cpp. Read the proposed solutions in #3565, including moving parsing into HWInstanceLike or Support/PrinterParsers.h, and check how the Calyx dialect would use the shared implementation. Done means the existing duplication is replaced by shared parsing and printing that also supports Calyx.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.