llvm / llvm/circt

[FIRRTL] RemoveCHIRRTL Should Lower Unused Memories (or at least repsect DontTouch)

Open
#2,029 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

If you have an unused behavior memory in FIRRTL, the SFC will lower this to a memory that has no ports. This is a candidate for later DCE, but won't be DCE'd if there is a don't touch annotation.

In CIRCT, we are deleting behavioral memories which have no users, i.e., DCE'ing unused memories during RemoveCHIRRTL, and not respecting a dont touch annotation that may exist.

I expect that this has no effect on "sane" designs and is consequently a low priority bug. For more info, I hit this when writing some test cases for Grand Central where I didn't want to hook up my memories. 😅

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 at the CIRCT RemoveCHIRRTL pass and reproduce the behavior with an unused behavioral memory. Check how memory operations with no users are removed and how a dont touch annotation is handled; done means unused memories are lowered or their annotation is respected, with regression coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
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.