Line 1... |
Line 1... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// $Id: serirq_host.v,v 1.1 2008-03-10 14:08:13 hharte Exp $ ////
|
//// $Id: serirq_host.v,v 1.2 2008-12-27 19:46:18 hharte Exp $ ////
|
//// serirq_host.v - SERIRQ Host Controller ////
|
//// serirq_host.v - SERIRQ Host Controller ////
|
//// ////
|
//// ////
|
//// This file is part of the Wishbone LPC Bridge project ////
|
//// This file is part of the Wishbone LPC Bridge project ////
|
//// http://www.opencores.org/projects/wb_lpc/ ////
|
//// http://www.opencores.org/projects/wb_lpc/ ////
|
//// ////
|
//// ////
|
Line 45... |
Line 45... |
serirq_o, serirq_i, serirq_oe
|
serirq_o, serirq_i, serirq_oe
|
);
|
);
|
// Wishbone Slave Interface
|
// Wishbone Slave Interface
|
input clk_i;
|
input clk_i;
|
input nrst_i; // Active low reset.
|
input nrst_i; // Active low reset.
|
input serirq_mode_i;
|
input serirq_mode_i; // Mode selection, 0=Continuous, 1=Quiet
|
|
|
// SERIRQ Master Interface
|
// SERIRQ Master Interface
|
output reg serirq_o; // SERIRQ output
|
output reg serirq_o; // SERIRQ output
|
input serirq_i; // SERIRQ Input
|
input serirq_i; // SERIRQ Input
|
output reg serirq_oe; // SERIRQ Output Enable
|
output reg serirq_oe; // SERIRQ Output Enable
|
Line 92... |
Line 92... |
begin
|
begin
|
start_cnt <= 3'b000;
|
start_cnt <= 3'b000;
|
state <= `SERIRQ_ST_START;
|
state <= `SERIRQ_ST_START;
|
end
|
end
|
else if((current_mode == `SERIRQ_MODE_QUIET) && (serirq_mode_i == `SERIRQ_MODE_CONTINUOUS))
|
else if((current_mode == `SERIRQ_MODE_QUIET) && (serirq_mode_i == `SERIRQ_MODE_CONTINUOUS))
|
begin // Switch to Continuous mode if by starting a new cycle to inform the slaves.
|
begin // Switch to Continuous mode by starting a new cycle to inform the slaves.
|
start_cnt <= 3'b000;
|
start_cnt <= 3'b000;
|
state <= `SERIRQ_ST_START;
|
state <= `SERIRQ_ST_START;
|
end
|
end
|
else
|
else
|
state <= `SERIRQ_ST_IDLE;
|
state <= `SERIRQ_ST_IDLE;
|
Line 145... |
Line 145... |
`SERIRQ_ST_STOP:
|
`SERIRQ_ST_STOP:
|
begin
|
begin
|
serirq_o <= 1'b0;
|
serirq_o <= 1'b0;
|
serirq_oe <= 1'b1;
|
serirq_oe <= 1'b1;
|
stop_cnt <= stop_cnt + 1;
|
stop_cnt <= stop_cnt + 1;
|
if(stop_cnt == (serirq_mode_i ? 2'b10 : 2'b01)) begin
|
if(stop_cnt == (serirq_mode_i ? 2'b01 : 2'b10)) begin
|
state <= `SERIRQ_ST_STOP_R;
|
state <= `SERIRQ_ST_STOP_R;
|
end
|
end
|
else begin
|
else begin
|
state <= `SERIRQ_ST_STOP;
|
state <= `SERIRQ_ST_STOP;
|
end
|
end
|