MatchLib
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Arbiter< size_, ArbiterType > Class Template Reference

A generalized implementation of generic n-way roundrobin arbiter. More...

#include <Arbiter.h>

Public Member Functions

typedef NVUINTW (size_) Mask
 
void reset ()
 
Mask pick (const Mask &valid)
 

Protected Types

enum  _ { UNROLLED_SIZE = 2 * size_ - 1, log_unrolled_size = nvhls::log2_ceil<UNROLLED_SIZE>::val, log_size = nvhls::log2_ceil<size_>::val }
 

Protected Member Functions

typedef NVUINTW (UNROLLED_SIZE) UnrolledMask
 

Protected Attributes

Mask next
 

Detailed Description

template<unsigned int size_, arbiter_type ArbiterType = Roundrobin>
class Arbiter< size_, ArbiterType >

A generalized implementation of generic n-way roundrobin arbiter.

Template Parameters
size_Number of elements to be arbitrated.
ArbiterTypeSelecting arbitration method. Current class implements Roundrobin, and a dedicated class implements Static. (default: Roundrobin).
Overview
  • Given a vector indicating which elements are currently valid for selection, and previous selection, a new selection will be made.
  • Once a selection is made internal state is updated.
  • Selection is returned in form of a one-hot bitmask.
  • In case no entry is valid a zero selection mask will be returned.
A Simple Example
#include <Arbiter.h>
...
Arbiter<4> arbiter;
arbiter.reset(); // optional in this case, suitable if arbiter is a class member rather than local variable
while (1) {
...
Arbiter<4>::Mask active = ~0; // active mask is set, in this case all set to active
Arbiter<4>::Mask select = arbiter.pick(active);
...
};

Definition at line 61 of file Arbiter.h.


The documentation for this class was generated from the following file: