chipsalliance / chipsalliance/chisel

MixedVec Doesn't Work with SuggestName

Open
#3,031 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
4.8k
Forks
658
Avg merge
18h 59m
Merged PRs (30d)
14

Description

As reported by @oharboe, a `MixedVec` doesn't seem to work when using the `.suggestName` to change the name of the numeric identifiers created by the `MixedVec`.

Consider:

```scala
import chisel3._
import chisel3.util.MixedVec
import circt.stage.ChiselStage

class Foo extends Module {
val a = IO(Input(MixedVec(Bool())))

a(0).suggestName("a")
}

println(ChiselStage.emitCHIRRTL(new Foo))
```

This produces the following CHIRRTL:

```
circuit Foo :
module Foo :
input clock : Clock
input reset : UInt<1>
input a : { 0 : UInt<1>} @[src/main/scala/main.scala 8:13]

skip
```

I'd expect to see:

```
input a : { a : UInt<1>}
```

Contributor guide

Open the contributing guide

Research direction

Start with the MixedVec and suggestName behavior exercised by the ChiselStage.emitCHIRRTL reproducer in the issue. Run the example and trace CHIRRTL emission for the MixedVec field name; done means the generated input uses `a` instead of the numeric identifier `0`.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.