Skip to content

SymbioticEDA/getting-started-FV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started with Formal Verification

This short guide aims to get you started with the Symbiotic EDA Formal Verification tools.

Install the tools and the license

You will have been sent the license and a link to download the tools. For this example we will assume the tool package has been downloaded to ~/Downloads/symbiotic-20190924B-symbiotic.tar.gz and the license has been downloaded to ~/Downloads/symbiotic-eval.lic

Make sure you change the text below to match your package and license names.

Typically you will install the tools like this:

cd /opt
sudo tar -xzf ~/Downloads/symbiotic-20190924B-symbiotic.tar.gz

Then include this new directory in your PATH environment variable:

export PATH=/opt/symbiotic-20190924B-symbiotic/bin:$PATH

If you want to make this change permanent, add it to your .bashrc file:

echo 'export PATH=/opt/symbiotic-20190924B-symbiotic/bin:$PATH' >> ~/.bashrc

Save the license file to a safe place:

cp ~/Downloads/symbiotic-eval.lic ~/

And create a new environment variable so the tools can find it:

export SYMBIOTIC_LICENSE="$HOME/symbiotic-eval.lic"

If you want to make this permament, add it to your .bashrc file:

echo 'export SYMBIOTIC_LICENSE="$HOME/symbiotic-eval.lic"' >> ~/.bashrc

Check the tools are installed correctly

run this command:

which yosys

This should return the path where yosys is installed in /opt/symbiotic

yosys

This will start yosys in shell mode and you should see that your license is verified:

[license] Signature verified.

If not, please contact us to help you resolve the issue.

Then press ctrl+D or type 'exit' to exit yosys.

Formally Verify a simple Verilog example

Take a look at the example: counter.v. We have one formal property, an assertion that the counter will always be less than MAX_AMOUNT. counter.sby is the configuration file.

Run this command to Formally Verify the counter example:

sby -f counter.sby

The -f switch removes previous test results. You will see some log output from the tool and the last line shows the result: FAIL. When the tools find a way to break an assertion they generate a trace file.

  • If the test failed bounded model checking (BMC), the trace will be written to counter/engine_0/trace.vcd.
  • If the test failed induction, the trace will be written to counter/engine_0/trace_induct.vcd.

The BMC failed because the solver was able to set the initial value of the count register to a value greater than MAX_AMOUNT. Fix this by setting a default value for the register and then run the verification again.

To learn more about Formal Verification, see the resources section below

Formally Verify a simple VHDL example

The tools currently don't support VHDL formal properties. The work-around is to write the formal properties with System Verilog Assertions and then bind that to the module under test.

Take a look at the example: counter.vhd. To define the a formal properties, we created counter_vhd.sv. In this file we make an assertion that the counter will always be less than MAX_AMOUNT.

counter_vhd.sby is the configuration file.

Run this command to Formally Verify the counter example:

sby -f counter_vhd.sby

The -f switch removes previous test results. You will see some log output from the tool and the last line shows the result: FAIL. When the tools find a way to break an assertion they generate a trace file.

  • If the test failed bounded model checking (BMC), the trace will be written to counter_vhd/engine_0/trace.vcd.
  • If the test failed induction, the trace will be written to counter_vhd/engine_0/trace_induct.vcd.

The BMC failed because the solver was able to set the initial value of the count register to a value greater than MAX_AMOUNT. Fix this by setting a default value for the register and then run the verification again.

To learn more about Formal Verification, see the resources section below

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published