当前位置:网站首页>Sim Api User Guide(7)
Sim Api User Guide(7)
2022-04-23 10:04:00 【weixin_ thirty-eight million four hundred and ninety-eight thou】
Sim Api User Guide(7)
2.10
cosims Or the system emulation application uses the device registration function to register its callback function to Hexagon Simulator . Base note: all registration functions can be called before or after the completion of the configuration stage. . These devices are registered / Each of the deregistration functions can be called multiple times .
2.10.1 AddBusAccessCallback
Prototype
typedef HEXAPI_TransactionStatus
(*bus_transaction_request_callback) (void *handle,
HEX_PA_t address, HEX_4u_t lengthInBytes,
HEX_1u_t *data, HEX_4u_t requestID,
HEXAPI_BusAccessType type, HEX_4u_t threadNum,
HEXAPI_BusBurstType burst);
HEXAPI_Status AddBusAccessCallback(void *handle,
HEX_PA_t startAddr, HEX_PA_t endAddr,
bus_transaction_request_callback brtc)
Parameters
name | type | describe |
---|---|---|
handle | Input | from RegisterCosim() or RegisterCosimArgs() Returned external bus model handle |
startAddr | Input | The lower limit of the address range to register for this device ( Include ) |
endAddr | Input | The upper limit of the address range registered for this device ( contain ) |
btrc | Input | Pointer to the function to be called when making a bus request for a given address area . Please refer to the first 3.2.1 section . |
Return
name | describe |
---|---|
HEX_STAT_SUCCESS | Success |
HEX_STAT_INVALID_ARGS | Bus address ranges overlap |
Description
Register a function , The function to be called when the core makes a bus request for memory within the specified range . The registered function must have the given prototype , If the bus request can be accepted , Then return to zero. . If the bus request cannot be accepted , Returns a non-zero value , And the core stops the request thread and reissues the request later .
If the request is accepted , The core keeps the request thread stopped , Until it receives BusTransactionFinished( The first 2.12.15 section ) Called to indicate that the transaction is complete .
The purpose is to allow users to model the bus . Usually , The called function (btrc) Will register an alert callback ( The first 2.10.5 section ) To receive notification from the simulator that the expected delay of the operation has expired . here , The bus model signals the completion of the requested bus operation .
Be careful
Overlapping address ranges registered by different external models will be rejected .
2.10.2 RemoveBusAccessCallback
Prototype
HEXAPI_Status RemoveBusAccessCallback(void *handle)
Parameters
name | type | describe |
---|---|---|
handle | Input | from RegisterCosim() or RegisterCosimArgs() Returned external bus model handle |
Return
name | describe |
---|---|
HEX_STAT_SUCCESS | Success |
HEX_STAT_DEVICE_NOT_FOUND | Cannot find registered bus device |
Description
Remove the callback notification of the external bus model from the simulator . For all address ranges of registered callbacks , Delete the callback associated with the handle .
2.10.3 AddFrequencyChangeCallback
Prototype
typedef void (*frequency_change_callback)
(void *handle, HEX_4u_t newFrequency);
HEXAPI_Status AddFrequencyChangeCallback (void *handle,
frequency_change_callback fcc)
Parameters
name | type | describe |
---|---|---|
handle | Input | from RegisterCosim() or RegisterCosimArgs() Returned external bus model handle |
fcc | Input | Pointer to the function that calls the frequency change notification . See also 3.2.5 section |
Return
name | describe |
---|---|
HEX_STAT_SUCCESS | Success |
HEX_STAT_DEVICE_NOT_FOUND | Cannot find registered bus device |
Description
By every time Hexagon When the core frequency changes, the external device model that needs to be notified by the simulator is used . It can use the new frequency as needed to calculate the appropriate delay .
2.10.4 RemoveFrequencyChangeCallback
Prototype
HEXAPI_Status RemoveFrequencyChangeCallback (void *handle)
Parameters
name | type | describe |
---|---|---|
handle | Input | from RegisterCosim() or RegisterCosimArgs() Returned external bus model handle |
Return
name | describe |
---|---|
HEX_STAT_SUCCESS | Success |
HEX_STAT_DEVICE_NOT_FOUND | Cannot remove pair for device FrequencyChangeCallback Call to |
Description
The external device model uses it to delete itself from the list of registered devices , To get the callback every time the core frequency changes .
2.10.5 AddTimedCallback
Prototype
typedef void (*timed_callback) (void *handle);
HEXAPI_Status AddTimedCallback(void *handle,
HEX_8u_t interval, HEXAPI_Interval i_typ, timed_callback tc)
Parameters
name | type | describe |
---|---|---|
handle | Input | from RegisterCosim() or RegisterCosimArgs() Returned external bus model handle |
interval | Input | The interval in simulator time units |
i_typ | Input | Time unit type : HEX_MILLISEC - millisecond 、HEX_MICROSEC - Microsecond |
、HEX_NANOSEC - nanosecond 、HEX_PICOSEC - picosecond | ||
tc | Input | Pointer to the function to be called in each interval unit . See the first 3.2.2 section |
Return
name | describe |
---|---|
HEX_STAT_SUCCESS | Success |
HEX_STAT_DEVICE_NOT_FOUND | Failed to register callback |
Description
The external device model uses it to delete itself from the list of registered devices , To get the callback every time the core frequency changes .
Used by external device models that need to be notified by the simulator that the interval simulator time unit has expired . This notification will continue to be delivered by the simulator , Until cancelled .
The granularity of time increment is limited by the current kernel frequency setting . The finest granularity available corresponds to the time taken for a single processor cycle . All time values are scaled according to the current processor clock frequency , And rescale when the kernel frequency changes .
2.10.6 AddTimedCallbackFP
Prototype
typedef void (*timed_callback) (void *handle);
HEXAPI_Status AddTimedCallbackFP(void *handle,
HEX_8f_t interval, HEXAPI_Interval i_typ, timed_callback tc)
Parameters
name | type | describe |
---|---|---|
handle | Input | from RegisterCosim() or RegisterCosimArgs() Returned external bus model handle |
interval | Input | The interval in simulator time units ( Expressed as a double precision floating-point value ) |
i_typ | Input | Time unit type : HEX_MILLISEC - millisecond 、HEX_MICROSEC - Microsecond |
、HEX_NANOSEC - nanosecond 、HEX_PICOSEC - picosecond | ||
tc | Input | Pointer to the function to be called in each interval unit . See the first 3.2.2 section |
Return
name | describe |
---|---|
HEX_STAT_SUCCESS | Success |
HEX_STAT_DEVICE_NOT_FOUND | Failed to register callback |
Description
Used by external device models that need to be notified by the simulator that the interval simulator time unit has expired . This notification will continue to be delivered by the simulator , Until cancelled .
The granularity of time increment is limited by the current core frequency setting . The finest granularity available corresponds to the time taken for a single processor cycle . All time values are scaled according to the current processor clock frequency , And rescale when the core frequency changes .
Be careful
This function is related to AddTimedCallback( The first 2.10.5 section ) identical , Only the time interval is expressed as double precision floating-point value .
版权声明
本文为[weixin_ thirty-eight million four hundred and ninety-eight thou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230955087295.html
边栏推荐
- Sim Api User Guide(8)
- 第一章 Oracle Database In-Memory 相关概念(IM-1.1)
- Es aggregation aggregation analysis
- MapReduce压缩
- php 二维数组指定元素相等后相加否则新增
- DBA常用SQL语句(1)— 概况信息
- Odoo 服务器搭建备忘
- Go language practice mode - functional options pattern
- Realize data value through streaming data integration (2)
- Function realization of printing page
猜你喜欢
Custom login failure handling
正大国际讲解道琼斯工业指数到底是什么?
Nine abilities of agile manufacturing in the era of meta universe
C语言:表达式求值(整型提升、算术转换 ...)
Juc并发编程06——深入剖析队列同步器AQS源码
Planning and construction of industrial meta universe platform
Computer network security experiment II DNS protocol vulnerability utilization experiment
深度选择器
Failureforwardurl and failureurl
元宇宙时代的职业规划与执行
随机推荐
DBA common SQL statements (1) - overview information
解决VMware卸载后再安装出现的问题
Code source daily question div1 (701-707)
Chapter II in memory architecture (im-2.2)
正大国际讲解道琼斯工业指数到底是什么?
Comparative analysis of meta universe from the dimension of knowledge dissemination
[COCI] lattice (dichotomy + tree divide and conquer + string hash)
1D / 1D dynamic programming learning summary
DBA常用SQL语句(4)- Top SQL
LeetCode 1249. Minimum Remove to Make Valid Parentheses - FB高频题1
NEC infrared remote control coding description
DBA common SQL statements (5) - latch related
Function realization of printing page
MapReduce核心和基础Demo
Skill point digging
Juc并发编程09——Condition实现源码分析
Understand scope
Nvidia最新三维重建技术Instant-ngp初探
Using multithreading to output abc10 times in sequence
DBA常用SQL语句 (5) - Latch 相关