op_intrpt_stat()

Abstract

Obtains the input statistic index associated with the current interrupt of the invoking process.

Syntax

op_intrpt_stat ()
Argument Type Description
no arguments

Return Type

int

Index of the input statistic associated with the current interrupt.

[This value is determined by the statistic-related event due to an invocation of the KPs op_stat_write() or op_stat_write_t() by a process, or due to the automatic updating of a statistic by a module.]

Example

Excerpt from: example model (models/std/eth_net); process model (eth_defer); header block.

/* macros for state-transitions */
#define FRAME_WAITING								(op_stat_local_read (FRAME_WAITING_INSTAT) == 1.0
#define FRAME_WAITING_LOW								(op_intrpt_stat () == FRAME_WAITING_INSTAT && \
									!FRAME_WAITING)

#define CHANNEL_BUSY								(op_stat_local_read (CARRIER_SENSE_INSTAT) == 1.0)
#define BUSY_HIGH								(op_intrpt_stat () == CARRIER_SENSE_INSTAT && \
									CHANNEL_BUSY)

#define BUSY_LOW								(op_intrpt_stat () == CARRIER_SENSE_INSTAT && \
									!CHANNEL_BUSY)

Details

This KP will only produce a valid result when invoked after an interrupt that is associated with an input statistic. The only type of interrupt which meets this restriction is the statistic interrupt.

Purpose

Provides a mechanism for determining which input statistic caused the interrupt at the invoking process. This is necessary when more than one statistic wire is feeding into a processor or queue, and the triggering statistic wire must be determined before a call to the KP op_stat_local_read() can be made.

Errors

  • Program Abort: KP requires process context.
  • Recoverable Error: Current event is not a statistic interrupt.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com