op_ev_id()
摘要
获取事件的 ID。
语法
op_ev_id (evhandle)
| 参数 | 类型 | 说明 |
|---|---|---|
evhandle |
Evhandle |
标识该事件的事件句柄 [事件句柄可以从本包中的多个内核过程获取,例如 op_ev_current()、op_ev_seek_time() 和 op_ev_next(),以及 op_intrpt_schedule_self() 等其他内核过程。] |
返回类型
OpT_Ev_Id
指定事件的 ID。
示例
char ev_id_str[20];
/* Get the currently executing event */
evptr = op_ev_current ();
/* Get the event ID */
ev_id = op_ev_id (evptr);
详情
事件 ID 的格式取决于该 ID 是全局序列化(顺序仿真中的典型方式)还是按模块序列化(并行仿真中的典型方式)。序列化方案由 op_runsim 偏好设置 “fully_serialized_event_ids“ 决定。
用途
提供了一种获取事件 ID 的方法。
错误
- 可恢复错误:事件句柄指向的事件无效或当前未被计划。
参考
- 使用内核过程 op_ev_id_str_get() 获取事件 ID 的字符串表示