Base class for frontend devices, providing common functionality.
More...
#include <FrontEndBase.h>
|
| | FrontEndBase (RMMAPI *pRmmAPI, int ring, int node, FENRegMap addrMap, std::string name, int lockTime=RMMRings::FE_DEFAULT_LOCK_TIME) |
| | Constructor of the FrontEndBase class.
|
| |
| RMMResult | userRegRead (const std::string &name) override |
| | Reads data from a register in the Front End.
|
| |
| RMMResult | userRegRead (uint32_t addr) override |
| | Reads data from a register in the Front End.
|
| |
| RMMResult | userRegWrite (const std::string &name, uint32_t data) override |
| | Writes data to a register in the Front End.
|
| |
| RMMResult | userRegWrite (uint32_t addr, uint32_t data) override |
| | Writes data to a register in the Front End.
|
| |
| RMMResult | userFieldRead (const std::string ®, int bit_begin, int bit_width) override |
| | Reads a field from a frontend user space register.
|
| |
| RMMResult | userFieldRead (uint32_t addr, int bit_begin, int bit_width) override |
| | Reads a field from a frontend user space register.
|
| |
| RMMResult | userFieldWrite (const std::string ®, int bit_begin, int bit_width, uint32_t data) override |
| | Writes to a field in a frontend user space register.
|
| |
| RMMResult | userFieldWrite (uint32_t addr, int bit_begin, int bit_width, uint32_t data) override |
| | Writes to a field in a frontend user space register.
|
| |
|
int | getLockTime () const |
| |
|
FENRegMap & | getAddrMap () |
| | Returns the FEN's address map.
|
| |
| int | getRing () const |
| | Gets the ring index.
|
| |
| int | getNode () const |
| | Gets the node index.
|
| |
| rmmStatus | setLogMask (int mask) |
| | set rmmLog log mask
|
| |
| std::string | getFeType () |
| | Retrieves the front-end firmware type as an ASCII string.
|
| |
| virtual void | configFE ()=0 |
| | Configures the frontend.
|
| |
Base class for frontend devices, providing common functionality.
This class implements the FrontEndInterface and provides methods for reading and writing registers.
◆ FrontEndBase()
| FrontEndBase::FrontEndBase |
( |
RMMAPI * | pRmmAPI, |
|
|
int | ring, |
|
|
int | node, |
|
|
FENRegMap | addrMap, |
|
|
std::string | name, |
|
|
int | lockTime = RMMRings::FE_DEFAULT_LOCK_TIME ) |
Constructor of the FrontEndBase class.
- Parameters
-
| [in] | pRmmAPI | Pointer to the RMM API instance. |
| [in] | ring | The ring ID where the frontend is located. |
| [in] | node | The node ID within the ring. |
| [in] | addrMap | Register address map for the FEN. |
| [in] | lockTime | Time that FEN takes to Lock. |
| [in] | name | The name of the frontend device. |
◆ getFeType()
| std::string FrontEndBase::getFeType |
( |
| ) |
|
Retrieves the front-end firmware type as an ASCII string.
This function reads the front-end firmware type from two user-defined registers, TYPE1_USR and TYPE2_USR, using little-endian byte order. It combines the two 32-bit values into a single 64-bit value and decodes it into an 8-character ASCII string.
If either register read fails, an error is logged and the string "Undefined" is returned.
- Returns
- A string representing the firmware type (8 ASCII characters), or "Undefined" if register access fails.
◆ getNode()
| int FrontEndBase::getNode |
( |
| ) |
const |
|
inline |
Gets the node index.
- Returns
- The node index as an integer.
◆ getRing()
| int FrontEndBase::getRing |
( |
| ) |
const |
|
inline |
Gets the ring index.
- Returns
- The ring index as an integer.
◆ setLogMask()
| rmmStatus FrontEndBase::setLogMask |
( |
int | mask | ) |
|
set rmmLog log mask
- Parameters
-
- Returns
- rmmStatus. Success or Error if fail.
◆ userFieldRead() [1/2]
| RMMResult FrontEndBase::userFieldRead |
( |
const std::string & | reg, |
|
|
int | bit_begin, |
|
|
int | bit_width ) |
|
overridevirtual |
Reads a field from a frontend user space register.
- Parameters
-
| [in] | reg | The name of the register to read from. |
| [in] | bit_begin | The index of the lowest bit in the register that is part of the field. |
| [in] | bit_width | The width of the field in bits. |
- Returns
- RMMResult (Data field read and status).
- Exceptions
-
| std::invalid_argument | If the field is larger than 32 bits, the sum of bit_begin and bit_width exceeds 32 bits, or if bit_width is 0. |
Implements FrontEndInterface.
◆ userFieldRead() [2/2]
| RMMResult FrontEndBase::userFieldRead |
( |
uint32_t | addr, |
|
|
int | bit_begin, |
|
|
int | bit_width ) |
|
overridevirtual |
Reads a field from a frontend user space register.
- Parameters
-
| [in] | addr | The addr of the register to read from. |
| [in] | bit_begin | The index of the lowest bit in the register that is part of the field. |
| [in] | bit_width | The width of the field in bits. |
- Returns
- RMMResult (Data field read and status).
- Exceptions
-
| std::invalid_argument | If the field is larger than 32 bits, the sum of bit_begin and bit_width exceeds 32 bits, or if bit_width is 0. |
Implements FrontEndInterface.
◆ userFieldWrite() [1/2]
| RMMResult FrontEndBase::userFieldWrite |
( |
const std::string & | reg, |
|
|
int | bit_begin, |
|
|
int | bit_width, |
|
|
uint32_t | data ) |
|
overridevirtual |
Writes to a field in a frontend user space register.
- Parameters
-
| [in] | reg | The name of the register to read from. |
| [in] | bit_begin | The index of the lowest bit in the register that is part of the field. |
| [in] | bit_width | The width of the field in bits. |
| [in] | data | Data to write |
- Returns
- RMMResult data recorded in the field register after the write operation and the status.
- Exceptions
-
| std::invalid_argument | If the field is larger than 32 bits, the sum of bit_begin and bit_width exceeds 32 bits, or if bit_width is 0. |
Implements FrontEndInterface.
◆ userFieldWrite() [2/2]
| RMMResult FrontEndBase::userFieldWrite |
( |
uint32_t | addr, |
|
|
int | bit_begin, |
|
|
int | bit_width, |
|
|
uint32_t | data ) |
|
overridevirtual |
Writes to a field in a frontend user space register.
- Parameters
-
| [in] | addr | The addr of the register to read from. |
| [in] | bit_begin | The index of the lowest bit in the register that is part of the field. |
| [in] | bit_width | The width of the field in bits. |
| [in] | data | Data to write |
- Returns
- RMMResult data recorded in the field register after the write operation and the status.
- Exceptions
-
| std::invalid_argument | If the field is larger than 32 bits, the sum of bit_begin and bit_width exceeds 32 bits, or if bit_width is 0. |
Implements FrontEndInterface.
◆ userRegRead() [1/2]
| RMMResult FrontEndBase::userRegRead |
( |
const std::string & | name | ) |
|
|
overridevirtual |
Reads data from a register in the Front End.
- Parameters
-
| [in] | name | The name of the register to read data from. |
- Returns
- RMMResult (Data read and status)
Implements FrontEndInterface.
◆ userRegRead() [2/2]
| RMMResult FrontEndBase::userRegRead |
( |
uint32_t | addr | ) |
|
|
overridevirtual |
Reads data from a register in the Front End.
- Parameters
-
| [in] | addr | The addr base of the register to read data from. |
- Returns
- RMMResult (Data read and status)
Implements FrontEndInterface.
◆ userRegWrite() [1/2]
| RMMResult FrontEndBase::userRegWrite |
( |
const std::string & | name, |
|
|
uint32_t | data ) |
|
overridevirtual |
Writes data to a register in the Front End.
- Parameters
-
| [in] | name | The name of the register to write data to. |
| [in] | data | The data to be written to the register. |
- Returns
- RMMResult data recorded in the register after the write operation and the status.
Implements FrontEndInterface.
◆ userRegWrite() [2/2]
| RMMResult FrontEndBase::userRegWrite |
( |
uint32_t | addr, |
|
|
uint32_t | data ) |
|
overridevirtual |
Writes data to a register in the Front End.
- Parameters
-
| [in] | addr | The addr base of the register to write data to. |
| [in] | data | The data to be written to the register. |
- Returns
- RMMResult data recorded in the register after the write operation and the status.
Implements FrontEndInterface.
The documentation for this class was generated from the following files: