Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.3 2002/03/29 15:16:56 lampret
|
|
// Some of the warnings fixed.
|
|
//
|
// Revision 1.2 2002/01/18 07:56:00 lampret
|
// Revision 1.2 2002/01/18 07:56:00 lampret
|
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
|
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
|
//
|
//
|
// Revision 1.1 2002/01/03 08:16:15 lampret
|
// Revision 1.1 2002/01/03 08:16:15 lampret
|
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
|
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
|
Line 73... |
Line 76... |
`include "or1200_defines.v"
|
`include "or1200_defines.v"
|
|
|
module or1200_pic(
|
module or1200_pic(
|
// RISC Internal Interface
|
// RISC Internal Interface
|
clk, rst, spr_cs, spr_write, spr_addr, spr_dat_i, spr_dat_o,
|
clk, rst, spr_cs, spr_write, spr_addr, spr_dat_i, spr_dat_o,
|
pic_wakeup, int,
|
pic_wakeup, intr,
|
|
|
// PIC Interface
|
// PIC Interface
|
pic_int
|
pic_int
|
);
|
);
|
|
|
Line 90... |
Line 93... |
input spr_write; // SPR Write
|
input spr_write; // SPR Write
|
input [31:0] spr_addr; // SPR Address
|
input [31:0] spr_addr; // SPR Address
|
input [31:0] spr_dat_i; // SPR Write Data
|
input [31:0] spr_dat_i; // SPR Write Data
|
output [31:0] spr_dat_o; // SPR Read Data
|
output [31:0] spr_dat_o; // SPR Read Data
|
output pic_wakeup; // Wakeup to the PM
|
output pic_wakeup; // Wakeup to the PM
|
output int; // interrupt
|
output intr; // interrupt
|
// exception request
|
// exception request
|
|
|
//
|
//
|
// PIC Interface
|
// PIC Interface
|
//
|
//
|
Line 152... |
Line 155... |
// Write to PICSR, both CPU and external ints
|
// Write to PICSR, both CPU and external ints
|
//
|
//
|
`ifdef OR1200_PIC_PICSR
|
`ifdef OR1200_PIC_PICSR
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
picsr <= {`OR1200_PIC_INTS-2{1'b0}};
|
picsr <= {`OR1200_PIC_INTS{1'b0}};
|
else if (picsr_sel && spr_write) begin
|
else if (picsr_sel && spr_write) begin
|
picsr <= #1 spr_dat_i[`OR1200_PIC_INTS-1:0] | um_ints;
|
picsr <= #1 spr_dat_i[`OR1200_PIC_INTS-1:0] | um_ints;
|
end else
|
end else
|
picsr <= #1 picsr | um_ints;
|
picsr <= #1 picsr | um_ints;
|
`else
|
`else
|
Line 188... |
Line 191... |
// Unmasked interrupts
|
// Unmasked interrupts
|
//
|
//
|
assign um_ints = pic_int & {picmr, 2'b11};
|
assign um_ints = pic_int & {picmr, 2'b11};
|
|
|
//
|
//
|
// Generate int
|
// Generate intr
|
//
|
//
|
assign int = |um_ints;
|
assign intr = |um_ints;
|
|
|
//
|
//
|
// Assert pic_wakeup when int is asserted
|
// Assert pic_wakeup when intr is asserted
|
//
|
//
|
assign pic_wakeup = int;
|
assign pic_wakeup = intr;
|
|
|
`else
|
`else
|
|
|
//
|
//
|
// When PIC is not implemented, drive all outputs as would when PIC is disabled
|
// When PIC is not implemented, drive all outputs as would when PIC is disabled
|
//
|
//
|
assign int = pic_int[1] | pic_int[0];
|
assign intr = pic_int[1] | pic_int[0];
|
assign pic_wakeup= int;
|
assign pic_wakeup= intr;
|
|
|
//
|
//
|
// Read PIC registers
|
// Read PIC registers
|
//
|
//
|
`ifdef OR1200_PIC_READREGS
|
`ifdef OR1200_PIC_READREGS
|