Sinks

Sinks are the opposite of sources. They simply consume tokens from a channel. While sinks may sound like they would be on the other end of a verification setup to sources, this library actually provides another type of sink: A scoreboard. This type of sink compares the values it receives to a reference value. When verifying a design, this type of sink should be used instead. To keep this group separate, this library only provides two types of (single-ended) simple sink.

For the sake of simplicity, we will first explain the parameters all sinks 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 sink to be used in log output
  • LOG: Toggles whether or not the sink should post a log line whenever a token is received

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

Interface

All sinks have an identical input interface:

  • I: Singular input channel all sinks

Additionally, for all _en sinks:

  • enable: Sink only absorbs tokens if this flag is high

Sink types

Simple sink

This type of sink simply absorbs the tokens that are sent to its input channel.

The available sinks are:

export template<pint D_WIDTH, SINK_ID; pbool LOG>
defproc sink (chan?(int<D_WIDTH>) I);
 
export template<pint D_WIDTH, SINK_ID; pbool LOG>
defproc sink_en (chan?(int<D_WIDTH>) I; bool enable);

File sink

This type of sink can write the tokens it receives to an output file. This can be done at different levels of verbosity according to the verbosity setting.

Only one sink can write to a given file at the same time, read and write access to a file is not possible.

Files in actsim use a common simulation file prefix. By default, this is _outfile_., 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.

The parameters for this sink are:

  • VERBOSITY: The level of verbosity with which data should be written to the outfile, where 0 is the least verbose, and 2 is maximum verbosity
  • F_ID: The ID of the file to write to

The available sinks are:

export template<pint D_WIDTH, VERBOSITY, F_ID, SINK_ID; pbool LOG>
defproc sink_file (chan?(int<D_WIDTH>) I)
 
export template<pint D_WIDTH, VERBOSITY, F_ID, SINK_ID; pbool LOG>
defproc sink_file_en (chan?(int<D_WIDTH>) I; bool enable)