Infinite capacity buffer

If you need to prevent components from a token producing part of the design from influencing a token consuming part of the design (for example token sequencers and design under test from a scoreboard in a testing harness), you need a way to decouple these two partitions. The best way to do so is an infinite capacity buffer. This simulation library offers such a construction; however it is obviously not synthesizable.

There are two versions of the buffer; buffer_en is controllable (input and output can be separately disabled), buffer has both input and output always enabled. They are otherwise identical.

Parameters

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

Interface

  • I: Token input channel
  • O: Token output channel

Additionally, buffer_en has the following flags:

  • enable_in: Boolean flag to turn on/off accepting further input
  • enable_out: Boolean flag to turn on/off generating further output (if available)

Finally, both buffer variants also have an empty flag, this must be left unconnected (and is thus omitted in this documentation)! This is due to actsim not handling updates of purely local variables from parallel loops within a single process.

The available processes are:

export template<pint D_WIDTH, BUFFER_ID; pbool LOG>
defproc buffer_en (chan?(int<D_WIDTH>) I; chan!(int<D_WIDTH>) O; bool enable_in, enable_out);
 
export template<pint D_WIDTH, BUFFER_ID; pbool LOG>
defproc buffer (chan?(int<D_WIDTH>) I; chan!(int<D_WIDTH>) O);