Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sim:sources [2024/02/22 18:21]
fabian created
sim:sources [2024/02/23 13:19] (current)
fabian [Interface]
Line 1: Line 1:
 ====== Sources ====== ====== 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. On top of that, each of those versions has a variation which will always be enabled, and one which has an enable flag exposed. 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. For the sake of simplicity, we will first explain the parameters all sources share, then go into parameters that differ between them.+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 [[sim:scoreboards | 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 ===== ===== Shared parameters =====
Line 20: Line 24:
  
    * ''O'': Singular output channel for normal and array of size ''OUT_CHANNELS'' for all ''_multi'' sources    * ''O'': Singular output channel for normal and array of size ''OUT_CHANNELS'' for all ''_multi'' sources
-   * ''enable'': Enable flag that only exists for all ''_en'' sources 
  
 +Additionally, for all ''_en'' sources:
 +
 +   * ''enable'': Source only emits tokens if this flag is high
 ===== Source types ===== ===== Source types =====
  
Line 73: Line 79:
  
 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 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 ''#''.
 +
 +<code>
 +# 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
 +
 +</code>
  
 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. 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.