前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >AMD Xilinx AXI Interrupt Controller 中断优先级

AMD Xilinx AXI Interrupt Controller 中断优先级

作者头像
hankfu
发布2023-05-23 13:35:41
4070
发布2023-05-23 13:35:41
举报
文章被收录于专栏:hankhank

中断优先级

AXI Interrupt Controller支持中断优先级。 在Vivado Block Design中, bit-0连接的中断优先级最高, 越靠近bit-0的中断优先级最高。

Interrupt priority
Interrupt priority

AXI Interrupt Controller的手册pg099中的描述如下:

代码语言:javascript
复制
Priority between interrupt requests is determined by vector position. The least significant bit (LSB, in this case bit 0) has the highest priority.

Intr(0) is always the highest priority interrupt and each successive bit to the left has a corresponding lower interrupt priority.

中断嵌套

要使用中断优先级,通常也要使能中断嵌套(Nested Interrupts)。在Vivado Block Design中, 配置AXI Interrupt Controller时,在“advanced”选项中,要选择“Interrupt Level Register” 。

Interrupt Level Register
Interrupt Level Register

AXI Interrupt Controller的手册pg099中的描述如下:

代码语言:javascript
复制
Nested Interrupts
The core provides support for nested interrupts, by implementing an Interrupt Level 
Register. This can be used by software to prevent lower priority interrupts from occurring 
when handling an interrupt, thus allowing interrupts to be enabled during interrupt 
handling to immediately take a higher priority interrupt. Software must save and restore 
the Interrupt Level Register and return address.
Because the processor jumps directly to the unique Interrupt vector address to service a 
particular interrupt when using fast interrupt mode, the user interrupt service routine code itself must save and restore the Interrupt Level Register and Return Address in this case. In 
normal interrupt mode, this is handled by the software driver.

选择“Interrupt Level Register” 后,中断处理代码会保存和恢复r14,并且在进入设备的ISR之前会使能中断。 具体代码请查看XIntc_DeviceInterruptHandler( )。

Xintc.h中的说明如下:

代码语言:javascript
复制
For nested interrupts, XIntc_DeviceInterruptHandler saves
microblaze r14 register on entry and restores on exit. This is
required since compiler does not support nesting. It enables
Microblaze interrupts after blocking further interrupts from
the current interrupt number and interrupts below current
interrupt priority by writing to Interrupt Level Register of
INTC on entry. On exit, it disables microblaze interrupts and
restores ILR register default value(0xFFFFFFFF)back. It is
recommended to increase STACK_SIZE in linker script for nested
interrupts.
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2023-05-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 中断优先级
  • 中断嵌套
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档