diff --git a/verilog/dv/cocotb/README.md b/verilog/dv/cocotb/README.md index 5512fc70..ee57815c 100644 --- a/verilog/dv/cocotb/README.md +++ b/verilog/dv/cocotb/README.md @@ -1,21 +1,52 @@ -# How to run test: +Overview +======== +Cocotb environment (CTN) is a dynamic simulation testing environment. It's purpose is to speed testing simulation time and get coverage data. The environment is developed using cocotb, an open source coroutine-based co simulation testbench environment for verifying VHDL and SystemVerilog RTL using Python. CTN has 2 main layers: tests and whitebox models. Tests layer contain multiple tests and sequences that can communicate with the caravel (dut) through drivers shown in read at fig 1. Whitebox models layer contain multiple models that should mimic the behavior of each main block inside caravel see fig1. Model is supposed to check if the model is working as expected, if its registers contain the expected values all the time and report coverage of features provided by this block if it’s tested or not. -Navigate to the cocotb directory and run the following command -## To run test : - >python3 run.py -t -sim -tag +.. image::docs/CTN.png +fig1. caravel testbench environment (read lines are drivers ) + +Prerequisites +============================= + +- Docker: [Linux](https://hub.docker.com/search?q=&type=edition&offering=community&operating_system=linux&utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header) || [Windows](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header) || [Mac with Intel Chip](https://desktop.docker.com/mac/main/amd64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header) || [Mac with M1 Chip](https://desktop.docker.com/mac/main/arm64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header) +- Python 3.6+ with PIP +- cocotb +- iverilog or vcs + +run a test +============================= + + Use script verify_cocotb.py + +``` - Or + -h, --help show this help message and exit - >python3 run.py --test -sim -tag + -regression REGRESSION, -r REGRESSION + name of regression can found in tests.json + + -test TEST [TEST ...], -t TEST [TEST ...] + name of test if no --sim provided RTL will be run + + + -sim SIM [SIM ...] Simulation type to be run RTL,GL&GL_SDF provided only + when run -test + + -testlist TESTLIST, -tl TESTLIST + path of testlist to be run + + -tag TAG provide tag of the run default would be regression + name and if no regression is provided would be + run___ + + -maxerr MAXERR max number of errors for every test before simulation + breaks default = 3 + +``` -## To run regression - >python3 run.py -r -tag - Or +Tests +=============== - >python3 run.py --regression -tag +Refer to [tests.json](tests.json) for tests list -## Notes -> Tests and regressions can be used in the same command - -> Tests and regressions can be found under cocotb/tests.json