3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-29 00:15:51 +00:00

Merge pull request #264 from YosysHQ/krys/vhd_example

Add formal_bind example
This commit is contained in:
N. Engelhardt 2025-03-03 15:20:59 +00:00 committed by GitHub
commit 9675d158ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 89 additions and 0 deletions

View file

@ -140,3 +140,28 @@ multiple different clock domains are currently unsupported.
* ``@(negedge`` *clock* ``iff`` *enable* ``)``
* ``disable iff (`` *expression* ``)``
SVA properties in a VHDL design
-------------------------------
The below code snippet, taken from an example SBY configuration included in
|vhd_example|_, shows a VHDL design ``updowncount.vhd`` being loaded, followed
by a SystemVerilog file ``formal_bind.sv``.
.. |vhd_example| replace:: ``docs/examples/vhd``
.. _vhd_example: https://github.com/YosysHQ/sby/tree/master/docs/examples/vhd
.. literalinclude:: ../examples/vhd/formal_bind.sby
:language: yoscrypt
:start-after: [script]
:end-before: [files]
:caption: ``formal_bind.sby`` script section
.. literalinclude:: ../examples/vhd/formal_bind.sv
:language: SystemVerilog
:caption: ``formal_bind.sv``
As you can see, the ``formal_bind.sv`` file includes a ``formal_bind`` module
and makes use of the ``bind`` keyword in SystemVerilog to create an instance of
this module connecting the inputs to the signals of the same name in the VHDL
design. SVA properties can then be applied to those signals as if the whole
design was in SystemVerilog.