question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PeekPokeTester doesn't work with StrongEnum

See original GitHub issue

Type 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 UInts, but there’s no way of accessing these from the outside world.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
hngenccommented, Nov 14, 2018

@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.

0reactions
hngenccommented, Nov 12, 2018

A conversion from EnumType to UInt would be great, but I can’t figure out how to do it outside of a Module. 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 in chisel-testers which is a different project. That feels like a coding sin to me, but it would be a simple solution.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found