MatchLib
Functions

Configurable nxn crossbar datapath. More...

Functions

template<typename DataType , unsigned NumInputLanes, unsigned NumOutputLanes>
void crossbar (DataType data_in[NumInputLanes], bool valid_in[NumInputLanes], NVUINTW(nvhls::index_width< NumInputLanes >::val) source[NumOutputLanes], bool valid_source[NumOutputLanes], DataType data_out[NumOutputLanes], bool valid_out[NumOutputLanes])
 Main entry point for crossbar - most generic implementation. More...
 
template<typename DataType , unsigned NumInputLanes, unsigned NumOutputLanes>
void crossbar (DataType data_in[NumInputLanes], bool valid_in[NumInputLanes], NVUINTW(nvhls::index_width< NumInputLanes >::val) source[NumOutputLanes], DataType data_out[NumOutputLanes], bool valid_out[NumOutputLanes])
 Simplified specialization with no valid_source parameter. All source selections are assumed to be valid.
 
template<typename DataType , unsigned NumInputLanes, unsigned NumOutputLanes>
void crossbar (DataType data_in[NumInputLanes], NVUINTW(nvhls::index_width< NumInputLanes >::val) source[NumOutputLanes], DataType data_out[NumOutputLanes])
 Simplified specialization with no valid parameter at all. Inputs are assumed to be valid. Validity of outputs is not reported.
 

Detailed Description

Configurable nxn crossbar datapath.

Function Documentation

◆ crossbar()

template<typename DataType , unsigned NumInputLanes, unsigned NumOutputLanes>
void crossbar ( DataType  data_in[NumInputLanes],
bool  valid_in[NumInputLanes],
NVUINTW(nvhls::index_width< NumInputLanes >::val)  source[NumOutputLanes],
bool  valid_source[NumOutputLanes],
DataType  data_out[NumOutputLanes],
bool  valid_out[NumOutputLanes] 
)

Main entry point for crossbar - most generic implementation.

Template Parameters
DataTypeDatatype of input and output of each lane
NumInputLanesNumber of input lanes
NumOutputLanesNumber of output lanes
Parameters
[in]data_inArray of data inputs for each lane, indexed by input lane id.
[in]valid_inArray of boolean valid bits, indexed by input lane id.. False means data can be ignored.
[in]sourceArray indicating the origin lane for each output lane id. Indexed by output lane id.
[in]valid_sourceArray of boolean valid bits, indexed by output lane id. Indicated validity of source selection for given output.
[out]data_outArray of outputs, indexed by output lane id.
[out]valid_outArray of outputs, indexed by output lane id.
Overview
  • Routing input data into output based on source information.
  • Output will be invalid if either source information for that output was invalid or selected input lane is invalid.
  • Invalid output will have 0 on data bits.
A Simple Example
#include <crossbar.h>
...
Src_t src_in[NUM_OUTPUTS]; // src_in[x]=y means lane x output comes from lane y
Word_t data_out[NUM_OUTPUTS];
bool valid_in[NUM_INPUTS];
bool valid_src[NUM_OUTPUTS];
bool valid_out[NUM_OUTPUTS];
...
crossbar<DATA_TYPE, NUM_INPUTS, NUM_OUTPUTS>(
data_in, valid_in,
source, valid_source,
data_out,valid_out);
...

Definition at line 78 of file crossbar.h.