Line 80... |
Line 80... |
assign i_scop_int = brd_interrupts[2];
|
assign i_scop_int = brd_interrupts[2];
|
assign i_flash_int = brd_interrupts[1];
|
assign i_flash_int = brd_interrupts[1];
|
|
|
// reg [31:0] pwrcount;
|
// reg [31:0] pwrcount;
|
// reg [31:0] rtccount;
|
// reg [31:0] rtccount;
|
wire [31:0] ictrl_data, gpio_data, date_data;
|
wire [31:0] ictrl_data, gpio_data, date_data, timer_data;
|
|
|
reg [31:0] r_wb_data;
|
reg [31:0] r_wb_data;
|
reg r_wb_addr;
|
reg r_wb_addr;
|
always @(posedge i_clk)
|
always @(posedge i_clk)
|
begin
|
begin
|
Line 102... |
Line 102... |
// endcase
|
// endcase
|
// end else
|
// end else
|
if ((i_wb_cyc)&&(i_wb_stb)&&(~i_wb_we))
|
if ((i_wb_cyc)&&(i_wb_stb)&&(~i_wb_we))
|
begin
|
begin
|
casez(i_wb_addr[3:0])
|
casez(i_wb_addr[3:0])
|
4'h02: r_wb_data <= `DATESTAMP;
|
4'h01: r_wb_data <= `DATESTAMP;
|
4'h03: r_wb_data <= ictrl_data;
|
4'h02: r_wb_data <= ictrl_data;
|
4'h04: r_wb_data <= i_bus_err_addr;
|
4'h03: r_wb_data <= i_bus_err_addr;
|
|
4'h04: r_wb_data <= timer_data;
|
4'h05: r_wb_data <= date_data;
|
4'h05: r_wb_data <= date_data;
|
4'h06: r_wb_data <= gpio_data;
|
4'h06: r_wb_data <= gpio_data;
|
default: r_wb_data <= 32'h0000;
|
default: r_wb_data <= 32'h0000;
|
endcase
|
endcase
|
end
|
end
|
end
|
end
|
|
|
|
// The Zip Timer
|
|
wire tm_int, tm_ack, tm_stall;
|
|
ziptimer timer(i_clk, 1'b0, 1'b1,
|
|
(i_wb_cyc),(i_wb_stb)&&(i_wb_addr==5'h04),
|
|
i_wb_we, i_wb_data,
|
|
tm_ack, tm_stall, timer_data, tm_int);
|
|
|
// The interrupt controller
|
// The interrupt controller
|
wire ck_int;
|
wire ck_int;
|
wire [7:0] interrupt_vector;
|
wire [8:0] interrupt_vector;
|
assign interrupt_vector = {
|
assign interrupt_vector = { tm_int,
|
i_uart_tx_int, i_uart_rx_int, i_pwm_int, gpio_int,
|
i_uart_tx_int, i_uart_rx_int, i_pwm_int, gpio_int,
|
i_scop_int, i_flash_int, ck_int, brd_interrupts[0] };
|
i_scop_int, i_flash_int, ck_int, brd_interrupts[0] };
|
icontrol #(8) intcontroller(i_clk, 1'b0,
|
icontrol #(9) intcontroller(i_clk, 1'b0,
|
((i_wb_cyc)&&(i_wb_stb)&&(i_wb_we)
|
((i_wb_cyc)&&(i_wb_stb)&&(i_wb_we)
|
&&(i_wb_addr==5'h3)), i_wb_data,
|
&&(i_wb_addr==5'h2)), i_wb_data,
|
ictrl_data, interrupt_vector,
|
ictrl_data, interrupt_vector,
|
o_interrupt);
|
o_interrupt);
|
|
|
/*
|
/*
|
// The ticks since power up register
|
// The ticks since power up register
|