Skip to main content

Functional Coverage and Constrained Randomization Extensions for Cocotb

Project description

cocotb-coverage

Functional Coverage and Constrained Randomization Extensions for Cocotb

Documentation Status Build Status

This package allows you to use constrained randomization and functional coverage techniques known from CRV (constrained random verification) and MDV (metric-driven verification) methodologies, available in SystemVerilog or e. Such extensions enable the implementation of an advanced verification environment for complex projects.

The implemented functionality is intended to be easily understandable by SystemVerilog users and provides significant extensions compared to Hardware Verification Languages.

There is an option to export coverage database to a readable XML format and a function which allows for merging such files is provided.

References:

Simple example below:

# point represented by x and y coordinates in range (-10,10)
class Point(crv.Randomized):

    def __init__(self, x, y):
        crv.Randomized.__init__(self)
        self.x = x
        self.y = y

        self.add_rand("x", list(range(-10, 10)))
        self.add_rand("y", list(range(-10, 10)))
        # constraining the space so that x < y
        self.add_constraint(lambda x, y: x < y)

...

# create an arbitrary point
p = Point(0,0)

for _ in range (10):

    # cover example arithmetic properties
    @CoverPoint("top.x_negative", xf = lambda point : point.x < 0, bins = [True, False])
    @CoverPoint("top.y_negative", xf = lambda point : point.y < 0, bins = [True, False])
    @CoverPoint("top.xy_equal", xf = lambda point : point.x == point.y, bins = [True, False])
    @CoverCross("top.cross", items = ["top.x_negative", "top.y_negative"])
    def plot_point(point):
        ...

    p.randomize()  # randomize object
    plot_point(p)  # call a function which will sample the coverage

#export coverage to XML
coverage_db.export_to_xml(xml_name="coverage.xml")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cocotb-coverage-0.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cocotb_coverage-0.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file cocotb-coverage-0.1.0.tar.gz.

File metadata

  • Download URL: cocotb-coverage-0.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for cocotb-coverage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d024ca748f044fb7162d09dee3923da5cf33e6d66efd6ad3293d4f4b47bb43a
MD5 e05cf4eb0c08201161ec6772d3f31e90
BLAKE2b-256 372bf8be95582a6f7718c240453dcb5352e5eaa0fb647cfe32dcaff40005dfcb

See more details on using hashes here.

File details

Details for the file cocotb_coverage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cocotb_coverage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for cocotb_coverage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83574415c87083cd7329f7fa67f4c6c5669855723cb2e80103df379dd87cce41
MD5 84dc135112cc1067c998d0128988edcc
BLAKE2b-256 e8e4fd78fcd83c56d6c439e92261b21face8c0144291fab0be1ac9244d1853da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page