winIDEA SDK
Loading...
Searching...
No Matches
isys::CSoCCtrl Class Reference

Description

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.

#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.
 

Member Enumeration Documentation

◆ EAccessBatchResult

Enum to specify batch access result.

Enumerator
OK 

Batch access was successful.

Fail 

Batch access failed.

Timeout 

One of the poll items in access batch failed.

Abort 

Batch access was aborted.

BadParam 

Specified parameters are incorrect, e.g. in test Data and TestMask must be of identical size.

Constructor & Destructor Documentation

◆ CSoCCtrl()

isys::CSoCCtrl::CSoCCtrl ( SPConnectionMgr spConnectionMgr,
SPSessionCtrl spSessionCtrl,
const SHSC & rHSC,
const std::string & rstrSoC )

Constructor for CSoCCtrl.

Parameters
spConnectionMgrShared pointer to the connection manager.
spSessionCtrlShared pointer to the session controller.
rHSCReference to a HSC struct.
rstrSoCName of the SoC.

Member Function Documentation

◆ access_batch()

EAccessBatchResult isys::CSoCCtrl::access_batch ( CAccessBatch & rAccessBatch)

Performs a batch memory access operation.

Parameters
rAccessBatchReference 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.
Returns
EAccessBatchResult Result of the access batch operation.
Exceptions
TExceptionif the operation fails.

Python example: test_soc_ctrl_bus_access_batch.py

result = soc.access_batch(access_batch)

◆ attach()

void isys::CSoCCtrl::attach ( )

Attaches to the specified SoC.

This call is only valid within an active session.

Exceptions
TExceptionif 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()

◆ bus_fill()

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.

Parameters
nBusIndexIndex of the bus to use.
nAddressAddress to start writing the pattern.
nNumMAUsNumber of Memory Access Units (MAUs) to write.
rvPatternPattern to fill the memory with. If shorter than nNumMAUs, the pattern repeats.
Exceptions
TExceptionif 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]

◆ bus_read()

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.

Parameters
nBusIndexIndex of the bus to use.
nAddressAddress to read from.
nNumMAUsNumber of MAUs to read.
pvAccessOptional access information returned for each location accessed.
Returns
std::vector<uint8_t> Data read from memory.
Exceptions
TExceptionif 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]

◆ bus_write()

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.

Parameters
nBusIndexIndex of the bus to use.
nAddressAddress to write the data to.
rvDataData to write.
pvAccessOptional access information returned for each location accessed.
Exceptions
TExceptionif 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]

◆ detach()

void isys::CSoCCtrl::detach ( )

Detaches from the specified SoC.

This call is only valid within an active session.

Exceptions
TExceptionif 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()

◆ get_core()

SPCoreCtrl isys::CSoCCtrl::get_core ( uint32_t dwCoreIndex)

Retrieves a shared pointer for a specific core control on the SoC.

Parameters
dwCoreIndexIndex of the core to be retrieved.
Returns
SPCoreCtrl Core control shared pointer.

◆ SMP_get_focused_core()

uint32_t isys::CSoCCtrl::SMP_get_focused_core ( uint32_t dwCoreIndex)

Retrieves the currently focused core index in an SMP process.

Parameters
dwCoreIndexIdentifies the SMP binding
Returns
uint32_t Index of the focused core in the current process's SMP binding
Exceptions
TExceptionif 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

◆ SMP_set_focused_core()

void isys::CSoCCtrl::SMP_set_focused_core ( uint32_t dwCoreIndex)

Sets the focused core in an SMP process.

Parameters
dwCoreIndexIndex of the core to set focus on
Exceptions
TExceptionIf 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)