Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
sim:start [2022/07/17 06:15] rajit [Namespace sim::rand] |
sim:start [2024/02/22 17:52] fabian |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | The '' | + | The simulation library is a collection of components which will aid you in testing and verifying your designs. Components in this library are decidedly not synthesizable and should never be included in a final design. A lot of the components use actsim' |
+ | |||
+ | All components of the simulation | ||
<code act> | <code act> | ||
Line 7: | Line 9: | ||
</ | </ | ||
- | ===== Exported processes | + | ===== Components |
- | + | ||
- | + | ||
- | <code act> | + | |
- | template< | + | |
- | defproc source (chan!(int< | + | |
- | </ | + | |
- | This creates a data source that has bit-width '' | + | |
- | + | ||
- | <code act> | + | |
- | template< | + | |
- | defproc sink(chan? | + | |
- | </ | + | |
- | This process acts as a data sink; it repeatedly receives '' | + | |
- | + | ||
- | <code act> | + | |
- | template< | + | |
- | defproc source_seq(chan!(int< | + | |
- | </ | + | |
- | This process also provides a '' | + | |
- | + | ||
- | <code act> | + | |
- | export template< | + | |
- | defproc file_source(chan!(int< | + | |
- | </ | + | |
- | This process is also a '' | + | |
- | + | ||
- | <code act> | + | |
- | export template< | + | |
- | defproc check_sink(chan? | + | |
- | </ | + | |
- | This process is a '' | + | |
- | + | ||
- | ===== Namespace sim::rand ===== | + | |
- | + | ||
- | The '' | + | |
- | + | ||
- | <code act> | + | |
- | export template< | + | |
- | defproc source(chan!(int< | + | |
- | </ | + | |
- | This defines a source whose output is generated using the underlying C library' | + | |
- | + | ||
- | <code act> | + | |
- | export function init(int< | + | |
- | export function init_range(int< | + | |
- | </ | + | |
- | These functions are used to initialize a (pseudo) random number generator. They return an identifier to be used in subsequent calls to the functions below to access the generator. The first one initializes a random number generator of the specified bit-width, while the second one specifies an interval over which the random number is supposed to be uniformly distributed. | + | |
- | + | ||
- | <code act> | + | |
- | export function get(int< | + | |
- | </ | + | |
- | Returns the next random number from the generator specified by index '' | + | |
- | + | ||
- | <code act> | + | |
- | export function seed(int< | + | |
- | </ | + | |
- | Set the seed for the random number generator '' | + | |
+ | * [[sources | Sources]] are components which emit tokens onto channels; multiple ways of specifying the data are supported | ||
+ | * [[sinks | Sinks]] are the opposite of sources; they absorb tokens | ||
+ | * [[scoreboards | Scoreboards]] are an advanced form of sink; they can compare a model output with the actual micro-architecture to verify the latter | ||
+ | * [[loggers | Loggers]] provide a simple way of extracting data tokens from a channel without influencing visibility for the components they connect | ||
+ | * The library also provides an [[ inf_buffer | infinite capacity buffer]], which removes possible timing influences of the simulation harness | ||
+ | * [[rng | Random number generators]] are special sources, which output random tokens | ||
+ | * Lastly, the library also exposes the functions used for [[file | file interaction]] |