This class provides control and interaction with a System on Chip (SoC) during a debug session. More...
#include <CSessionCtrl.h>
Public Types | |
enum | EAccessBatchResult { OK , Fail , Timeout , Abort , BadParam } |
Enum to specify batch access result. More... |
Public Member Functions | |
EAccessBatchResult | access_batch (CAccessBatch &rAccessBatch) |
Performs a batch memory access operation. | |
void | attach () |
Attaches to the specified SoC. | |
void | bus_fill (uint8_t nBusIndex, uint64_t nAddress, uint64_t nNumMAUs, const std::vector< uint8_t > &rvPattern) |
Fills a memory region with a specified pattern via the specified bus. | |
std::vector< uint8_t > | bus_read (uint8_t nBusIndex, uint64_t nAddress, uint64_t nNumMAUs, std::vector< uint8_t > *pvAccess=nullptr) |
Reads data from memory via the specified bus. | |
void | bus_write (uint8_t nBusIndex, uint64_t nAddress, const std::vector< uint8_t > &rvData, std::vector< uint8_t > *pvAccess=nullptr) |
Writes data to memory via the specified bus. | |
CSoCCtrl (SPConnectionMgr spConnectionMgr, SPSessionCtrl spSessionCtrl, const SHSC &rHSC, const std::string &rstrSoC) | |
Constructor for CSoCCtrl. | |
void | detach () |
Detaches from the specified SoC. | |
SPCoreCtrl | get_core (uint32_t dwCoreIndex) |
Retrieves a shared pointer for a specific core control on the SoC. | |
uint32_t | SMP_get_focused_core (uint32_t dwCoreIndex) |
Retrieves the currently focused core index in an SMP process. | |
void | SMP_set_focused_core (uint32_t dwCoreIndex) |
Sets the focused core in an SMP process. |
This class provides control and interaction with a System on Chip (SoC) during a debug session.
It offers functionality to focus on cores, perform memory operations, and handle various bus-related tasks on the SoC.
isys::CSoCCtrl::CSoCCtrl | ( | SPConnectionMgr | spConnectionMgr, |
SPSessionCtrl | spSessionCtrl, | ||
const SHSC & | rHSC, | ||
const std::string & | rstrSoC ) |
Constructor for CSoCCtrl.
spConnectionMgr | Shared pointer to the connection manager. |
spSessionCtrl | Shared pointer to the session controller. |
rHSC | Reference to a HSC struct. |
rstrSoC | Name of the SoC. |
EAccessBatchResult isys::CSoCCtrl::access_batch | ( | CAccessBatch & | rAccessBatch | ) |
Performs a batch memory access operation.
rAccessBatch | Reference to access batch structure containing the details of the batch operation. The data can be received by calling CAccessBatch::item(...) and reading from it's data member. |
TException | if the operation fails. |
Python example: test_soc_ctrl_bus_access_batch.py
void isys::CSoCCtrl::attach | ( | ) |
Attaches to the specified SoC.
This call is only valid within an active session.
TException | if the operation fails. |
Python example: test_soc_ctrl_attach.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> soc.attach()
void isys::CSoCCtrl::bus_fill | ( | uint8_t | nBusIndex, |
uint64_t | nAddress, | ||
uint64_t | nNumMAUs, | ||
const std::vector< uint8_t > & | rvPattern ) |
Fills a memory region with a specified pattern via the specified bus.
nBusIndex | Index of the bus to use. |
nAddress | Address to start writing the pattern. |
nNumMAUs | Number of Memory Access Units (MAUs) to write. |
rvPattern | Pattern to fill the memory with. If shorter than nNumMAUs, the pattern repeats. |
TException | if the operation fails. |
Python example: test_soc_ctrl_bus_fill.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> vect = ic.VectorBYTE([1, 2, 3, 4]) >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> soc.bus_fill(0, 0x20000000, 4, vect) >>> vect_read = soc.bus_read(0, 0x20000000, 4) >>> [e for e in vect_read] [1, 2, 3, 4]
std::vector< uint8_t > isys::CSoCCtrl::bus_read | ( | uint8_t | nBusIndex, |
uint64_t | nAddress, | ||
uint64_t | nNumMAUs, | ||
std::vector< uint8_t > * | pvAccess = nullptr ) |
Reads data from memory via the specified bus.
nBusIndex | Index of the bus to use. |
nAddress | Address to read from. |
nNumMAUs | Number of MAUs to read. |
pvAccess | Optional access information returned for each location accessed. |
TException | if the operation fails. |
Python example: test_soc_ctrl_bus_read.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> vect = ic.VectorBYTE([8, 7, 6, 5]) >>> soc.bus_write(0, 0x20000000, vect) >>> vect_read = soc.bus_read(0, 0x20000000, 4) >>> [e for e in vect_read] [8, 7, 6, 5]
void isys::CSoCCtrl::bus_write | ( | uint8_t | nBusIndex, |
uint64_t | nAddress, | ||
const std::vector< uint8_t > & | rvData, | ||
std::vector< uint8_t > * | pvAccess = nullptr ) |
Writes data to memory via the specified bus.
nBusIndex | Index of the bus to use. |
nAddress | Address to write the data to. |
rvData | Data to write. |
pvAccess | Optional access information returned for each location accessed. |
TException | if the operation fails. |
Python example: test_soc_ctrl_bus_write.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> vect = ic.VectorBYTE([8, 7, 6, 5]) >>> soc.bus_write(0, 0x20000000, vect) >>> vect_read = soc.bus_read(0, 0x20000000, 4) >>> [e for e in vect_read] [8, 7, 6, 5]
void isys::CSoCCtrl::detach | ( | ) |
Detaches from the specified SoC.
This call is only valid within an active session.
TException | if the operation fails. |
Python example: test_soc_ctrl_detach.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> soc.attach() >>> soc.detach()
SPCoreCtrl isys::CSoCCtrl::get_core | ( | uint32_t | dwCoreIndex | ) |
Retrieves a shared pointer for a specific core control on the SoC.
dwCoreIndex | Index of the core to be retrieved. |
uint32_t isys::CSoCCtrl::SMP_get_focused_core | ( | uint32_t | dwCoreIndex | ) |
Retrieves the currently focused core index in an SMP process.
dwCoreIndex | Identifies the SMP binding |
TException | if the operation fails |
Python example: test_soc_ctrl_smp_get_focused_core.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> soc.SMP_get_focused_core(0) 0
void isys::CSoCCtrl::SMP_set_focused_core | ( | uint32_t | dwCoreIndex | ) |
Sets the focused core in an SMP process.
dwCoreIndex | Index of the core to set focus on |
TException | If the operation fails or dwCoreIndex is not in the current process's SMP binding. |
Python example: test_soc_ctrl_smp_set_focused_core.py
>>> conn_mgr = ic.ConnectionMgr() >>> conn_mgr.connect() >>> sess_ctrl = ic.CSessionCtrl(conn_mgr) >>> sess_ctrl.begin_reset() >>> soc = sess_ctrl.get_SoC('') >>> focused_core = soc.SMP_get_focused_core(0) >>> focused_core 0 >>> soc.SMP_set_focused_core(focused_core)