A collection of examples of using PSL for functional and formal verification of VHDL designs with GHDL (and Yosys / SymbiYosys).
This is a project with the purpose to get a current state of PSL implementation in GHDL. It probably will find unsupported PSL features, incorrect implemented features or simple bugs like GHDL crashs.
It is also intended for experiments with PSL when learning the language. You can play around with the examples, as they are pretty simple. You can comment out failing assertions if you want to have a successful proof or simulation if you want. You can change them to see what happens.
It is recommended to use an up-to-date version of GHDL as potential bugs are fixed very quickly. Especially the synthesis feature of GHDL is very new and still beta. You can build GHDL from source or use one of the Docker images which contain also the SymbiYosys toolchain.
For example the hdlc/formal:min
docker image provided by the hdl containers project (recommended). Or you build a docker image on your own machine using my Dockerfiles for SymbiYosys & GHDL. With both you have the latest tool versions available.
Have fun!
The next lists will grow during further development
assert
directivecover
directiveassume
directive (synthesis)restrict
directive (synthesis)
always
operatornever
operator- logical implication operator (
->
) - logical iff operator (
<->
) next
operatornext[n]
operatornext_a[i to j]
operatornext_e[i to j]
operatornext_event
operatornext_event[n]
operatornext_event_e[i to j]
operatoruntil
operatoruntil_
operatorbefore
operator (GHDL crash with a specific invalid property, see PSL before example)eventually!
operator
- Simple SERE
- Concatenation operator (
;
) - Fusion operator (
:
) - Overlapping suffix implication operator (
|->
) - Non overlapping suffix implication operator (
|=>
) - Consecutive repetition operator (
[*]
,[+]
,[*n]
,[*i to j]
) - Non consecutive repetition operator (
[=n]
,[=i to j]
) - Non consecutive goto repetition operator (
[->]
,[->n]
,[->i to j]
) - Length-matching and operator (
&&
) - Non-length-matching and operator (
&
) - or operator (
|
) within
operator
abort
operatorasync_abort
operatorsync_abort
operator
prev()
function (Synthesis only)stable()
function (Synthesis only)rose()
function (Synthesis only)fell()
function (Synthesis only)onehot()
function (Synthesis only)onehot0()
function (Synthesis only)
- Partial support of PSL vunits (synthesis only)
- Partial support of named sequences (some parameter types missing)
- Partial support of named properties (some parameter types missing)
- Partial support of PSL
endpoint
(simulation only, in PSL comments) - vunit inhiterance (
inherit
, synthesis only)
Yosys formal extensions (reference to Symbiyosys docs)
anyconst
attribute (synthesis only)anyseq
attribute (synthesis only)
forall
operatorfor
operator- Synthesis of built-in functions
countones()
,isunknown()
- Synthesis of strong operator versions
- Simulation of built-in functions
- Simulation of PSL vunits
- PSL macros (
%for
,%if
) union
expression
eventually!
behaviour with liveness proofs, see GHDL issue 1345
- Wikipedia about PSL
- Doulos Designer's Guide To PSL
- Project VeriPage PSL Tutorial
- FirstEDA Blog - An Introduction to Assertion-Based Verification
- FirstEDA Blog - Achieving Better Coverage with VHDL
- 1850-2010 - IEEE Standard for PSL
- A Practical Introduction to PSL Book
- Formal Verification Book
- PSL Specification for WISHBONE System-on-Chip (from the PROSYD project)
- GHDL documentation
- SymbiYosys documentation