Clone this repo:
  1. 76ffd92 Create OWNERS file for chromiumos/third_party/svunit by Jack Neus · 4 weeks ago chromeos factory-14162.B factory-keeby-14162.B stabilize-14163.B stabilize-14178.B stabilize-14179.B stabilize-14189.B stabilize-14217.B stabilize-rust-14220.B
  2. 3ff8a57 Merge pull request #113 from Plasteli-net/fix-pytest by Tudor Timi · 5 weeks ago upstream/master
  3. 4a03628 Remove extraneous '.' from file path in 'expect' by Tudor Timi · 5 weeks ago
  4. 59a539b Fix 'sim_8' test by Tudor Timi · 5 weeks ago
  5. 44d562b Disable 'uvm_report_mock' tests for UVM 1.2 by Tudor Timi · 5 weeks ago

SVUnit

SVUnit is an open-source test framework for ASIC and FPGA developers writing Verilog/SystemVerilog code. SVUnit is automated, fast, lightweight and easy to use making it the only SystemVerilog test framework in existence suited to both design and verification engineers that aspire to high quality code and low bug rates.

NOTE: for instructions on how to get going with SVUnit, go to www.agilesoc.com/svunit.

NOTE: Refer also to the FAQ at: www.agilesoc.com/svunit/svunit-FAQ

Release Notes

Go here for release notes.

Step-by-step instructions to get a first unit test going

1. Set up the SVUNIT_INSTALL and PATH environment variables

export SVUNIT_INSTALL=`pwd`
export PATH=$PATH:$SVUNIT_INSTALL"/bin"

You can source Setup.bsh if you use the bash shell.

source Setup.bsh

You can source Setup.csh if you use the csh shell.

source Setup.csh

2. Go somewhere outside SVUNIT_INSTALL (i.e. where you are right now)

Start a class-under-test:

// file: bogus.sv
class bogus;
endclass

3. Generate the unit test

create_unit_test.pl bogus.sv

4. Add tests using the helper macros

// file: bogus_unit_test.sv
`SVUNIT_TESTS_BEGIN

  //===================================
  // Unit test: test_mytest
  //===================================
  `SVTEST(test_mytest)
  `SVTEST_END

`SVUNIT_TESTS_END

5. Run the unit tests

runSVUnit -s <simulator> # simulator is ius, questa, modelsim, riviera or vcs

6. Repeat steps 4 and 5 until done

7. Pat self on back