Sources

For all data origin types, there are four sources providing it. This is by design: Ever source has a version with a single output channel and one with a configurable number of output channels (names contain _multi). On top of that, each of those versions has a variation which will always be enabled, and one which has an enable flag exposed (names contain _en). In all other respects, those 4 versions are identical. Multi-ended sources will replicate tokens over all output channels and only send the next token when the previous transaction has completed on all channels. These variants are especially helpful when building a verification harness for a specific design. When using one or multiple scoreboards, one might wish to send the same input tokens to the design and model, as well as a logger. Using a multi-ended source will allow you to not need any token replication and simply connect the source to all points where the data is needed. Since asynchronous logic is already token based, the source (which would be a sequencer in UVM/SystemVerilog) can be connected directly without need for a Driver/Monitor in the middle.

As a side-note: Make sure the timing behavior of multi-ended sources does not influence your testing routine when verifying a design. Insert token buffers where needed! A more detailed guide can be found on the page about scoreboards.

For the sake of simplicity, we will first explain the parameters all sources share, then go into parameters that differ between them.

Shared parameters

  • D_WIDTH: The bit width of the data bus
  • SOURCE_ID: ID of the source to be used in log output
  • LOG: Toggles whether or not the source should post a log line whenever a token is emitted

All _multi sources additionally have:

  • OUT_CHANNELS: Number of output channels on which the token should be emitted

The parameter order for all components generally is [interface] [variant settings] [logging]; this translates into a general parameter order of D_WIDTH, [OUT_CHANNELS, ] (source specifics), SOURCE_ID, LOG for all sources.

Interface

All sources have an identical output interface:

  • O: Singular output channel for normal and array of size OUT_CHANNELS for all _multi sources

Additionally, for all _en sources:

  • enable: Source only emits tokens if this flag is high

Source types

Static source

This is by far the simplest source type. It is configured to output a single, parameter given value over and over. Parameters are:

  • VALUE: The value which should be outputted

The available sources are:

export template<pint D_WIDTH, VALUE, SOURCE_ID; pbool USE_EN, LOG>
defproc source_static (chan!(int<D_WIDTH>) O);
 
export template<pint D_WIDTH, OUT_CHANNELS, VALUE, SOURCE_ID; pbool USE_EN, LOG>
defproc source_static_multi (chan!(int<D_WIDTH>) O[OUT_CHANNELS]);
 
export template<pint D_WIDTH, VALUE, SOURCE_ID; pbool USE_EN, LOG>
defproc source_static_en (chan!(int<D_WIDTH>) O; bool enable);
 
export template<pint D_WIDTH, OUT_CHANNELS, VALUE, SOURCE_ID; pbool USE_EN, LOG>
defproc source_static_multi_en (chan!(int<D_WIDTH>) O[OUT_CHANNELS]; bool enable)

Sequence source

These types of sources can output a (repeating) sequence of numbers on their output port. The sequence is and sequence length are specified in parameters. These are:

  • N: Number of tokens in the sequence
  • DATA: The array containing the sequence
  • LOOP: Whether or not the sequence should be repeated

The available sources are:

export template<pint D_WIDTH, N; pint DATA[N]; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_sequence (chan!(int<D_WIDTH>) O)
 
export template<pint D_WIDTH, OUT_CHANNELS, N; pint DATA[N]; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_sequence_multi (chan!(int<D_WIDTH>) O[OUT_CHANNELS])
 
export template<pint D_WIDTH, N; pint DATA[N]; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_sequence_en (chan!(int<D_WIDTH>) O; bool enable)
 
export template<pint D_WIDTH, OUT_CHANNELS, N; pint DATA[N]; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_sequence_multi_en (chan!(int<D_WIDTH>) O[OUT_CHANNELS]; bool enable)

File sources

This type of source can read a (repeating) sequence of data values from a file. This file can contain values in base 10, 16, 8, and 2 using no prefix, 0x, 0o, and 0b respectively. Every value to be emitted shall be separated with a new line. Trailing data in a line will be ignored and (except comments) cause an error message. Comments in the file (including inline) are supported and must be prefixed with #.

# This is a demo input file
1
2
3

# Look, here comes a hex value
0xDEADBEEF

# We support octal and binary as well
0o10 # this is actually 8 in decimal
0b1010101

Multiple sources can use the same input file to read from without interfering with each other. There are also ways to write to files using the simulation library - you cannot read from and write to a specific file at the same time.

Files in actsim use a common simulation file prefix. By default, this is _infile_., where the period is followed by a number, from hereon out referred to as a *file ID*. You can alias a given file ID with a different file name that does not adhere to this naming scheme using an actsim config file. The following is a copy of the default actsim configuration.

#
# parameters for external file names for sim::file* functions
#
begin file
    # by default, file names will be prefix.<number>
    string prefix "_infile_"

    # alternatively, you can specify file names here
    # where 0 = first file name, 1 = second file name, etc.
    # string_table name_table "file1.in" "file2.in"

    # by default, output file names will be prefix.<number>
    string outprefix "_outfile_"
    # alternatively, you can specify output file names here
    # where 0 = first file name, 1 = second file name, etc.
    # string_table outname_table "file1.in" "file2.in"
end

This configuration can be found on your local machine by going to $ACT_HOME/conf/generic/actsim.conf. Please see the actsim documentation page for more details.

File sources use the following parameters:

  • F_ID: The ID of the file to read
  • LOOP: Whether or not the sequence should be repeated

The available sources are:

export template<pint D_WIDTH, F_ID; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_file (chan!(int<D_WIDTH>) O);
 
export template<pint D_WIDTH, OUT_CHANNELS, F_ID; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_file_multi (chan!(int<D_WIDTH>) O[OUT_CHANNELS]);
 
export template<pint D_WIDTH, F_ID; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_file_en (chan!(int<D_WIDTH>) O; bool enable);
 
export template<pint D_WIDTH, OUT_CHANNELS, F_ID; pbool LOOP; pint SOURCE_ID; pbool LOG>
defproc source_file_multi_en (chan!(int<D_WIDTH>) O[OUT_CHANNELS]; bool enable);