llvm / llvm/circt

[FIRRTL] InferResets: extmodules should not be allowed to have abstract resets

Open
#7,275 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The type of reset inferred for a module port changes the implementation of any register which uses it. Since extmodules are separately compiled modules from other circuits, it does not make sense that the reset could be inferred. We already have a verifier that public modules do not have uninferred reset types, so there should be no reason to allow this.

```firrtl
FIRRTL version 4.0.0
circuit Foo:
public module Foo:
input sync : UInt<1>

inst bar of Bar
connect bar.r, sync

extmodule Bar:
input r : Reset
```
compiles fine and `Bar.r` is inferred to be a synchronous reset.

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 FIRRTL InferResets verifier and the existing public-module uninferred-reset check. Reproduce the FIRRTL 4.0.0 example, then make completion mean an extmodule with an abstract reset is rejected and cover that behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.