Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enum support #221

Merged
merged 2 commits into from
Dec 10, 2018
Merged

Add enum support #221

merged 2 commits into from
Dec 10, 2018

Conversation

hngenc
Copy link
Contributor

@hngenc hngenc commented Nov 20, 2018

This PR adds enum support to PeekPokeTesters and AdvTesters by creating a new Pokeable typeclass which we use instead of Bits.

Related issue: chipsalliance/chisel#932

poked, peeked, or expected from

* Use the new Pokeable typeclass to extend PeekPokeTester and AdvTester
to support enums

* Fix AdvTesterSpec. Previously, AdvTesterSpec would pass even on
incorrect results, because the "assert" function in AdvTester will only
check an assertion if an error message is provided
@jackkoenig jackkoenig requested review from chick and ucbjrl December 7, 2018 21:26
Copy link
Contributor

@chick chick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@azidar azidar merged commit 5f0c834 into freechipsproject:master Dec 10, 2018
@ucbjrl
Copy link
Contributor

ucbjrl commented Dec 10, 2018

Unfortunately, this currently breaks DspTester in dsptools:

[error] .../dsptools/src/main/scala/dsptools/tester/DspTester.scala:229:5: overloaded method value expect with alternatives:
[error]   (data: dsptools.numbers.DspComplex[_],expected: breeze.math.Complex)Boolean <and>
[error]   (data: chisel3.Data,expected: Double)Boolean <and>
[error]   (signal: chisel3.experimental.FixedPoint,expected: Double)Boolean <and>
[error]   (signal: chisel3.experimental.FixedPoint,expected: Int)Boolean <and>
[error]   (signal: chisel3.SInt,expected: Int)Boolean <and>
[error]   (signal: chisel3.UInt,expected: Int)Boolean <and>
[error]   (signal: chisel3.Bool,expected: Boolean)Boolean <and>
[error]   (signal: chisel3.Bits,expected: BigInt,msg: => String)Boolean <and>
[error]   (good: Boolean,msg: => String)Boolean <and>
[error]   (signal: chisel3.Bundle,expected: Map[String,BigInt])Boolean <and>
[error]   (signal: chisel3.core.Aggregate,expected: IndexedSeq[BigInt])Boolean <and>
[error]   [T <: chisel3.core.Element](signal: T, expected: BigInt, msg: => String)(implicit evidence$14: chisel3.iotesters.Pokeable[T])Boolean
[error]  cannot be applied to (chisel3.Bits, scala.math.BigInt)
[error]     expect(signal.asInstanceOf[Bits], if (expected) BigInt(1) else BigInt(0))
[error]     ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 33 s, completed Dec 10, 2018 9:29:53 AM

@ucbjrl
Copy link
Contributor

ucbjrl commented Dec 10, 2018

Looks like it might be an easily fixable bug in dsptools.

@ucbjrl ucbjrl added this to the 1.3.0 milestone Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants