Comments (6)
Couldn't you simply add c.clock.step()
to the end of your test for this?
from chiseltest.
Obviously that's a solution for tests that work, but for tests that fail, I can't find a way to inject a clock cycle when expect
fails and raises an exception.
from chiseltest.
Ah, I see
from chiseltest.
I think this would be a good feature. However, there are some problems that we would have to solve.
First, we need to distinguish between:
- a failure because of an
expect
and - a failure because an
assert
orstop
statement in the circuit fired.
In case 2, the problem is that the VCS and IVerilog backends will just immediately kill the simulator execution and there isn't really a good way for us to continue the simulation, unless there is an appropriate option for each simulator. On Treadle and Verilator it should be doable to continue executing even after an assertion fires. This is something we worked to enable last summer.
Case 1 is easier because we control the failure in software. I think adding a step
around here might work:
Context().env.checkpoint()
will potentially want to throw an exception and in that case we would have to step
once before actually throwing it.
However, there could be some unintended side effects of doing an extra clock step at the end of the test. I am mostly concerned about what should happen if a assert
or printf
statement in the circuit is active. That way, the user would get shown a printout from a cycle after the test failed which might be confusing. Do you all have any thoughts on what the behavior should be?
from chiseltest.
I definitely think the circuit should be "idle", such that assert/printf statements do not get toggled. Otherwise, it might muddy the printout in the console
I don't know much about the structure of VCD files, but would it be possible to modify the generated file post-fact, simply extending all waves by one clock cycle?
from chiseltest.
I definitely think the circuit should be "idle", such that assert/printf statements do not get toggled. Otherwise, it might muddy the printout in the console
That will be hard to do in a simulator independent way. However, we might be able to only add this feature for Verilator and Treadle. Feel free to get started on a PR. I won't have time to actually work on any improvements, but I should be free enough to review a PR.
I don't know much about the structure of VCD files, but would it be possible to modify the generated file post-fact, simply extending all waves by one clock cycle?
That could work for VCDs, but we also support LXT, FST and FSDB (for some simulators).
from chiseltest.
Related Issues (20)
- Does VcsBackendAnnotation support vcs Q-2020.03-SP2? HOT 1
- Can't find field of aggregate Memory in nested Module HOT 5
- FlatIO is not supported
- Feature request: Extend DecoupledDriver with Enqueue/DequeueEmpty HOT 6
- verilator: broken support for Verilog $time system task HOT 5
- FACING SAME ERROR IN DOING SIMPLE ADDITION IN CHISEL HOT 4
- Loop Query
- Chiseltest fails with None.get on zero-width literal HOT 2
- A typo in Verilator.scala HOT 1
- memory leak? HOT 5
- Chisel formal needs simple examples (README)
- No Reset Signal for DUT in Chisel Formal HOT 3
- Working Verilator Version HOT 4
- Synchronization Issues in IPCSimulatorContext
- TestApplicationException can be exposed to user but is private
- Fsdb annotation method needs to be update
- Regression with FixedPoint poke in 0.5.1+ HOT 2
- Chiseltest supports stdin at runtime? HOT 1
- any way seperate compile and simulation HOT 2
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.