MatchLib
All Classes Namespaces Files Functions Modules Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
SubordinateFromFile< axiCfg > Class Template Reference

An AXI subordinate with its memory prepopulated from a file for use in testbenches. More...

#include <SubordinateFromFile.h>

Inheritance diagram for SubordinateFromFile< axiCfg >:

Public Types

typedef axi::axi4< axiCfg > axi4_
 

Public Member Functions

 SC_HAS_PROCESS (SubordinateFromFile)
 
 SubordinateFromFile (sc_module_name name_, std::string filename="mem.csv")
 

Public Attributes

axi4_::read::template subordinate if_rd
 
axi4_::write::template subordinate if_wr
 
sc_in< bool > reset_bar
 
sc_in< bool > clk
 
std::queue< typename axi4_::ReadPayloadrd_resp
 
std::queue< typename axi4_::Addr > rd_resp_addr
 
std::queue< typename axi4_::AddrPayloadwr_addr
 
std::queue< typename axi4_::WritePayloadwr_data
 
std::queue< typename axi4_::WRespPayloadwr_resp
 
std::map< typename axi4_::Addr, typename axi4_::Data > localMem
 
std::map< typename axi4_::Addr, NVUINT8 > localMem_wstrb
 
std::vector< typename axi4_::Addr > validReadAddresses
 
axi4_::WritePayload load_data_pld
 

Static Public Attributes

static const int kDebugLevel = 1
 
static const int bytesPerBeat = axi4_::DATA_WIDTH >> 3
 

Protected Member Functions

void run_rd ()
 
void run_wr ()
 

Detailed Description

template<typename axiCfg>
class SubordinateFromFile< axiCfg >

An AXI subordinate with its memory prepopulated from a file for use in testbenches.

Template Parameters
axiCfgA valid AXI config.
Overview
AxiSubordinateFromFile acts as an AXI subordinate in a testbench. It differs from Subordinate in that at the beginning of simulation time its internal state is prepopulated according to the contents of a CSV file. The CSV file format is as follows:
  • address_in_hex,data_in_hex

    It's best to specify the full DATA_WIDTH of data.

Definition at line 48 of file SubordinateFromFile.h.

Member Typedef Documentation

◆ axi4_

template<typename axiCfg >
typedef axi::axi4<axiCfg> SubordinateFromFile< axiCfg >::axi4_

Definition at line 51 of file SubordinateFromFile.h.

Constructor & Destructor Documentation

◆ SubordinateFromFile()

template<typename axiCfg >
SubordinateFromFile< axiCfg >::SubordinateFromFile ( sc_module_name  name_,
std::string  filename = "mem.csv" 
)
inline

Definition at line 75 of file SubordinateFromFile.h.

Member Function Documentation

◆ run_rd()

template<typename axiCfg >
void SubordinateFromFile< axiCfg >::run_rd ( )
inlineprotected

Definition at line 113 of file SubordinateFromFile.h.

◆ run_wr()

template<typename axiCfg >
void SubordinateFromFile< axiCfg >::run_wr ( )
inlineprotected

Definition at line 179 of file SubordinateFromFile.h.

Member Data Documentation

◆ kDebugLevel

template<typename axiCfg >
const int SubordinateFromFile< axiCfg >::kDebugLevel = 1
static

Definition at line 50 of file SubordinateFromFile.h.

◆ if_rd

template<typename axiCfg >
axi4_::read::template subordinate SubordinateFromFile< axiCfg >::if_rd

Definition at line 53 of file SubordinateFromFile.h.

◆ if_wr

template<typename axiCfg >
axi4_::write::template subordinate SubordinateFromFile< axiCfg >::if_wr

Definition at line 54 of file SubordinateFromFile.h.

◆ reset_bar

template<typename axiCfg >
sc_in<bool> SubordinateFromFile< axiCfg >::reset_bar

Definition at line 56 of file SubordinateFromFile.h.

◆ clk

template<typename axiCfg >
sc_in<bool> SubordinateFromFile< axiCfg >::clk

Definition at line 57 of file SubordinateFromFile.h.

◆ rd_resp

template<typename axiCfg >
std::queue<typename axi4_::ReadPayload> SubordinateFromFile< axiCfg >::rd_resp

Definition at line 59 of file SubordinateFromFile.h.

◆ rd_resp_addr

template<typename axiCfg >
std::queue<typename axi4_::Addr> SubordinateFromFile< axiCfg >::rd_resp_addr

Definition at line 60 of file SubordinateFromFile.h.

◆ wr_addr

template<typename axiCfg >
std::queue<typename axi4_::AddrPayload> SubordinateFromFile< axiCfg >::wr_addr

Definition at line 61 of file SubordinateFromFile.h.

◆ wr_data

template<typename axiCfg >
std::queue<typename axi4_::WritePayload> SubordinateFromFile< axiCfg >::wr_data

Definition at line 62 of file SubordinateFromFile.h.

◆ wr_resp

template<typename axiCfg >
std::queue<typename axi4_::WRespPayload> SubordinateFromFile< axiCfg >::wr_resp

Definition at line 63 of file SubordinateFromFile.h.

◆ localMem

template<typename axiCfg >
std::map<typename axi4_::Addr, typename axi4_::Data> SubordinateFromFile< axiCfg >::localMem

Definition at line 65 of file SubordinateFromFile.h.

◆ localMem_wstrb

template<typename axiCfg >
std::map<typename axi4_::Addr, NVUINT8> SubordinateFromFile< axiCfg >::localMem_wstrb

Definition at line 66 of file SubordinateFromFile.h.

◆ validReadAddresses

template<typename axiCfg >
std::vector<typename axi4_::Addr> SubordinateFromFile< axiCfg >::validReadAddresses

Definition at line 67 of file SubordinateFromFile.h.

◆ load_data_pld

template<typename axiCfg >
axi4_::WritePayload SubordinateFromFile< axiCfg >::load_data_pld

Definition at line 69 of file SubordinateFromFile.h.

◆ bytesPerBeat

template<typename axiCfg >
const int SubordinateFromFile< axiCfg >::bytesPerBeat = axi4_::DATA_WIDTH >> 3
static

Definition at line 71 of file SubordinateFromFile.h.


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