Skip to main content

15.4.22 Interrupt commands

15.4.22.1 IRegister

Explanation

Register an interrupt, determining whether it can be triggered once, whether it can be debugged (triggered during single-step or single-step pause), as well as the interrupt number, trigger signal, and trigger type. . One trigger source can only be bound to one interrupt function.

Definition

IRegister([\SINGLE,][\DEBUG,]int_num, signal, trigger_type, trap_function);

[] indicates optional parameters

int_num, data type: interrupt number variable, used as an interrupt identifier

signal, register signal/DI signal

trigger_type, trigger method

DI signal trigger methods:

  • \Posflank: posedge triggering

  • \Negflank: negedge triggering

  • \Highlevel: high-level triggering

  • \Lowlevel: low-level triggering

Note: High/low level triggering will continuously trigger interrupts

Register (int+bool+bit+byte) trigger methods: 0 represents low level, non-0 represents high level

trap_function: interrupt function name

\SINGLE, single trigger (optional)

\DEBUG, debuggable (optional), adding this parameter allows interrupts to be triggered during single-step or single-step pause states

Example

IRegister \SINGLE, \DEBUG, intnum0, DI1_0, \Posflank, "trapfun1"

Register an interrupt where when DI signal DI1_0 has a posedge change, execute trapfun1 function and stop responding to this interrupt after one trigger; this interrupt can be triggered during single-step and single-step pause states; intnum0 serves as an identifier for this interrupt, used for IEnable, IDisable, and GetTrapData commands

15.4.22.2 IEnable

Explanation

Activate an interrupt disabled by IDisable, lookahead triggered (activated by default after IRegister)

Definition

IEnable (int_num);

int_num, data type: interrupt number variable, used as an interrupt identifier

Example

IEnable(intnum0 );

Activate interrupt corresponding to intnum0, can be triggered by bound signal source after activation

15.4.22.3 IDisable

Explanation

Disable an interrupt, lookahead triggered. Note that, for an interrupt configured with single-trigger mode, if it receives an interrupt signal after being disabled by IDisable, it will still be treated as completion of the single trigger

Definition

IDisable(int_num);

int_num, data type: interrupt number variable, used as an interrupt identifier

Example

IDisable(intnum0);

Disable the interrupt corresponding to intnum0; after being disabled, it cannot be triggered by the bound signal source

15.4.22.4 GetTrapData

Explanation

Get information about an interrupt, lookahead triggered.

Definition

GetTrapData (int_num, str);

int_num, data type: interrupt number variable, used as an interrupt identifier

Str, data type: string receiving interrupt information

Example

GetTrapData (intnum0, string0);

Get interrupt information corresponding to intnum0, store information in string0