You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// VCD file will be at: build/chiselsim/<timestamp>/workdir-verilator/trace.vcd
118
123
```
119
124
120
125
### Decoupled Interface Testing
@@ -183,21 +188,19 @@ The auto-reset feature fixed **18 tests** that were previously failing due to un
183
188
184
189
## Limitations and Caveats
185
190
186
-
1.**VCD file generation** - ❌ **NOT SUPPORTED** in Chisel 7. ChiselSim does not provide APIs to enable VCD generation via `WriteVcdAnnotation`. Multiple approaches were tested:
187
-
- System properties (`chisel.svsim.vcdOutput`)
188
-
- Custom `HasTestingDirectory` implementations
189
-
- Settings.copy with trace configuration
190
-
- None of these approaches worked in Chisel 7.5.0
191
+
1.**VCD file generation** - Use `WriteVcdAnnotation` to generate waveforms. The compatibility layer configures Verilator with trace support and calls `enableWaves()` at runtime. VCD files are generated at:
2.**Annotation:**`WriteVcdAnnotation` is accepted but ignored. Multiple implementation approaches were tested (system properties, custom directories, Settings configuration) but none successfully enabled VCD output in ChiselSim 7.5.0.
197
+
2.**Formal verification is limited** - `formal.verify()`, `past()`, and other formal constructs are stubs
193
198
194
-
3.**Formal verification is limited** - `formal.verify()`, `past()`, and other formal constructs are stubs
199
+
3.**Fork/join has minimal support** - Concurrent testing patterns execute sequentially
195
200
196
-
4.**Fork/join has minimal support** - Concurrent testing patterns execute sequentially
201
+
4.**Automatic reset behavior** - By default, modules are reset before each test (mimicking Chisel 6). Disable with `override def autoResetEnabled = false`
197
202
198
-
5.**Automatic reset behavior** - By default, modules are reset before each test (mimicking Chisel 6). Disable with `override def autoResetEnabled = false`
199
-
200
-
6.**Remaining test failures** - Some tests may fail due to:
203
+
5.**Remaining test failures** - Some tests may fail due to:
201
204
- Module elaboration errors (unknown port widths)
202
205
- BlackBox Verilog width mismatches
203
206
- Formal verification stub limitations
@@ -234,6 +237,7 @@ If you're migrating tests from Chisel 6:
234
237
1.**Import statements** - Change `import chiseltest._` to use this compatibility layer (already in place in chisel-book)
235
238
2.**Test structure** - Should be identical; no code changes needed
236
239
3.**Run tests** - Use `sbt test` as before
240
+
4.**VCD generation** - Works the same way with `WriteVcdAnnotation`, but files are in a different location
237
241
238
242
## Implementation Details
239
243
@@ -242,9 +246,18 @@ If you're migrating tests from Chisel 6:
242
246
1. User calls `test(dutGen)(body)` from the `ChiselScalatestTester` trait
243
247
2.**Auto-reset** (if enabled): Asserts reset for `resetCycles` (default 1), then deasserts
244
248
3. This returns a `TestBuilder` that accepts `.withAnnotations()` chaining
245
-
4. The `TestRunner` eventually calls `chisel3.simulator.EphemeralSimulator.simulate(dutGen)(body)`
246
-
5. Inside the test body, implicit conversions make Data types support `poke()`, `peek()`, `expect()`
247
-
6. These methods delegate to ChiselSim's underlying `TestableData`, `TestableClock`, etc.
249
+
4. The `TestRunner` checks for `WriteVcdAnnotation` and configures backend with VCD trace style
250
+
5. Calls `chisel3.simulator.EphemeralSimulator.simulate(dutGen)(body)` with optional VCD support
251
+
6. Inside the test body, implicit conversions make Data types support `poke()`, `peek()`, `expect()`
252
+
7. These methods delegate to ChiselSim's underlying `TestableData`, `TestableClock`, etc.
253
+
254
+
### VCD Generation Technical Details
255
+
256
+
When `WriteVcdAnnotation` is detected, the compatibility layer:
257
+
1. Creates an implicit `BackendSettingsModifications` with VCD `TraceStyle`
258
+
2. Configures Verilator at compile time with trace support (`-DVM_TRACE_VCD=1`)
259
+
3. Calls `chiselSim.enableWaves()` inside the simulation to start recording
260
+
4. VCD file is written to `build/chiselsim/<timestamp>/workdir-verilator/trace.vcd`
248
261
249
262
### Mapping to ChiselSim
250
263
@@ -263,9 +276,9 @@ When using the Chisel 7 + add-src layer:
0 commit comments