llvm / llvm/circt

[SV] Crash in `P/BPAssignOp` verifiers for `hw.inout` ports

Open
#5,566 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue Verilog/SystemVerilog
Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

In the SV P/BPAssignOp verifiers it is assumed that the target argument is defined by an op (isa used on getDefiningOp). Hence, in the case of a hw.inout input port, the verifier crashes.

i.e.:

hw.module @unsupported(%a: !hw.inout<i42>) {
  %clock = hw.constant 1 : i1
  %c42 = hw.constant 42 : i42
  sv.alwaysff(posedge %clock) {
    sv.passign %a, %c42 : i42
  }
}

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

Open lib/Dialect/SV/SVOps.cpp at lines 1142-1156 and reproduce the crash with the provided MLIR module containing an hw.inout port. Trace the P/BPAssignOp verifiers and make the unsupported input-port case complete verification without crashing; done means the example no longer triggers a verifier crash.

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
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.