Comments (10)
The problem of your code is
.withConfig( Config.spinal )
This line use Spinal's elaboration config which is not compatible with the formal config one, delete it would work.
from spinalhdl.
The line is necessary to get a purely synchronous reset in this context.
Without this line, the following code is generated:
(...)
always @(posedge clk or posedge reset) begin
(...)
Maybe I'm wrong, but that seems like an async reset to me.
This async reset actually triggers another bug, but within SpinalTemplateSbt: SpinalHDL/SpinalTemplateSbt#39
Proposed fix / hack / bypass (?): #1315
from spinalhdl.
This might be a solution.
.withConfig( Config.spinal.includeFormal )
from spinalhdl.
Yes this actually works in SYNC reset mode.
In ASYNC reset mode we actually need to set the SymbiYosys multiclock mode.
Here my attempt to fix both issues: #1320
--> use .includeFormal as default in FormalConfig and therefore do not generate "assert(...) else ... begin" blocks in formal verification mode
--> use "multiclock on" when an using an ASYNC reset in the default clock domain
from spinalhdl.
Yes this actually works in SYNC reset mode.
In ASYNC reset mode we actually need to set the SymbiYosys multiclock mode.
Here my attempt to fix both issues: #1320 --> use .includeFormal as default in FormalConfig and therefore do not generate "assert(...) else ... begin" blocks in formal verification mode --> use "multiclock on" when an using an ASYNC reset in the default clock domain
I think use "multiclock on" for a synchronized design with only ASYNC reset is a little bit redundant. It might be slower.
If you are using asynchronous clocks, then multiclock on might be a good choice. Have you looked at the FormalFifoCCTester example in the lib?
from spinalhdl.
Not yet...ok.
Well, the assumeResetReleaseSync / assumeIOSync2Clock in this complex example make sense...
--> I need to implement this in the SpinalHDL Template, so the template formal workflow works again by default.
Actually the real issue here seens the complete lack of documentation for all of SpinalHDL awesome and kick-ass "hidden" features.
from spinalhdl.
Can you help me getting the Spinal basic template to run with assumeResetReleaseSync, and GlobalClock without multiclock mode?
I'm kinda lost here...
from spinalhdl.
Can you help me getting the Spinal basic template to run with assumeResetReleaseSync, and GlobalClock without multiclock mode?
I'm kinda lost here...
Those assumeResetReleaseSync
and GlobalClock
are initially designed for clock crossing design, if you just want to verify a design with different reset, I think they are not necessary.
So if what you want is to verify your design which have cross clock manner, I can give you some hits.
In formal verification of yosys, the asynchronous verification is driven by a hidden clock, so called GlobalClock.
All clocks for the design is generated from that.
The relationship between each clock and reset or io signals should be explicit declared.
This make things complex, so some functions have been wrapped for that.
//assume the pushClock's period while verification.
gclk.assumeClockTiming(pushClock, pushPeriod)
//this keep the reset signal synchronize with it's corresponding clock. here pushClock domain's reset is synchronized with it's clock.
gclk.assumeResetReleaseSync(pushClock)
//this function make sure push.valid signal is a signal synchronized with the pushClock domain's clock.
gclk.assumeIOSync2Clock(pushClock, dut.io.push.valid)
Also, some utilities is design for timing.
//this keep the reset last for popPeriod.
gclk.keepBoolLeastCycles(reset, popPeriod)
//this make sure pushClock domain's reset and popClock domain's reset active at the same time.
gclk.alignAsyncResetStart(pushClock, popClock)
from spinalhdl.
you can use them by calling withAsync method of FormalConfig.
from spinalhdl.
About the documentation, the formal verification currently is still not widely used, especially the Cross Clocking one. So I want to wait more test before we documented the usage.
Because if it is documented, the backward compatibility would be the most important thing we should take consider in.
from spinalhdl.
Related Issues (20)
- Is there any way to add delay at assignment? HOT 5
- Pipeline API `throwWhen(usingReady = true)` doesn't drop transaction when conflicting with prior `halt` HOT 1
- ClockDomain for input/output ports? HOT 10
- question about mem initialization HOT 11
- StreamFragmentWidthAdapter.make missing earlylast argument HOT 2
- How to generate RTL with parameters? HOT 2
- StreamMux with streamed select no correct join HOT 9
- WishboneSlaveFactory - doWrite is never called in pipelined mode HOT 3
- Wishbone BusIf SEL usage HOT 1
- Formal verifiation: SymbiYosys of SpinalTemplateSbt fails with "RG_WIDTH > 1 is not support by async2sync, use clk2fflogic." when using async reset
- Set clock domain from blackbox HOT 2
- Error when create a new ClockDomain in simulation HOT 2
- SystemVerilog Interface Support HOT 2
- NamedType returns null when called outside of a Component HOT 11
- AxiLite4SlaveFactory generates combinatorial paths from inputs to ready outputs HOT 5
- Signal naming oversights HOT 3
- `onSamplings` error when use inside clockdomain
- FiberPlugin addPrePopTask HOT 5
- Plugin deadlock in circular dependency on Handle HOT 5
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 spinalhdl.