llvm / llvm/circt

[FIRRTL] Produce Better Error Message For Incorrect Enum FIRRTL Text

Open
#6,714 1 comment 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

The following is currently failing:

FIRRTL version 4.0.0
circuit Foo:
  module Foo:
    wire x: UInt<8>
    node y = {|some: UInt<8>, None|}(Some, x)

The problem is that this is parsing Some, x) as the "tag" and then trying to look that. This is then an illegal tag and it errors out.

See the comment below. This is illegal IR that trips an assert in a builder.

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 with the failing FIRRTL text and trace the enum parsing or builder path involved in constructing the illegal enum expression. Confirm the input reports a diagnostic rather than tripping an assertion, and add or update coverage for this case if the relevant test location is found.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.