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

Description

Holds a batch of access operations including read, write, fill, and test.

Main benefits are that sequence is executed faster and can be saved for later to repeat it.

The CAccessBatch class:

  • Only holds data to perform accesses and access results. To actually execute queued accesses use CSoCCtrl.access_batch().
  • Provides methods to queue batch operations on a memory address or code store.
  • Provides method to queue FNet trigger generation (FTrig).
  • Allows retrieval of individual access batch items by handle.

This method allows user to queue multiple operations and execute them at once, as opposed to calling each action separately in user script. This saves time and number of communication cycles:

  1. Between user script and SDK.
  2. Between SDK and winIDEA.
  3. In case of using BlueBox debuggers, between winIDEA and BlueBox.

Python example: test_soc_ctrl_bus_access_batch.py

#include <CSessionCtrl.h>

Public Member Functions

uint32_t fill (ADDRESS_64 offset, ADDRESS_64 num_MAUs, const std::vector< uint8_t > &data)
 Add fill operation to access batch queue, use destination relative to the address set in base() call.
 
uint32_t fill_a (const SAddressInfo &address_info, ADDRESS_64 num_MAUs, const std::vector< uint8_t > &data)
 Add fill operation to access batch queue, use destination provided in address_info parameter.
 
uint32_t ftrig (uint8_t n_trig)
 Add FNet trigger generation to access batch queue.
 
SPAccessBatchItem item (uint32_t handle)
 Retrieves an access batch item by handle.
 
uint32_t poll (ADDRESS_64 offset, const std::vector< uint8_t > &data, const std::vector< uint8_t > &mask, uint32_t timeout_us)
 Add poll operation to access batch queue, use destination relative to the address set in base() call.
 
uint32_t poll_a (const SAddressInfo &address_info, const std::vector< uint8_t > &data, const std::vector< uint8_t > &mask, uint32_t timeout_us)
 Add poll operation to access batch queue, use destination provided in address_info parameter.
 
uint32_t read (ADDRESS_64 offset, ADDRESS_64 num_MAUs)
 Add read operation to access batch queue, use destination relative to the address set in base() call.
 
uint32_t read_a (const SAddressInfo &address_info, ADDRESS_64 num_MAUs)
 Add read operation to access batch queue, use destination provided in address_info parameter.
 
void set_base (const SAddressInfo &address_info)
 Set base address for batch access entries added after this call.
 
uint32_t write (ADDRESS_64 offset, const std::vector< uint8_t > &data)
 Add write operation to access batch queue, use destination relative to the address set in base() call.
 
uint32_t write_a (const SAddressInfo &address_info, const std::vector< uint8_t > &data)
 Add write operation to access batch queue, use destination provided in address_info parameter.
 
uint32_t write_CS_a (const SAddressInfo &address_info, SPCodeStore code_store)
 Add write operation, of data stored in code store, to access batch queue.
 

Member Function Documentation

◆ fill()

uint32_t isys::CAccessBatch::fill ( ADDRESS_64 offset,
ADDRESS_64 num_MAUs,
const std::vector< uint8_t > & data )

Add fill operation to access batch queue, use destination relative to the address set in base() call.

Parameters
offsetOffset to be added to base address for this operation.
num_MAUsNumber of memory access units to fill.
dataData to be used for filling.
Exceptions
TExceptionIf operation could not be added (e.g. base address info is not set).
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

data = ic.ByteVector([0xCC]) # Data used for filling
handle_fill = access_batch.fill(offset=0x04, # Add fill on offset 0x4 from base_ai with size 0x100 to queue
num_MAUs=0x100,
data=data)

◆ fill_a()

uint32_t isys::CAccessBatch::fill_a ( const SAddressInfo & address_info,
ADDRESS_64 num_MAUs,
const std::vector< uint8_t > & data )

Add fill operation to access batch queue, use destination provided in address_info parameter.

Parameters
address_infoAddress info structure describing access destination (see SAddressInfo).
num_MAUsNumber of memory access units to fill.
dataData to be used for filling.
Exceptions
TExceptionIf operation could not be added.
Returns
uint32_t Handle identifying the access batch item

Python example (test_soc_ctrl_bus_access_batch.py):

custom_ai = ic.SAddressInfo()
custom_ai.dest_bus(bus_index=0) # Destination is bus at index 0
custom_ai.address(address=0x80000004) # Address is 0x8000'0004
handle_fill_a = access_batch.fill_a(address_info=custom_ai, # Add test on offset 0x4 from base_ai with
num_MAUs=0x100, # with size 0x100 to queue
data=data)

◆ ftrig()

uint32_t isys::CAccessBatch::ftrig ( uint8_t n_trig)

Add FNet trigger generation to access batch queue.

More information on FNet triggers can be found in winIDEA help: FNet Communication Network / Overview / FNet Triggers and Actions

Parameters
n_trigIndex of FNet trigger to generate.
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

handle_ftrig = access_batch.ftrig(n_trig=5) # Add generating of FNet trigger #5 to queue

◆ item()

SPAccessBatchItem isys::CAccessBatch::item ( uint32_t handle)

Retrieves an access batch item by handle.

Access batch item structure holds

Parameters
handleHandle identifying the access batch item.
Returns
Shared pointer to the SAccessBatchItem associated with the handle.

Python example (test_soc_ctrl_bus_access_batch.py):

item = access_batch.item(handle_write) # Retrieve item by handle
print('Time: ' + str(item.time_us)) # Print out item timestamp in us

◆ poll()

uint32_t isys::CAccessBatch::poll ( ADDRESS_64 offset,
const std::vector< uint8_t > & data,
const std::vector< uint8_t > & mask,
uint32_t timeout_us )

Add poll operation to access batch queue, use destination relative to the address set in base() call.

Parameters
offsetOffset to be added to base address for this operation.
dataData to be compared.
maskMask used for comparison.
timeout_usTimeout duration in microseconds.
Exceptions
TExceptionIf operation could not be added (e.g. base address info is not set).
Returns
uint32_t Handle identifying the access batch item

Python example (test_soc_ctrl_bus_access_batch.py):

data = ic.ByteVector([0x10, 0x22, 0x33, 0xAB]) # Data to be compared
mask = ic.ByteVector([0xFF, 0xF0, 0xFF, 0xFC]) # Mask to be applied when comparing data
handle_poll = access_batch.poll(offset=0x04, # Add test on offset 0x4 from base_ai with timeout 100 us to queue
data=data,
mask=mask,
timeout_us=100)

◆ poll_a()

uint32_t isys::CAccessBatch::poll_a ( const SAddressInfo & address_info,
const std::vector< uint8_t > & data,
const std::vector< uint8_t > & mask,
uint32_t timeout_us )

Add poll operation to access batch queue, use destination provided in address_info parameter.

Parameters
address_infoAddress info structure describing access destination (see SAddressInfo).
dataData to be compared.
maskMask used for comparison.
timeout_usTimeout duration in microseconds.
Exceptions
TExceptionIf operation could not be added.
Returns
uint32_t Handle identifying the access batch item

Python example (test_soc_ctrl_bus_access_batch.py):

custom_ai = ic.SAddressInfo()
custom_ai.dest_bus(bus_index=0) # Destination is bus at index 0
custom_ai.address(address=0x80000004) # Address is 0x8000'0004
data = ic.ByteVector([0x10, 0x22, 0x33, 0xAB]) # Data to be compared
mask = ic.ByteVector([0xFF, 0xF0, 0xFF, 0xFC]) # Mask to be applied when comparing data
handle_poll_a = access_batch.poll_a(address_info=custom_ai, # Add test on offset 0x4 from base_ai with
data=data, # timeout 100 us to queue
mask=mask,
timeout_us=100)

◆ read()

uint32_t isys::CAccessBatch::read ( ADDRESS_64 offset,
ADDRESS_64 num_MAUs )

Add read operation to access batch queue, use destination relative to the address set in base() call.

Parameters
offsetOffset to be added to base address for this operation.
num_MAUsNumber of memory access units to read.
Exceptions
TExceptionIf operation could not be added (e.g. base address info is not set).
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

handle_read = access_batch.read(offset=0x04, num_MAUs=4) # Add read from offset 0x4 from base_ai to queue

◆ read_a()

uint32_t isys::CAccessBatch::read_a ( const SAddressInfo & address_info,
ADDRESS_64 num_MAUs )

Add read operation to access batch queue, use destination provided in address_info parameter.

Parameters
address_infoAddress info structure describing access destination (see SAddressInfo).
num_MAUsNumber of memory access units to read.
Exceptions
TExceptionIf operation could not be added.
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

custom_ai = ic.SAddressInfo()
custom_ai.dest_bus(bus_index=0) # Destination is bus at index 0
custom_ai.address(address=0x80000004) # Address is 0x8000'0004
handle_read_a = access_batch.read_a(address_info=custom_ai, num_MAUs=4) # Add read from address 0x8000'0004 to queue

◆ set_base()

void isys::CAccessBatch::set_base ( const SAddressInfo & address_info)

Set base address for batch access entries added after this call.

Parameters
address_infoAddress info structure describing base (see SAddressInfo).

Python example (test_soc_ctrl_bus_access_batch.py):

base_ai = ic.SAddressInfo()
base_ai.dest_bus(bus_index=0) # Destination is bus at index 0
base_ai.address(address=0xE0000000) # Base address is 0xE000'0000
access_batch.set_base(base_ai) # Set base address info for future accesses

◆ write()

uint32_t isys::CAccessBatch::write ( ADDRESS_64 offset,
const std::vector< uint8_t > & data )

Add write operation to access batch queue, use destination relative to the address set in base() call.

Parameters
offsetOffset to be added to base address for this operation.
dataData to be written.
Exceptions
TExceptionIf operation could not be added (e.g. base address info is not set).
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

write_data = ic.ByteVector([1, 2, 3, 4])
handle_write = access_batch.write(offset=0x04, data=write_data) # Add write to offset 0x4 from base_ai to queue

◆ write_a()

uint32_t isys::CAccessBatch::write_a ( const SAddressInfo & address_info,
const std::vector< uint8_t > & data )

Add write operation to access batch queue, use destination provided in address_info parameter.

Parameters
address_infoAddress info structure describing access destination (see SAddressInfo).
dataData to be written.
Exceptions
TExceptionIf operation could not be added.
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

custom_ai = ic.SAddressInfo()
custom_ai.dest_bus(bus_index=0) # Destination is bus at index 0
custom_ai.address(address=0x80000004) # Address is 0x8000'0004
write_data = ic.ByteVector([1, 2, 3, 4])
# Add write to address 0x8000'0004 to queue
handle_write_a = access_batch.write_a(address_info=custom_ai, data=write_data)

◆ write_CS_a()

uint32_t isys::CAccessBatch::write_CS_a ( const SAddressInfo & address_info,
SPCodeStore code_store )

Add write operation, of data stored in code store, to access batch queue.

Use destination provided in address_info parameter.

Parameters
address_infoAddress info structure describing access destination (see SAddressInfo).
code_storeShared pointer to the code store.
Exceptions
TExceptionIf operation could not be added.
Returns
uint32_t Handle identifying the access batch item.

Python example (test_soc_ctrl_bus_access_batch.py):

cs_ai = ic.SAddressInfo()
cs_ai.dest_bus(bus_index=0) # Destination is bus at index 0
cs_ai.address(address=0x80000004) # Address is 0x8000'0004
code_store = ic.CCodeStore(conn_mgr)
code_store.insert(0x000, ic.ByteVector([0x01, 0x02, 0x03, 0x04])) # Write 4 bytes at offset 0x000
code_store.insert(0x100, ic.ByteVector([0x7E, 0x57, 0xDA, 0x7A])) # Write 4 bytes at offset 0x100
# Add write to address 0x8000'0004 to queue
handle_write_cs_a = access_batch.write_CS_a(address_info=cs_ai,
code_store=code_store)