MatchLib
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ArbitratedScratchpad< DataType, CapacityInBytes, NumInputs, NumBanks, InputQueueLen > Class Template Reference

Scratchpad Memories with arbitration and queuing. More...

#include <ArbitratedScratchpad.h>

Classes

struct  bank_req_t
 
struct  bank_rsp_t
 

Public Types

typedef cli_req_t< DataType, addr_width, NumInputs > req_t
 
typedef cli_rsp_t< DataType, NumInputs > rsp_t
 

Public Member Functions

typedef NVUINTW (log2_nbanks) bank_sel_t
 
typedef NVUINTW (bank_addr_width) bank_addr_t
 
typedef NVUINTW (log2_inputs) input_sel_t
 
void compute_bank_request (req_t &curr_cli_req, bank_req_t bank_req[NumInputs], bank_sel_t bank_sel[NumInputs], bool bank_req_valid[NumInputs])
 
void banks_load_store (bank_req_t bank_req[NumBanks], bool bank_req_valid[NumBanks], bank_rsp_t bank_rsp[NumBanks])
 
void reset ()
 
void load_store (bank_req_t bank_req[NumInputs], bank_sel_t bank_sel[NumInputs], bool bank_req_valid[NumInputs], rsp_t &load_rsp, bool input_ready[NumInputs])
 

Public Attributes

mem_array_sep< DataType, CapacityInBytes, NumBanks > banks
 
bank_req_t bank_reqs [NumInputs]
 
bank_rsp_t bank_rsps [NumInputs]
 
ArbitratedCrossbar< bank_req_t, NumInputs, NumBanks, InputQueueLen, 0 > request_xbar
 

Static Public Attributes

static const int kDebugLevel = 2
 
static const int addr_width = nvhls::nbits<CapacityInBytes - 1>::val
 
static const int log2_nbanks = (NumBanks == 1) ? 1 : nvhls::nbits<NumBanks - 1>::val
 
static const int log2_inputs = (NumInputs == 1) ? 1 : nvhls::nbits<NumInputs - 1>::val
 
static const bool is_nbanks_power_of_2 = (NumBanks & (NumBanks - 1)) == 0
 
static const int bank_addr_width = (is_nbanks_power_of_2 && (NumBanks > 1)) ? (addr_width - log2_nbanks) : (addr_width - log2_nbanks + 1)
 

Detailed Description

template<typename DataType, unsigned int CapacityInBytes, unsigned int NumInputs, unsigned int NumBanks, unsigned int InputQueueLen>
class ArbitratedScratchpad< DataType, CapacityInBytes, NumInputs, NumBanks, InputQueueLen >

Scratchpad Memories with arbitration and queuing.

Template Parameters
DataTypeDataType if input and output
CapacityInBytesCapacity of scratchpad
NumInputsNumber of Inputs
NumBanksNumber of Banks
LenInputBufferLength of Input Buffer
LenOutputBufferLength of Output Buffer
A Simple Example
#include <ArbitratedScratchpad.h>
...
ArbitratedScratchpad<DataType, ScratchpadCapacity, NumInputs, NumBanks, InputQueueLength> dut;
dut.reset(); // optional in this case, suitable if xbar is a class member rather than local variable
...
dut.load_store(curr_cli_req, curr_cli_rsp, ready);
...

Definition at line 58 of file ArbitratedScratchpad.h.


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