PeekPokeTester doesn't work with StrongEnum
See original GitHub issueType of issue: bug report
Impact: API addition (no impact on existing code)
Development Phase: request
Chisel version: 3.2-SNAPSHOT
Error messages:
poke
:
[error] StateMachineTest.scala:42:00: overloaded method value poke with alternatives:
[error] (signal: chisel3.core.Aggregate,value: IndexedSeq[BigInt])Unit <and>
[error] (signal: chisel3.Bundle,map: Map[String,BigInt])Unit <and>
[error] (signal: chisel3.Bits,value: Long)Unit <and>
[error] (signal: chisel3.Bits,value: Int)Unit <and>
[error] (signal: chisel3.Bits,value: BigInt)Unit <and>
[error] (path: String,value: Long)Unit <and>
[error] (path: String,value: Int)Unit <and>
[error] (path: String,value: BigInt)Unit
[error] cannot be applied to (MyStrongEnum.Type, MyStrongEnum.Type)
[error] poke(dut.io.state, MyStrongEnum.Idle)
expect
:
[error] StateMachineTest.scala:42:00: overloaded method value expect with alternatives:
[error] (signal: chisel3.Bundle,expected: Map[String,BigInt])Boolean <and>
[error] (signal: chisel3.core.Aggregate,expected: IndexedSeq[BigInt])Boolean <and>
[error] (signal: chisel3.Bits,expected: BigInt,msg: => String)Boolean <and>
[error] (good: Boolean,msg: => String)Boolean
[error] cannot be applied to (MyStrongEnum.Type, MyStrongEnum.Type)
[error] expect(dut.io.state, MyStrongEnum.Idle)
Internally, the StrongEnum Value
items are assigned UInt
s, but there’s no way of accessing these from the outside world.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
PeekPokeTester doesn't work with StrongEnum #932 - GitHub
Internally, the StrongEnum Value items are assigned UInt s, but there's no way of accessing these from the outside world. The text was...
Read more >freechipsproject/chisel3 - Gitter
We're currently trying to migrate to chisel3, but we have some issues regarding pins ... on how to access the random number generator...
Read more >Can't printf with PeekPokeTester in Chisel3 - Stack Overflow
Ok, finally I found the problem. It's an import problem. In head of source file there is a : import chisel3._. It sounds...
Read more >The chisel-testers2 from ucb-bar - GithubHelp
chiseltest now provides a compatibility layer that makes it possible to re-use old PeekPokeTester based tests with little to no changes to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nhynes If you need enum testing support right away, then you can pull this branch: https://github.com/hngenc/chisel-testers/tree/add_enum_support. I haven’t tested it extensively, but it seems to work for examples like
poke(dut.io.state, MyStrongEnum.Idle)
. If the reviewers are fine with my changes, then I should be able to upstream this soon.A conversion from
EnumType
toUInt
would be great, but I can’t figure out how to do it outside of aModule
. Maybe somebody who’s more familiar with the Chisel codebase will know, if its even possible.@edwardcwang I considered that as well. As I understand it, we’d have to mix in the trait in
chisel3
, but it wouldn’t have any meaning except inchisel-testers
which is a different project. That feels like a coding sin to me, but it would be a simple solution.