Line 40... |
Line 40... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.5 2002/08/22 13:28:04 mihad
|
|
// Updated for synthesis purposes. Gate level simulation was failing in some configurations
|
|
//
|
// Revision 1.4 2002/02/19 16:32:37 mihad
|
// Revision 1.4 2002/02/19 16:32:37 mihad
|
// Modified testbench and fixed some bugs
|
// Modified testbench and fixed some bugs
|
//
|
//
|
// Revision 1.3 2002/02/01 15:25:12 mihad
|
// Revision 1.3 2002/02/01 15:25:12 mihad
|
// Repaired a few bugs, updated specification, added test bench files and design document
|
// Repaired a few bugs, updated specification, added test bench files and design document
|
Line 755... |
Line 758... |
pcir_fifo_ctrl_reg <= #`FF_DELAY pcir_fifo_control_input ;
|
pcir_fifo_ctrl_reg <= #`FF_DELAY pcir_fifo_control_input ;
|
end
|
end
|
end
|
end
|
end
|
end
|
|
|
|
// when disconnect is signalled, the next data written to fifo will be the last
|
|
// also when this happens, disconnect must stay asserted until last data is written to the fifo
|
|
reg next_write_to_pciw_fifo_is_last ;
|
|
|
// selecting "fifo data" from medium registers or from PCIR_FIFO
|
// selecting "fifo data" from medium registers or from PCIR_FIFO
|
wire [31:0] pcir_fifo_data = (sel_fifo_mreg_in && !pcir_fifo_empty_in) ? pcir_fifo_data_in : pcir_fifo_data_reg ;
|
wire [31:0] pcir_fifo_data = (sel_fifo_mreg_in && !pcir_fifo_empty_in) ? pcir_fifo_data_in : pcir_fifo_data_reg ;
|
wire [3:0] pcir_fifo_ctrl = (sel_fifo_mreg_in && !pcir_fifo_empty_in) ? pcir_fifo_control_input : pcir_fifo_ctrl_reg ;
|
wire [3:0] pcir_fifo_ctrl = (sel_fifo_mreg_in && !pcir_fifo_empty_in) ? pcir_fifo_control_input : pcir_fifo_ctrl_reg ;
|
|
|
// signal assignments to PCI Target FSM
|
// signal assignments to PCI Target FSM
|
Line 767... |
Line 774... |
// when '1', the bus command is IO command - not supported commands are checked in pci_decoder modules
|
// when '1', the bus command is IO command - not supported commands are checked in pci_decoder modules
|
wire io_memory_bus_command = !norm_bc[3] && !norm_bc[2] ;
|
wire io_memory_bus_command = !norm_bc[3] && !norm_bc[2] ;
|
assign disconect_wo_data_out = (
|
assign disconect_wo_data_out = (
|
((/*pcir_fifo_ctrl[`LAST_CTRL_BIT] ||*/ pcir_fifo_empty_in || ~burst_ok_out/*addr_burst_ok*/ || io_memory_bus_command) &&
|
((/*pcir_fifo_ctrl[`LAST_CTRL_BIT] ||*/ pcir_fifo_empty_in || ~burst_ok_out/*addr_burst_ok*/ || io_memory_bus_command) &&
|
~bc0_in && ~frame_reg_in) ||
|
~bc0_in && ~frame_reg_in) ||
|
((pciw_fifo_full_in || pciw_fifo_almost_full_in || pciw_fifo_two_left_in || ~addr_burst_ok || io_memory_bus_command) &&
|
((pciw_fifo_full_in || pciw_fifo_almost_full_in || next_write_to_pciw_fifo_is_last || (pciw_fifo_two_left_in && pciw_fifo_wenable_out) || ~addr_burst_ok || io_memory_bus_command) &&
|
bc0_in && ~frame_reg_in)
|
bc0_in && ~frame_reg_in)
|
) ;
|
) ;
|
assign disconect_w_data_out = (
|
assign disconect_w_data_out = (
|
( burst_ok_out && !io_memory_bus_command && ~bc0_in ) ||
|
( burst_ok_out && !io_memory_bus_command && ~bc0_in ) ||
|
( addr_burst_ok && !io_memory_bus_command && bc0_in )
|
( addr_burst_ok && !io_memory_bus_command && bc0_in )
|
Line 814... |
Line 821... |
.clk_in (clk_in),
|
.clk_in (clk_in),
|
.async_reset_data_out (pcir_fifo_flush_reg),
|
.async_reset_data_out (pcir_fifo_flush_reg),
|
.reset_in (reset_in)
|
.reset_in (reset_in)
|
) ;
|
) ;
|
|
|
|
always@(posedge clk_in or posedge reset_in)
|
|
begin
|
|
if (reset_in)
|
|
next_write_to_pciw_fifo_is_last <= #1 1'b0 ;
|
|
else if (next_write_to_pciw_fifo_is_last && pciw_fifo_wenable_out)
|
|
next_write_to_pciw_fifo_is_last <= #1 1'b0 ;
|
|
else if (pciw_fifo_wenable_out && disconect_wo_data_out)
|
|
next_write_to_pciw_fifo_is_last <= #1 1'b1 ;
|
|
end
|
|
|
// signal assignments from fifo to PCI Target FSM
|
// signal assignments from fifo to PCI Target FSM
|
assign wbw_fifo_empty_out = wbw_fifo_empty_in ;
|
assign wbw_fifo_empty_out = wbw_fifo_empty_in ;
|
assign wbu_del_read_comp_pending_out = wbu_del_read_comp_pending_in ;
|
assign wbu_del_read_comp_pending_out = wbu_del_read_comp_pending_in ;
|
assign pciw_fifo_full_out = (pciw_fifo_full_in || pciw_fifo_almost_full_in || pciw_fifo_two_left_in) ;
|
assign pciw_fifo_full_out = (pciw_fifo_full_in || pciw_fifo_almost_full_in || pciw_fifo_two_left_in) ;
|
assign pcir_fifo_data_err_out = pcir_fifo_ctrl[`DATA_ERROR_CTRL_BIT] && !sel_conf_fifo_in ;
|
assign pcir_fifo_data_err_out = pcir_fifo_ctrl[`DATA_ERROR_CTRL_BIT] && !sel_conf_fifo_in ;
|
Line 826... |
Line 843... |
assign pcir_fifo_renable_out = fetch_pcir_fifo_in && !pcir_fifo_empty_in ;
|
assign pcir_fifo_renable_out = fetch_pcir_fifo_in && !pcir_fifo_empty_in ;
|
assign pciw_fifo_wenable_out = load_to_pciw_fifo_in ;
|
assign pciw_fifo_wenable_out = load_to_pciw_fifo_in ;
|
assign pciw_fifo_control_out[`ADDR_CTRL_BIT] = ~rdy_in ;
|
assign pciw_fifo_control_out[`ADDR_CTRL_BIT] = ~rdy_in ;
|
assign pciw_fifo_control_out[`BURST_BIT] = rdy_in ? ~frame_reg_in : 1'b0 ;
|
assign pciw_fifo_control_out[`BURST_BIT] = rdy_in ? ~frame_reg_in : 1'b0 ;
|
assign pciw_fifo_control_out[`DATA_ERROR_CTRL_BIT] = 1'b0 ;
|
assign pciw_fifo_control_out[`DATA_ERROR_CTRL_BIT] = 1'b0 ;
|
assign pciw_fifo_control_out[`LAST_CTRL_BIT] = rdy_in ?
|
assign pciw_fifo_control_out[`LAST_CTRL_BIT] = rdy_in &&
|
(last_reg_in || pciw_fifo_almost_full_in || ~addr_burst_ok || io_memory_bus_command) : 1'b0 ;
|
(next_write_to_pciw_fifo_is_last || last_reg_in || pciw_fifo_almost_full_in || ~addr_burst_ok || io_memory_bus_command);
|
|
|
`ifdef HOST
|
`ifdef HOST
|
`ifdef NO_CNF_IMAGE
|
`ifdef NO_CNF_IMAGE
|
// data and address outputs assignments to PCI Target FSM
|
// data and address outputs assignments to PCI Target FSM
|
assign data_out = pcir_fifo_data ;
|
assign data_out = pcir_fifo_data ;
|