OpenCores
URL https://opencores.org/ocsvn/pci/pci/trunk

Subversion Repositories pci

[/] [pci/] [tags/] [rel_7/] [rtl/] [verilog/] [pci_target32_interface.v] - Diff between revs 26 and 53

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 26 Rev 53
Line 40... Line 40...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.4  2002/02/19 16:32:37  mihad
 
// 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
//
//
// Revision 1.2  2001/10/05 08:14:30  mihad
// Revision 1.2  2001/10/05 08:14:30  mihad
// Updated all files with inclusion of timescale file for simulation purposes.
// Updated all files with inclusion of timescale file for simulation purposes.
Line 699... Line 702...
assign  same_read_out = (same_read_request) ; // && ~pcir_fifo_empty_in) ;
assign  same_read_out = (same_read_request) ; // && ~pcir_fifo_empty_in) ;
 
 
// Signals for byte enable checking
// Signals for byte enable checking
reg                             addr_burst_ok ;
reg                             addr_burst_ok ;
reg                             io_be_ok ;
reg                             io_be_ok ;
reg                             conf_be_ok ;
 
 
 
// Byte enable checking for IO, MEMORY and CONFIGURATION spaces - be_in is active low!
// Byte enable checking for IO, MEMORY and CONFIGURATION spaces - be_in is active low!
always@(strd_address or be_in)
always@(strd_address or be_in)
begin
begin
        case (strd_address[1:0])
        case (strd_address[1:0])
        2'b11 :
        2'b11 :
        begin
        begin
                addr_burst_ok <= 1'b0 ;
                addr_burst_ok <= 1'b0 ;
                io_be_ok <= (be_in[2] && be_in[1] && be_in[0]) ; // only be3 can be active
                io_be_ok <= (be_in[2] && be_in[1] && be_in[0]) ; // only be3 can be active
                conf_be_ok <= 1'b0 ;
 
        end
        end
        2'b10 :
        2'b10 :
        begin
        begin
                addr_burst_ok <= 1'b0 ;
                addr_burst_ok <= 1'b0 ;
                io_be_ok <= (~be_in[2] && be_in[1] && be_in[0]) || (be_in[3] && be_in[2] && be_in[1] && be_in[0]) ;
                io_be_ok <= (~be_in[2] && be_in[1] && be_in[0]) || (be_in[3] && be_in[2] && be_in[1] && be_in[0]) ;
                conf_be_ok <= 1'b0 ;
 
        end
        end
        2'b01 :
        2'b01 :
        begin
        begin
                addr_burst_ok <= 1'b0 ;
                addr_burst_ok <= 1'b0 ;
                io_be_ok <= (~be_in[1] && be_in[0]) || (be_in[3] && be_in[2] && be_in[1] && be_in[0]) ;
                io_be_ok <= (~be_in[1] && be_in[0]) || (be_in[3] && be_in[2] && be_in[1] && be_in[0]) ;
                conf_be_ok <= 1'b0 ;
 
        end
        end
        default :       // 2'b00
        default :       // 2'b00
        begin
        begin
                addr_burst_ok <= 1'b1 ;
                addr_burst_ok <= 1'b1 ;
                io_be_ok <= (~be_in[0]) || (be_in[3] && be_in[2] && be_in[1] && be_in[0]) ;
                io_be_ok <= (~be_in[0]) || (be_in[3] && be_in[2] && be_in[1] && be_in[0]) ;
                conf_be_ok <= 1'b1 ;
 
        end
        end
        endcase
        endcase
end
end
 
 
reg                             calc_target_abort ;
wire calc_target_abort = (norm_bc[3:1] == `BC_IO_RW) ? !io_be_ok : 1'b0 ;
// Target abort indication regarding the registered bus command and current signals for byte enable checking
 
always@(norm_bc or hit0_in or io_be_ok or conf_be_ok)
 
begin
 
        case (norm_bc)
 
        // READ COMMANDS
 
        `BC_IO_READ :
 
        begin
 
                case ({hit0_in, hit0_conf})
 
`ifdef          HOST
 
        `ifdef  NO_CNF_IMAGE
 
        `else
 
                2'b11 :
 
                begin
 
                        calc_target_abort <= 1'b0 ;
 
                end
 
        `endif
 
`else
 
                2'b11 :
 
                begin
 
                        calc_target_abort <= 1'b0 ;
 
                end
 
`endif
 
                default :
 
                begin
 
                        if (io_be_ok)
 
                        begin
 
                                calc_target_abort <= 1'b0 ;
 
                        end
 
                        else
 
                        begin
 
                                calc_target_abort <= 1'b1 ;
 
                        end
 
                end
 
                endcase
 
        end
 
        `BC_MEM_READ :
 
        begin
 
                calc_target_abort <= 1'b0 ;
 
        end
 
        `BC_CONF_READ :
 
        begin
 
                case (conf_be_ok)
 
                1'b1 :
 
                begin
 
                        calc_target_abort <= 1'b0 ;
 
                end
 
                default :
 
                begin
 
                        calc_target_abort <= 1'b1 ;
 
                end
 
                endcase
 
        end
 
        `BC_MEM_READ_LN,
 
        `BC_MEM_READ_MUL :
 
        begin
 
                calc_target_abort <= 1'b0 ;
 
        end
 
        // WRITE COMMANDS
 
        `BC_IO_WRITE :
 
        begin
 
                case ({hit0_in, hit0_conf})
 
`ifdef          HOST
 
        `ifdef  NO_CNF_IMAGE
 
        `else
 
                2'b11 :
 
                begin
 
                        calc_target_abort <= 1'b0 ;
 
                end
 
        `endif
 
`else
 
                2'b11 :
 
                begin
 
                        calc_target_abort <= 1'b0 ;
 
                end
 
`endif
 
                default :
 
                begin
 
                        if (io_be_ok)
 
                        begin
 
                                calc_target_abort <= 1'b0 ;
 
                        end
 
                        else
 
                        begin
 
                                calc_target_abort <= 1'b1 ;
 
                        end
 
                end
 
                endcase
 
        end
 
        `BC_MEM_WRITE :
 
        begin
 
                calc_target_abort <= 1'b0 ;
 
        end
 
        `BC_CONF_WRITE :
 
        begin
 
                case (conf_be_ok)
 
                1'b1 :
 
                begin
 
                        calc_target_abort <= 1'b0 ;
 
                end
 
                default :
 
                begin
 
                        calc_target_abort <= 1'b1 ;
 
                end
 
                endcase
 
        end
 
        `BC_MEM_WRITE_INVAL :
 
        begin
 
                calc_target_abort <= 1'b0 ;
 
        end
 
        default :
 
        begin
 
                calc_target_abort <= 1'b0 ;
 
        end
 
        endcase
 
end
 
 
 
wire [3:0]       pcir_fifo_control_input = pcir_fifo_empty_in ? 4'h0 : pcir_fifo_control_in ;
wire [3:0]       pcir_fifo_control_input = pcir_fifo_empty_in ? 4'h0 : pcir_fifo_control_in ;
 
 
// Medium registers for data and control busses from PCIR_FIFO
// Medium registers for data and control busses from PCIR_FIFO
reg             [31:0]   pcir_fifo_data_reg ;
reg             [31:0]   pcir_fifo_data_reg ;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.