Comments (9)
Anyone could reproduce it at least?
from chisel-testers.
I have reproduced it. Not sure what's going on. For some reason the internal iteration through the elements is missing a field when the bundle is defined with PeekPokeTester
from chisel-testers.
The root of the problem is that when the bundle is declared in a subclass of PeekPokeTester instead of a Module there is a problem in the lazy assembly of the bundle's elements field.
- It iterates over the public elements of the field.
- It invokes each element and sees if the return value of the invoke has been seen before
- It uses a set seen of the return values to do this.
- When created in a PeekPokeTester the hashCode of these returned elements are zero
- This is because the trait HasId overrides hashCode and numbers on based on state saved in the Builder DynamicVariable.
- This is not properly set up when called from PeekPokeTester
- So it confuses additional fields as ones already seen.
- This does not happen when Bundles are instantiated within a Module
RECOMMENDATION:
I think this is a Bug, but fixing it requires some delicacy. The issue of Chisel components being instantiated outside of a Builder context has come up before. My inclination would be to defer this to the next release. It may be that we can tackle this along with Bundle literals #417 and #77
from chisel-testers.
This is a really tough one. This has come up before and is why in my opinion, there should not be a default dynamic context in chisel3, it should just fail if you try to construct things outside of a Chisel run.
from chisel-testers.
The primary reason why bundles need to be instantiated inside the context of Chisel is that the order that the ids are assigned gives order to the fields of the Bundle. It looks like we might be able to do this better with scala reflection (https://stackoverflow.com/a/22478436/2483329). We will have to be super careful in fixing this though because Chisel uses these ids for lots of stuff so "fixing" this could have some very gnarly unintended consequences. Definitely going to require some thought.
from chisel-testers.
I agree with both comments, except that I think it's a reasonable presumption that within a PeekPokeTester one is, in fact, in a chisel context. Perhaps PeekPokeTester can take on some trait that gets it there.
from chisel-testers.
Might be fixed by bundle literals
from chisel-testers.
I think is best answered in the near term with chisel-testers2.
from chisel-testers.
I just retested this using chisel-testers and it seems to work properly now.
In addition, bundle literals now work and also seem to have the correct behavior
from chisel-testers.
Related Issues (20)
- PeekPokeTester Type inference HOT 1
- Support CXXFLAGS, LDFLAGS environment variables
- Supporting ZIO fibers HOT 8
- [BUG] verilator: 0-width signals in Decoupled Bundle lead to incorrect peek HOT 4
- firrtl backend with ChiselFlatSpec assert fails weirdly HOT 1
- verilator poke incorrect signal for 0-width RRArbiter HOT 7
- have plan to port UVM into chisel test
- should work with verilator *** FAILED ***
- Can't poke MixedVec HOT 6
- poke io as different format using bundle in PeekPokeTester HOT 1
- Peek/Poke/Step/Expect messages not displayed HOT 7
- firrtl vs. verilator behave different HOT 6
- Make Treadle the Default Backend HOT 2
- Clock is initialized at 1 instead of 0 HOT 1
- g++ compile error while adding --trace-fst to verilator options
- [Question] How to use of tester2 (installation) HOT 1
- Inconsistence between VCD and log
- Removed `io` in Module cause compilation error HOT 2
- java.lang.VerifyError
- Converting Uint32 signal output to BigInt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chisel-testers.