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

Description

Provides control functions for interacting with a specific core during a debug session.

This class allows users to perform various operations on individual cores, such as memory manipulation and core observation. It is typically used within the context of an active debug session and provides high-level access to core-specific functionality.

#include <CSessionCtrl.h>

Public Member Functions

 CCoreCtrl (SPConnectionMgr spConnectionMgr, const SHSC &rHSC)
 Constructs a CCoreCtrl instance for controlling a core in a debug session.
 
void memory_fill (uint8_t nMemoryArea, uint64_t nAddress, uint64_t nNumMAUs, const std::vector< uint8_t > &rvPattern)
 Fills a specified memory area with a repeating pattern.
 
std::vector< uint8_t > memory_read (uint8_t nMemoryArea, uint64_t nAddress, uint64_t nNumMAUs, std::vector< uint8_t > *pvAccess=nullptr)
 Reads data from a specified memory area.
 
void memory_write (uint8_t nMemoryArea, uint64_t nAddress, const std::vector< uint8_t > &rvData, std::vector< uint8_t > *pvAccess=nullptr)
 Writes data to a specified memory area.
 
void observe (bool bObserve)
 Enables or disables core observation within an active debug session.
 

Constructor & Destructor Documentation

◆ CCoreCtrl()

isys::CCoreCtrl::CCoreCtrl ( SPConnectionMgr spConnectionMgr,
const SHSC & rHSC )

Constructs a CCoreCtrl instance for controlling a core in a debug session.

Initializes core control by associating it with a connection manager and Struct Hardware(BlueBox)-SoC-Core index (SHSC). This object allows memory operations and core observation during debugging.

Parameters
spConnectionMgrShared pointer to the connection manager
rHSCReference to the SHSC

Member Function Documentation

◆ memory_fill()

void isys::CCoreCtrl::memory_fill ( uint8_t nMemoryArea,
uint64_t nAddress,
uint64_t nNumMAUs,
const std::vector< uint8_t > & rvPattern )

Fills a specified memory area with a repeating pattern.

This method fills a memory region starting from the given address with a pattern of bytes. If the pattern is shorter than the specified number of memory access units (MAUs), it will be repeated to fill the entire region.

Parameters
nMemoryAreaIndex of the memory area to use.
nAddressAddress at which to begin the memory fill operation.
nNumMAUsNumber of memory access units to fill.
rvPatternThe byte pattern to write into the memory. If shorter than nNumMAUs, it is repeated.
Exceptions
TExceptionif the operation fails.

Python example: test_memory_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('')
>>> core_ctrl = soc.get_core(0)
>>> core_ctrl.memory_fill(0, 0x200000A0, 4, vect)
>>> vect = core_ctrl.memory_read(0, 0x200000A0, 4)
>>> [e for e in vect]
[1, 2, 3, 4]

◆ memory_read()

std::vector< uint8_t > isys::CCoreCtrl::memory_read ( uint8_t nMemoryArea,
uint64_t nAddress,
uint64_t nNumMAUs,
std::vector< uint8_t > * pvAccess = nullptr )

Reads data from a specified memory area.

Reads a sequence of bytes from the memory starting at the specified address. Optionally, access information can be returned for each accessed location.

Parameters
nMemoryAreaIndex of the memory area to use.
nAddressAddress from which to begin reading data.
nNumMAUsNumber of memory access units to read.
pvAccess(Optional) Pointer to a vector where access information for each accessed location is returned.
Returns
std::vector<uint8_t> A vector containing the data read from memory.
Exceptions
TExceptionif the operation fails.

Python example: test_memory_read.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('')
>>> core_ctrl = soc.get_core(0)
>>> core_ctrl.memory_fill(0, 0x200000A0, 4, vect)
>>> vect = core_ctrl.memory_read(0, 0x200000A0, 4)
>>> [e for e in vect]
[1, 2, 3, 4]

◆ memory_write()

void isys::CCoreCtrl::memory_write ( uint8_t nMemoryArea,
uint64_t nAddress,
const std::vector< uint8_t > & rvData,
std::vector< uint8_t > * pvAccess = nullptr )

Writes data to a specified memory area.

Writes a sequence of bytes into the memory starting at the given address. Optionally, access information can be provided for each accessed location.

Parameters
nMemoryAreaIndex of the memory area to use.
nAddressAddress at which to begin writing data.
rvDataThe data to write to the memory.
pvAccess(Optional) Pointer to a vector where access information for each accessed location is returned.
Exceptions
TExceptionif the operation fails.

Python example: test_memory_write.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('')
>>> core_ctrl = soc.get_core(0)
>>> core_ctrl.memory_write(0, 0x200000A0, vect)
>>> vect = core_ctrl.memory_read(0, 0x200000A0, 4)
>>> [e for e in vect]
[1, 2, 3, 4]

◆ observe()

void isys::CCoreCtrl::observe ( bool bObserve)

Enables or disables core observation within an active debug session.

This operation is only valid while a session is active (e.g., after calling begin_reset()).

Parameters
bObserveSet to true to enable core observation, or false to disable it.
Exceptions
TExceptionif the operation fails.

Python example: test_observe.py

>>> conn_mgr = ic.ConnectionMgr()
>>> conn_mgr.connect()
>>> sess_ctrl = ic.CSessionCtrl(conn_mgr)
>>> sess_ctrl.begin_reset()
>>> soc = sess_ctrl.get_SoC('')
>>> core_ctrl = soc.get_core(0)
>>> core_ctrl.observe(True)