intel / rohd

The Rapid Open Hardware Development (ROHD) framework is a framework for describing and verifying hardware in the Dart programming language.
https://intel.github.io/rohd-website
BSD 3-Clause "New" or "Revised" License
374 stars 67 forks source link

232 add a mechanism for generating random logic values #362

Closed quekyj closed 1 year ago

quekyj commented 1 year ago

Description & Motivation

LogicValue is a useful type since it supports arbitrary width in an efficient representation. For testing purposes, it might be desirable to generate a random value on a bus of arbitrary width. The built-in Dart randomization only randomizes up to 2^32, which means users have to invent their own little code snippets to generate random numbers bigger than 32 bits.

Related Issue(s)

Fix #232

Testing

Add unit test to test random generation of the LogicValue.

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

No

Documentation

Included in the public documentation.