Giter Club home page Giter Club logo

flashsolve's Introduction

FlashSolve

FlashSolve is an open source Constrained Random Verification (CRV) tool. CRV is a testing methodology, used in both software and hardware, that aims to systematically generate test stimulus (test cases) to feed into the System Under Test (SUT). This is a much more robust and powerful approach to testing than manual testing, scenario-based testing, snapshot testing, or unit testing. By systematically defining the input space for the SUT using a mathematical constraint language, then using a constraint solver to exhaustively test the SUT using inputs from the input space, or to randomly sample inputs in case the input space is too large for exhaustive testing.

Our project aims at enhancing the solution generation process for SystemVerilog (SV) constraints. The motivation behind this project is to develop an open-source tool that can be utilized by a wide range of users. SystemVerilog, a hardware description language (HDL), contains a sub-language for constraint definition and random variable definition, and SV runtimes contains an embedded solver for this constraint language. Our project aims to be such a solver, in stand-alone form that can be embedded in any SV runtime or toolchain.

By combining the power of ANTLR, the .NET runtime, and the state-of-the-art Z3 SMT solver, Our project offers a versatile and user-friendly tool for generating random solutions to SV constraints. The open-source nature of this project ensures accessibility, fostering further advancements in the field of hardware description languages and constraint solving techniques.

Our project is architected as an additional layer on top of Z3, implementing various innovative techniques for random sampling of SMT constraints. These techniques include a naive approach, Max-SMT, Universal Hashing, and a hybrid approach that combines these techniques. By incorporating these enhancements, we are able to sample random solutions by guiding the Z3 solver to random subsets of the input space (i.e. in a black-box fashion, with no modification of the solver itself), thereby significantly improving the solution generation process.

๐Ÿ”— Dependencies

- .Net

install .Net 7.0.7 (sdk-7.0.304) from Microsoft official website:

https://dotnet.microsoft.com/en-us/download/dotnet/7.0

or click here

- ANTLR

Download the jar file for ANTLR from here or here

๐Ÿ’ฟ How to run

There are 4 modes to run:

1. parse: to parse SV file

write in the cmd the following

dotnet run parse file_path

example:

dotnet run parse "Tests/ifelse1.txt"

Note: you can feed the program in sv extension also

2. compile: to generate the Z3 problem (parse then compile)

write in the cmd the following

dotnet run compile file_path

example:

dotnet run compile "Tests/ifelse1.txt"

Note: you can feed the program in sv extension also

3. sample: to run the sampling algorithms you choose on one file (parse then compile then sample)

write in the cmd the following

dotnet run sample number_of_sols file_path

example:

dotnet run sample 50 "Tests/ifelse1.txt"

Note: you can feed the program in sv extension also

4. test: sample on different test cases

Note: Put test files in Tests folder write in the cmd the following

dotnet run test

Note: in the third and fourth case you will have the results and benchmark in out directory Note: the benchmark file only has the time of sampling, to calculate the spread you have to run another script

Calculate the Spread

  • run python script (spread_from_results.py)
python script_file_path outfile_path

flashsolve's People

Contributors

ahmed-emad10 avatar moste00 avatar makrion avatar elonsolmostafa1 avatar

Stargazers

 avatar Kariiem Taha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.