chipsalliance / chipsalliance/chisel

Warning occurs when the decoder fields chiselType is chiselEnum

Open
#4,930 0 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

warning is generated when the decoder fields chiselType is chiselEnum
The warning for example is:
```
[119] [warn] src/main/scala/chisel3/util/experimental/decode/DecoderBundle.scala 88:106: [W001] Casting non-literal UInt to untitl3d.backend.ImmTpe. You can use untitl3d.backend.ImmTpe.safe to cast without this warning.
```
the code in `src/main/scala/chisel3/util/experimental/decode/DecoderBundle.scala 88:106` is:
``` scala
def decode(input: UInt): DecodeBundle = chisel3.util.experimental.decode.decoder(input, table).asTypeOf(bundle)
```
the warning occurs in the `asTypeOf(bundle)`, because there has chiselEnum in bundle
(but it just a small problem i think

Contributor guide

Open the contributing guide

Research direction

Reproduce the warning from src/main/scala/chisel3/util/experimental/decode/DecoderBundle.scala, focusing on the decode method and its asTypeOf(bundle) call when the bundle contains a chiselEnum. Trace why this cast emits the warning, then verify that decoding such a bundle no longer produces the reported warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
embedded-iot
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.