OpenCores
URL https://opencores.org/ocsvn/rf6809/rf6809/trunk

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [rtl/] [cpu/] [rf6809_pic.sv] - Diff between revs 2 and 21

Show entire file | Details | Blame | View Log

Rev 2 Rev 21
Line 115... Line 115...
                    i15,i14,i13,i12,i11,i10,i9,i8,i7,i6,i5,i4,i3,i2,i1,nmii};
                    i15,i14,i13,i12,i11,i10,i9,i8,i7,i6,i5,i4,i3,i2,i1,nmii};
reg [31:0] ib;
reg [31:0] ib;
reg [31:0] iedge;
reg [31:0] iedge;
reg [31:0] rste;
reg [31:0] rste;
reg [31:0] es;
reg [31:0] es;
 
reg [31:0] irq_active;
reg [3:0] irq [0:31];
reg [3:0] irq [0:31];
reg [BPB:0] cause [0:31];
reg [BPB:0] cause [0:31];
reg [5:0] server [0:31];
reg [5:0] server [0:31];
integer n;
integer n;
 
 
Line 196... Line 197...
                8'd6:   dat_o <= ie[15: 8];
                8'd6:   dat_o <= ie[15: 8];
                8'd7:   dat_o <= ie[ 7: 0];
                8'd7:   dat_o <= ie[ 7: 0];
                8'b1?????00: dat_o <= cause[adr_i[6:2]];
                8'b1?????00: dat_o <= cause[adr_i[6:2]];
                8'b1?????01: dat_o <= {es[adr_i[6:2]],ie[adr_i[6:2]],2'b0,irq[adr_i[6:2]]};
                8'b1?????01: dat_o <= {es[adr_i[6:2]],ie[adr_i[6:2]],2'b0,irq[adr_i[6:2]]};
                8'b1?????10:    dat_o <= {2'b0,server[adr_i[6:2]]};
                8'b1?????10:    dat_o <= {2'b0,server[adr_i[6:2]]};
 
                8'b1?????11:    dat_o <= irq_active[adr_i[6:2]];
                default:        dat_o <= 12'h00;
                default:        dat_o <= 12'h00;
                endcase
                endcase
        else
        else
                dat_o <= 12'h00;
                dat_o <= 12'h00;
end
end
Line 227... Line 229...
 
 
// irq requests are latched on every rising clock edge to prevent
// irq requests are latched on every rising clock edge to prevent
// misreads
// misreads
// nmi is not encoded
// nmi is not encoded
always @(posedge clk)
always @(posedge clk)
begin
if (rst_i)
 
        irq_active <= 32'd0;
 
else begin
        irqenc <= 5'd0;
        irqenc <= 5'd0;
        for (n = 31; n > 0; n = n - 1)
        for (n = 31; n > 0; n = n - 1) begin
                if ((es[n] ? iedge[n] : i[n])) irqenc <= n;
                if ((es[n] ? iedge[n] : i[n])) irqenc <= n;
 
                if ((es[n] ? iedge[n] : i[n])) irq_active[n] <= 1'b1;
 
        end
 
        if (cs && wr_i && adr_i[7] && &adr_i[1:0])
 
                irq_active[adr_i[6:2]] <= dat_i[0];
end
end
 
 
endmodule
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.