Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
sim:start [2022/07/17 06:00]
rajit
sim:start [2024/02/22 17:52]
fabian
Line 1: Line 1:
-====== Namespace sim ======+====== Simulation library ======
  
-The ''sim'' namespace contains a collection of process definitions that can be used to create simple test environments for simulation purposes.+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's capability to call external C functions from within CHP code.
  
-<code act> +All components of the simulation library can be found within the ''sim'' namespace. There are several sub-namespaces which contain components which fall under the same group. You can access all these components by importing the ''sim'' namespace.
-export template<pint W, V> defproc source (chan!(int<W>) O); +
-</code> +
-This creates a data source that has bit-width ''W'', and that repeatedly sends the constant value ''V'' on the output port ''O''.+
  
 <code act> <code act>
-export template<pbool LOG; pint W> defproc sink(chan?(int<W>) I);+import sim;
 </code> </code>
-This process acts as a data sink; it repeatedly receives ''W''-bit input on the input port ''I''. If the ''LOG'' parameter is set to true, then it also displays the value received using the ''log()'' command. 
- 
-<code act> 
-export template<pint W; pbool REP; pint N; pint data[N]> 
-defproc source_seq(chan!(int<W>) O); 
-</code> 
- 
- 
- 
- 
  
 +===== Components =====
  
 +   * [[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]]