I3C 8 位地址存储器目标¶
PxI3C8BitAddressMemoryTarget 在 I3C 总线上模拟字节寻址存储器器件。控制器写入 8 位存储器索引后,即可读写数据字节,并自动递增。
功能¶
- 256 字节存储器映射,采用 8 位索引与自动递增。
- CCC 处理,包含地址分配、MRL/MWL、GETCAPS、GETSTATUS、GETMXDS 与组地址。
- 通过 CCC 启用时支持 IBI 与 Hot-Join。
- 通过
memory_target_read_event与memory_target_write_event提供 存储器事件。
PxI3C8BitAddressMemoryTarget
¶
PxI3C8BitAddressMemoryTarget(
exerciser: AqProtocolExerciser,
*args,
pid: int | None = None,
bcr: int = 0,
dcr: int = 0,
config: I3C8BitAddressMemoryTargetConfig | None = None,
static_addr: int = 0,
minimum_mrl: int | None = None,
minimum_mwl: int | None = None,
getcaps_std_value: bytes | None = None,
getcaps_usr_value: list[tuple[int, bytes]] | None = None,
getstatus_std_value: bytes | None = None,
getstatus_usr_value: list[tuple[int, bytes]] | None = None,
getmxds_std_value: bytes | None = None,
getmxds_usr_value: list[tuple[int, bytes]] | None = None,
supported_group_address_count: int = 3,
**kwargs
)
Bases: PxAbstractTarget
I3C byte-addressable memory target.
Emulates a 256-byte memory device on an I3C bus. Controllers access memory using a 7-bit device address plus an 8-bit sub-address (memory offset), then read or write data bytes with auto-increment.
Use read_mem and write_mem to access backing store from Python. Bus
reads and writes from a controller emit memory_target_read_event and
memory_target_write_event notifications. The target also supports standard
I3C CCC handling, IBI, and Hot-Join like other I3C targets.
| CLASS | DESCRIPTION |
|---|---|
IbiType |
IBI type enumeration. |
HotJoinType |
Hot-Join type enumeration. |
| METHOD | DESCRIPTION |
|---|---|
add_event_handler |
Add an event handler to the current device instance. |
remove_event_handler |
Remove an event handler. |
get_event_handlers |
Retreive handlers registerd on this device. |
on_event |
Add an event handler to the instance by decorator. |
set_config |
Set the config of the target. |
detach_from_bus |
Detach the device from the bus. |
perform_operation |
Send an operation. |
attach_to_bus |
Attach the target to a bus. |
ibi_request |
Initiate an IBI request from the current target. |
send_hotjoin |
Initiate a Hot-Join request from the current target. |
read_mem |
Read bytes from backing store via the Protocol Exerciser API. |
write_mem |
Write bytes to backing store via the Protocol Exerciser API. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
available_events_map |
A reverse mapping of |
is_attached |
Check if the device is attached to a bus.
TYPE:
|
state |
Get the state of the device.
TYPE:
|
name |
Get the name of the device.
TYPE:
|
additional_data |
Get the opaque additional data blob associated with this device.
TYPE:
|
config |
Get the config of the device.
TYPE:
|
cts_op_name |
Get the name of CTS operation. Currently not available now.
TYPE:
|
static_address |
Static address of the I3C memory target.
TYPE:
|
assigned_address |
Get the assigned address of the target.
TYPE:
|
event_state |
Get the event state of the target.
TYPE:
|
group_addresses |
Get the group addresses assigned to the target. |
mrl |
Get the maximum read length of the target.
TYPE:
|
mwl |
Get the maximum write length of the target.
TYPE:
|
available_events_map
¶
A reverse mapping of field_name_by_number, which uses field name as key.
additional_data
¶
additional_data: bytes
Get the opaque additional data blob associated with this device.
add_event_handler
¶
Add an event handler to the current device instance.
get_event_handlers
¶
Retreive handlers registerd on this device.
on_event
¶
Add an event handler to the instance by decorator.
detach_from_bus
¶
Detach the device from the bus.
The opposite of the attach_to_bus method.
perform_operation
¶
Send an operation.
attach_to_bus
¶
attach_to_bus(bus: PxAbstractBus) -> None
Attach the target to a bus.
This method is used to make the device aware of the bus it is connected to. It is used to set the bus attribute of the device.
Note
This method will not automatically create an actual instance on
the Protocol Exerciser until user call the attach_to_bus method.
| PARAMETER | DESCRIPTION |
|---|---|
|
The bus to attach the device to
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the device is already attached to a bus |
ibi_request
¶
ibi_request(
ibi_type: IbiType = IMMEDIATE,
mdb_value: bytes = b"",
additional_data: bytes = b"",
skip_bcr_check: bool = False,
) -> None
Initiate an IBI request from the current target.
send_hotjoin
¶
send_hotjoin(hotjoin_type: HotJoinType = IMMEDIATE) -> None
Initiate a Hot-Join request from the current target.
read_mem
¶
Read bytes from backing store via the Protocol Exerciser API.