Note: this interface is internal and may change without notice.
This interface is used to register callbacks to instrument transactions issued through a map target by the SIM_issue_transaction API call. This includes all memory_space objects handling transactions. The interface is only implemented by the sim.transactions object which serves all transactions.
The register_issue_cb method registers a callback that is
called whan a transaction is passed to a map target. This makes it
possible to modify or replace the transaction before it reaches its
destination. See the documentation of the
transaction_issue_cb_t type for more information on now to
handle the transaction.
A transaction_cb_handle_t pointer is returned as a reference to
the callback.
The registered callbacks above will receive all types of accesses, read, write, or execute, from any initiator hitting any address range. It is up to the callback to filter the information if needed, e.g., to only trace read accesses.
If more than one cell is used and multithreading is enabled, more that one callback can be issued at the same time.
Normally, for transactions to ram/rom, these accesses can be bypassed by
caching the destination object by using the
direct_memory_lookup interface. Then these accesses cannot be
monitored by the transaction_subscribe interface. However, it
is possible to block this caching by using the
register_access_filter_cb method of the
ram_access_subscribe interface. This has typically severe
impact on simulation speed, but allows user to monitor all transactions in
the system. Note however that a real systems also reduces the transactions to
memory by using caches, which normally is not modeled by
Simics,
The remove_callback method removes an earlier installed callback. The handle is used to identify the callback to be removed. The register functions above return such handle.
The enable_callback and disable_callback methods temporarily enables and disables a previously installed callback. Note that this will not necessary speed up the simulation, since the caching may be blocked anyway. The handle is used to identify the callback. The register functions above return such handle.
SIM_INTERFACE(transaction_subscribe) {
void (*remove_callback)(conf_object_t *NOTNULL obj,
transaction_cb_handle_t *handle);
void (*enable_callback)(conf_object_t *NOTNULL obj,
transaction_cb_handle_t *handle);
void (*disable_callback)(conf_object_t *NOTNULL obj,
transaction_cb_handle_t *handle);
transaction_cb_handle_t *(*register_issue_cb)(
conf_object_t *NOTNULL obj,
conf_object_t *conn_obj,
transaction_issue_cb_t cb,
lang_void *data);
};
#define TRANSACTION_SUBSCRIBE_INTERFACE "transaction_subscribe"