chipsalliance / chipsalliance/chisel

java.util.NoSuchElementException: None.get encountered in `HasId`

Open
#1,466 8 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

**Type of issue**: bug report

**Impact**: unknown

**Development Phase**: request

**Other information**

Encountering this error during chisel->firrtl elaboration, would hope to get a more useful error message. I am sure I am doing something wrong but the error message isn't helping me diagnose. Will continue to dig into the problem and update the ticket if I can point what the user error was that led to this case:

```
[error] (run-main-0) java.util.NoSuchElementException: None.get
[error] java.util.NoSuchElementException: None.get
[error] at scala.None$.get(Option.scala:529)
[error] at scala.None$.get(Option.scala:527)
[error] at chisel3.internal.HasId.getRef(Builder.scala:119)
[error] ocketchiat chisel3.internal.HasId.getRef$(Builder.scala:119)
[error] at chisel3.Data.getRef(Data.scala:276)
[error] at chisel3.internal.firrtl.Converter$.convert(Converter.scala:46)
[error] at chisel3.internal.firrtl.Converter$.convert(Converter.scala:50)
[error] at chisel3.internal.firrtl.Converter$.convertSimpleCommand(Converter.scala:115)
[error] at chisel3.internal.firrtl.Converter$.rec$1(Converter.scala:163)
[error] at chisel3.internal.firrtl.Converter$.convert(Converter.scala:201)
[error] at chisel3.internal.firrtl.Converter$.convert(Converter.scala:266)
[error] at chisel3.internal.firrtl.Converter$.$anonfun$convert$5(Converter.scala:273)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
[error] at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
[error] Nonzero exit code: 1
[error] (Compile / runMain) Nonzero exit code: 1
[error] Total time: 25 s, completed Jun 7, 2020 1:48:54 PM
```

**If the current behavior is a bug, please provide the steps to reproduce the problem:**

clone the `firrtl-error` branch of rocket-chip: https://github.com/chipsalliance/rocket-chip/tree/firrtl-error

```

cd vsim
make verilog
```

**What is the current behavior?**

I get a None.get exception

**What is the expected behavior?**

Something detects that the None.get will fail and gives a more useful error message to help identify the user error.

**Please tell us about your environment:**

Chisel3 commit:

```
21ea734 - (7 weeks ago) Merge branch 'master' into 3.3.x - Jim Lawson (HEAD)
```
**What is the use case for changing the behavior?**

Better user experience

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.