Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

toby-bro/VeriFuse

Repository files navigation

pfuzz - VeriFuse

P stands for parser and not python which was the original idea and the reason for the name. Other suggested names are:

Features

  • Differential fuzzing of verilog simulators and synthesizers
    • Currently verilator, yosys, yosys-slang, icarus/iverilog, sv2v
  • Creates complex verilog code from simple inital verilog modules called "snippets"
  • Supports the fact that all simulators and synthesizers do not support the same features (cf comparison)
  • Guarantees nevertheless that the created verilog code has an expected simulation chance of at least 75% (value that can be changed)

Working on

  • improving the snippets
  • adding more snippets
  • adding more simulators and synthesizers

Bugs found

High quality bugs found

Low quality bugs

Example usage

make build-fuzzer

# Check a file for validity
./pfuzz check-file -file isolated/V3SchedTiming/mod_automatic_task.sv 

# Score snippets for better fuzzing (optional but recommended)
./scripts/score_snippets.sh

# Fuzz a file by injecting snippets into its modules
./pfuzz fuzz -n 160 -strategy smart -file testfiles/sv/ok/sequential_logic.sv -vv

For detailed information about the scoring system, see docs/SCORING.md.

For more details on how we decide how many modules to use and which one we pick to ensure that we have simulatable code then check the docs/INJECTING.md

Supported tools

Simulators

Synthesizers and co

  • yosys
  • sv2v (it is not a synthesizer but I tidied it there as it has a similar behaviour)
  • vivado

Inject snippet - expected behavior

The objective is to inject the snippet IN the original module not to write another module. It might be usefull to have a slice / list of all the lines of the original modules to do this, to be able to modfy lines / inject lines.

What we are interested are mostly the values of the variables that are modified IN the original module. If we find one which corresponds then we inject our module the line after the input variable has been identified. If they are many different candidates for this choose one at random.

If no variable in the module is interesting then we can see if any of the inputs or outputs of the module is of any interest, if possible select clock and reset rarely (using a random decision maker once all the interesting things have been identified)

then see if the output variables of the module we are injecting have the same type as any variable higher up in the code and if they do have the same type then assign the output to this variable. Do not rename many to the same one. If you don't find any then add it to the global outputs of the module

About

Attempt to make a go module for fuzzing verilog simulators

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •