Line 44... |
Line 44... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.8 2003/04/07 14:58:02 simont
|
|
// change sfr's interface.
|
|
//
|
// Revision 1.7 2003/03/28 17:45:57 simont
|
// Revision 1.7 2003/03/28 17:45:57 simont
|
// change module name.
|
// change module name.
|
//
|
//
|
// Revision 1.6 2003/01/13 14:14:41 simont
|
// Revision 1.6 2003/01/13 14:14:41 simont
|
// replace some modules
|
// replace some modules
|
Line 99... |
Line 102... |
//
|
//
|
// isrc processing interrupt sources
|
// isrc processing interrupt sources
|
// int_dept
|
// int_dept
|
wire [2:0] isrc_cur;
|
wire [2:0] isrc_cur;
|
reg [2:0] isrc [1:0];
|
reg [2:0] isrc [1:0];
|
reg int_dept;
|
reg [1:0] int_dept;
|
wire int_dept_1;
|
wire [1:0] int_dept_1;
|
reg int_proc;
|
reg int_proc;
|
reg [1:0] int_lev [1:0];
|
reg [1:0] int_lev [1:0];
|
wire cur_lev;
|
wire cur_lev;
|
|
|
assign isrc_cur = int_proc ? isrc[int_dept_1] : 2'h0;
|
assign isrc_cur = int_proc ? isrc[int_dept_1] : 2'h0;
|
assign int_dept_1 = int_dept - 1'b1;
|
assign int_dept_1 = int_dept - 2'b01;
|
assign cur_lev = int_lev[int_dept_1];
|
assign cur_lev = int_lev[int_dept_1];
|
|
|
//
|
//
|
// contains witch level of interrupts is running
|
// contains witch level of interrupts is running
|
//reg [1:0] int_levl, int_levl_w;
|
//reg [1:0] int_levl, int_levl_w;
|
Line 274... |
Line 277... |
// interrupt processing
|
// interrupt processing
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
begin
|
begin
|
if (rst) begin
|
if (rst) begin
|
int_vec <= #1 8'h00;
|
int_vec <= #1 8'h00;
|
int_dept <= #1 1'b0;
|
int_dept <= #1 2'b0;
|
isrc[0] <= #1 3'h0;
|
isrc[0] <= #1 3'h0;
|
isrc[1] <= #1 3'h0;
|
isrc[1] <= #1 3'h0;
|
int_proc <= #1 1'b0;
|
int_proc <= #1 1'b0;
|
int_lev[0] <= #1 1'b0;
|
int_lev[0] <= #1 1'b0;
|
int_lev[1] <= #1 1'b0;
|
int_lev[1] <= #1 1'b0;
|
end else if (reti) begin // return from interrupt
|
end else if (reti & int_proc) begin // return from interrupt
|
if (int_dept==2'b01)
|
if (int_dept==2'b01)
|
int_proc <= #1 1'b0;
|
int_proc <= #1 1'b0;
|
int_dept <= #1 int_dept - 2'b01;
|
int_dept <= #1 int_dept - 2'b01;
|
end else if (((ie[7]) & (!cur_lev) || !int_proc) & il1) begin // interrupt on level 1
|
end else if (((ie[7]) & (!cur_lev) || !int_proc) & il1) begin // interrupt on level 1
|
int_proc <= #1 1'b1;
|
int_proc <= #1 1'b1;
|
Line 311... |
Line 314... |
end
|
end
|
|
|
end else if ((ie[7]) & !int_proc & il0) begin // interrupt on level 0
|
end else if ((ie[7]) & !int_proc & il0) begin // interrupt on level 0
|
int_proc <= #1 1'b1;
|
int_proc <= #1 1'b1;
|
int_lev[int_dept] <= #1 `OC8051_ILEV_L0;
|
int_lev[int_dept] <= #1 `OC8051_ILEV_L0;
|
int_dept <= #1 int_dept + 2'b01;
|
int_dept <= #1 2'b01;
|
if (int_l0[0]) begin
|
if (int_l0[0]) begin
|
int_vec <= #1 `OC8051_INT_X0;
|
int_vec <= #1 `OC8051_INT_X0;
|
isrc[int_dept] <= #1 `OC8051_ISRC_IE0;
|
isrc[int_dept] <= #1 `OC8051_ISRC_IE0;
|
end else if (int_l0[1]) begin
|
end else if (int_l0[1]) begin
|
int_vec <= #1 `OC8051_INT_T0;
|
int_vec <= #1 `OC8051_INT_T0;
|