SharedStorageChannelTracking constructor

SharedStorageChannelTracking(
  1. int channelId, {
  2. required int indexWidth,
  3. required Logic clk,
  4. required Logic reset,
  5. required Logic push,
  6. required Logic pushIndex,
  7. required Logic pop,
  8. required Logic popReplacementIndex,
  9. SharedStorageOccupancyObserver? occupancyObserver,
})

Creates a tracker for a single channel in a large shared queue.

The popReplacementIndex is the new head of the queue for this channel from storage.

Implementation

SharedStorageChannelTracking(
  this.channelId, {
  required this.indexWidth,
  required Logic clk,
  required Logic reset,
  required Logic push,
  required Logic pushIndex,
  required Logic pop,
  required Logic popReplacementIndex,
  SharedStorageOccupancyObserver? occupancyObserver,
}) : super(name: 'ch${channelId}_tracking') {
  this.clk = addInput('clk', clk);
  this.reset = addInput('reset', reset);
  this.push = addInput('push', push);
  this.pushIndex = addInput('pushIndex', pushIndex, width: pushIndex.width);
  this.pop = addInput('pop', pop);
  this.popReplacementIndex = addInput(
    'popReplacementIndex',
    popReplacementIndex,
    width: popReplacementIndex.width,
  );
  addOutput('firstIndex', width: indexWidth);
  addOutput('lastIndex', width: indexWidth);
  addOutput('empty');
  addOutput('nextFirstIndex', width: indexWidth);
  addOutput('nextFirstIndexValid');

  _buildLogic(occupancyObserver);
}