irr.v
资源名称:_8259A.zip [点击查看]
上传用户:tzxuweilin
上传日期:2022-08-10
资源大小:747k
文件大小:2k
源码类别:
VHDL/FPGA/Verilog
开发平台:
VHDL
- module irr(ir0, ir1, ir2, ir3, ir4, ir5, ir6, ir7, ltim, freeze, rd, setzero, data, busdata, en);
- input ir0, ir1, ir2, ir3, ir4, ir5, ir6, ir7;
- input ltim;
- input freeze;
- input rd;
- input[7:0] setzero;
- output[7:0] data;
- output[7:0]busdata;
- output en;
- wire[7:0] irrreg;
- wire[7:0] senselatch;
- assign data = irrreg;
- assign busdata = irrreg;
- assign en = rd;
- assign irrreg[0] = freeze ? (senselatch[0] & ir0) | (ltim & ir0) : irrreg[0];
- assign irrreg[1] = freeze ? (senselatch[1] & ir1) | (ltim & ir1) : irrreg[1];
- assign irrreg[2] = freeze ? (senselatch[2] & ir2) | (ltim & ir2) : irrreg[2];
- assign irrreg[3] = freeze ? (senselatch[3] & ir3) | (ltim & ir3) : irrreg[3];
- assign irrreg[4] = freeze ? (senselatch[4] & ir4) | (ltim & ir4) : irrreg[4];
- assign irrreg[5] = freeze ? (senselatch[5] & ir5) | (ltim & ir5) : irrreg[5];
- assign irrreg[6] = freeze ? (senselatch[6] & ir6) | (ltim & ir6) : irrreg[6];
- assign irrreg[7] = freeze ? (senselatch[7] & ir7) | (ltim & ir7) : irrreg[7];
- assign senselatch[0] = setzero[0] ? 0 : (ir0 ? 1 : senselatch[0]);
- assign senselatch[1] = setzero[1] ? 0 : (ir1 ? 1 : senselatch[1]);
- assign senselatch[2] = setzero[2] ? 0 : (ir2 ? 1 : senselatch[2]);
- assign senselatch[3] = setzero[3] ? 0 : (ir3 ? 1 : senselatch[3]);
- assign senselatch[4] = setzero[4] ? 0 : (ir4 ? 1 : senselatch[4]);
- assign senselatch[5] = setzero[5] ? 0 : (ir5 ? 1 : senselatch[5]);
- assign senselatch[6] = setzero[6] ? 0 : (ir6 ? 1 : senselatch[6]);
- assign senselatch[7] = setzero[7] ? 0 : (ir7 ? 1 : senselatch[7]);
- // FOR /L %i in (0, 1, 7) do (ECHO "assign irrreg[%i] = freeze ? (senselatch[%i] & ir%i) | (ltim & ir%i) : irrreg[%i];" >>a.txt)
- // FOR /L %i in (0, 1, 7) do (ECHO "assign senselatch[%i] = setzero[%i] ? 0 : (ir%i ? 1 : senselatch[%i]);" >>b.txt)
- endmodule