circt icon indicating copy to clipboard operation
circt copied to clipboard

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

Open seldridge opened this issue 1 year ago • 1 comments

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.

seldridge avatar Feb 18 '24 00:02 seldridge

False alarm on this one---some and Some do not match, therefore this is malformed IR. This should produce a better error message when this does happen, though. Currently this is tripping an assertion in the builder which, in a release build, looks like it would blind dereference an optional type. 😬

seldridge avatar Feb 18 '24 03:02 seldridge