|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 maxrun 于 2014-8-30 07:37 编辑
在Quartus II 的 verilog中, GpioA的每个引脚上升沿都触发一个中断标志GioIrqA, 标志清除用ClrIrqA, 笨办法实现方法如下, 请问如何精简?
- always@(posedge ClrIrqA,posedge GpioA[0])begin
- if(ClrIrqA) GioIrqA[0] <= 1'B0;
- else GioIrqA[0] <= 1'B1;
- end
- always@(posedge ClrIrqA,posedge GpioA[1])begin
- if(ClrIrqA) GioIrqA[1] <= 1'B0;
- else GioIrqA[1] <= 1'B1;
- end
- always@(posedge ClrIrqA,posedge GpioA[2])begin
- if(ClrIrqA) GioIrqA[2] <= 1'B0;
- else GioIrqA[2] <= 1'B1;
- end
- always@(posedge ClrIrqA,posedge GpioA[3])begin
- if(ClrIrqA) GioIrqA[3] <= 1'B0;
- else GioIrqA[3] <= 1'B1;
- end
- //......
- always@(posedge ClrIrqA,posedge GpioA[15])begin
- if(ClrIrqA) GioIrqA[15] <= 1'B0;
- else GioIrqA[15] <= 1'B1;
- end
复制代码 |
|