Comments (3)
I have such problem these days, and I got an idea(a not pretty way to solve this), but technologically, it works, I wonder if there is any elegant way to do so?
At first, I tried to bore
signals directly to testFn
, it says
Error: Not in a UserModule. Likely cause: Missed Module() wrap, bare chisel API call, or attempting to construct hardware inside a BlackBox.
looks like I cannot create a NamedComponent
during the test
, it sounds reasonable. Then I choose using a wrapper to work around.
for example, here is my dut
class Dut extends MultiIOModule {
val internalWire = WireDefault(true.B)
}
I need to create another DutWrapper
like this,
class DutWrapper extends MultiIOModule {
val core = Module(new Dut)
val internalWire = IO(Output(core.internalWire))
// and bore them together:
BoringUtils.bore(internalWire, core.internalWire)
}
Then use DutWrapper
as dut
in testFn
test(new DutWrapper) { dut =>
val result = dut.internalWire.peek()
}
This is the only method I came up with to peek a internal signal without altering Dut
.
from chiseltest.
Yeah, so the test function runs on fully elaborated hardware, so you can't make modifications to the hardware during test execution.
You might be able to wrap your DUT in a anonymous top level module in test
that you can bore through, while also passing through the top-level IOs.
In the long(er) term I think the solution is just to add internal peek support, though I think there were some technical hurdles like naming.
from chiseltest.
Currently idea to do this implementation:
- annotate signal required to be peek/forced.
- use firrtl transform to add
/**verilator public**/
attributes, which need chipsalliance/firrtl#1172 - add chiseltester API to access these public signals.
from chiseltest.
Related Issues (20)
- Function loadMemoryFromFile failed in chiseltest HOT 2
- chiseltest recognisez $finish in verilog fails
- Confusing Fork-Join Usage HOT 2
- Confused by fork.withRegion(Monitor) HOT 1
- TODO: implement plusarg intrinsic support for all supported simulators and formal verification
- scala.NotImplementedError: TODO: convert InlineAnnotation(ModuleName(<omitted>)) HOT 12
- `poke` in `ChiselScalatestTester` occurs on falling clock edge in traces HOT 4
- Checking formal properties over multiple tests HOT 2
- Proving formal properties HOT 4
- JRE detects `EXCEPTION_ACCESS_VIOLATION` when trying to use Verilator as Chiseltest's backend HOT 2
- Report assert message with `FailedBoundedCheckException` HOT 1
- Generate waveform file in real-time HOT 1
- chiseltest gets the signal name wrong when trying to peek, poke, or expect an OpaqueType HOT 3
- Solver Chosen Constants for Formal Verification HOT 3
- scala.NotImplementedError: TODO: convert ThrowOnFirstErrorAnnotation HOT 3
- Bundle literal construction outside test() is not allowed in Chiseltest 5.0.0 (works in 0.5.4) HOT 2
- assertion failed: The Chisel compiler plugin is now required for compiling Chisel code HOT 1
- The waveform doesn't reflect changes in the input port until io.clock.peek HOT 1
- scala.NotImplementedError: TODO: convert DecodeTableAnnotatio HOT 7
- Will there be a chiseltest 6.0.0? HOT 16
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 chiseltest.