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

[ChiselSim] ChiselEnum does not provide peek/poke methods and user-friendly API #4208

Open
carlosedp opened this issue Jun 23, 2024 · 4 comments

Comments

@carlosedp
Copy link
Contributor

While rewriting some tests from chiseltest to ChiselSim, I've noticed ChiselEnum is not handled by the Peek/Poke API.

In a test with c.io.inst.peek() should be(inst) where inst is a ChiselEnum.Type, I get: value peek is not a member of chiselv.Instruction.Type.

The closest thing I could get to work is

c.io.inst.peekValue().asBigInt should be(inst.litValue)

Which is very convoluted and not user-friendly.

@kammoh
Copy link
Contributor

kammoh commented Jun 24, 2024

Would this be the API you're looking for?

@carlosedp
Copy link
Contributor Author

Having peek() on ChiselEnum would be nice... but it's not in merged into Chisel, right?

@jackkoenig
Copy link
Contributor

Having peek() on ChiselEnum would be nice... but it's not in merged into Chisel, right?

Not yet, but @kammoh has opened a draft PR adding it (among many other improvements): #4209

I am reviewing, but got sick over the weekend so am not quite at 100% 🙃

@carlosedp
Copy link
Contributor Author

Oh, nice! just saw it mentioned! Commented here before I saw it.

Take care my friend! Hope you get better soon :)

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

No branches or pull requests

3 participants