chiseltest icon indicating copy to clipboard operation
chiseltest copied to clipboard

Chiseltest fails with None.get on zero-width literal

Open hutch31 opened this issue 2 years ago • 1 comments

When running a test with a Bundle with zero-width elements, a fatal None.get error message is reported.

This Scastie reproduces the issue: https://scastie.scala-lang.org/hutch31/lV9nKmAWRluQ4YTPI2EZ0A/10

@jackkoenig reported that: I think the issue is that chisel3 or chiseltest is unable to handle unspecified fields in the Bundle literal (DontCare's don't have a litValue which is why you're seeing a None.get). Now because pool is zero-width, you can't specify it because then it doesn't exist and you'll get a different error (an assertion failure that should give a nicer error message)

hutch31 avatar Aug 17 '22 20:08 hutch31

I’ve been facing the sane issue and came up with the following workaround: https://github.com/ucb-bar/chiseltest/pull/552 Implicit/automatic handling of zero-width data would definitely look cleaner, but I don’t know of a clean and reliable way that works across all backends.

kammoh avatar Aug 17 '22 23:08 kammoh

This should be fixed now with: https://github.com/ucb-bar/chiseltest/commit/7d98ab58459832607361d045a90bdbccfe265297

ekiwi avatar Jan 11 '23 19:01 ekiwi