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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_1.2/] [rtl/] [IO/] [Unit_IO.v] - Diff between revs 82 and 87

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 82 Rev 87
`timescale 1ns / 1ps
`timescale 1ns / 1ps
`include "aDefinitions.v"
`include "aDefinitions.v"
`define ADR_IMM 1
`define ADR_IMM 1
`define ADR_POINTER 0
`define ADR_POINTER 0
/**********************************************************************************
/**********************************************************************************
Theia, Ray Cast Programable graphic Processing Unit.
Theia, Ray Cast Programable graphic Processing Unit.
Copyright (C) 2010  Diego Valverde (diego.valverde.g@gmail.com)
Copyright (C) 2010  Diego Valverde (diego.valverde.g@gmail.com)
 
 
This program is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
of the License, or (at your option) any later version.
 
 
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
GNU General Public License for more details.
 
 
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 
***********************************************************************************/
***********************************************************************************/
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
module IO_Unit
module IO_Unit
(
(
 input wire                            Clock,
 input wire                            Clock,
 input wire                            Reset,
 input wire                            Reset,
 input wire                            iEnable,
 input wire                            iEnable,
 input wire [`DATA_ADDRESS_WIDTH-1:0]  iDat_O_Pointer,     //Pointer to what we want to send via DAT_O
 input wire [`DATA_ADDRESS_WIDTH-1:0]  iDat_O_Pointer,     //Pointer to what we want to send via DAT_O
 input wire [`WIDTH-1:0]               iAdr_O_Imm,         //Value to assign to ADR_O
 input wire [`WIDTH-1:0]               iAdr_O_Imm,         //Value to assign to ADR_O
 input wire [`DATA_ADDRESS_WIDTH-1:0]  iAdr_O_Pointer,     //Pointer to value to assing to ADR_O
 input wire [`DATA_ADDRESS_WIDTH-1:0]  iAdr_O_Pointer,     //Pointer to value to assing to ADR_O
 input wire                            iAdr_O_Type,        //Should we use iAdr_O_Imm or iAdr_O_Pointer
 input wire                            iAdr_O_Type,        //Should we use iAdr_O_Imm or iAdr_O_Pointer
 input wire                            iAdr_O_Set,                   //Should we set 
 input wire                            iAdr_O_Set,                   //Should we set 
 input wire                            iBusCyc_Type,       //Bus cycle type: simple read/write, etc.
 input wire                            iBusCyc_Type,       //Bus cycle type: simple read/write, etc.
 input wire                            iStore,             //Should we store read data into MEM
 input wire                            iStore,             //Should we store read data into MEM
 input wire [`DATA_ROW_WIDTH-1:0]      iReadDataBus,       //MEM Data read bus 1
 input wire [`DATA_ROW_WIDTH-1:0]      iReadDataBus,       //MEM Data read bus 1
 input wire [`DATA_ROW_WIDTH-1:0]      iReadDataBus2,      //MEM Data read bus 2
 input wire [`DATA_ROW_WIDTH-1:0]      iReadDataBus2,      //MEM Data read bus 2
 input wire[`DATA_ADDRESS_WIDTH-1:0]   iAdr_DataWriteBack, //Where in MEM we want to store DAT_I
 input wire[`DATA_ADDRESS_WIDTH-1:0]   iAdr_DataWriteBack, //Where in MEM we want to store DAT_I
 input wire                            iWriteBack_Set,     //We want to set the Write back Address?
 input wire                            iWriteBack_Set,     //We want to set the Write back Address?
 
 
 
 
 output wire[`DATA_ADDRESS_WIDTH-1:0]  oDataReadAddress,
 output wire[`DATA_ADDRESS_WIDTH-1:0]  oDataReadAddress,
 output wire[`DATA_ADDRESS_WIDTH-1:0]  oDataReadAddress2,
 output wire[`DATA_ADDRESS_WIDTH-1:0]  oDataReadAddress2,
 output wire[`DATA_ADDRESS_WIDTH-1:0]  oDataWriteAddress,
 output wire[`DATA_ADDRESS_WIDTH-1:0]  oDataWriteAddress,
 output wire                           oDataWriteEnable,
 output wire                           oDataWriteEnable,
 output wire [`DATA_ROW_WIDTH-1:0]     oDataBus,
 output wire [`DATA_ROW_WIDTH-1:0]     oDataBus,
 output wire [`INSTRUCTION_WIDTH-1:0]  oInstructionBus,
 output wire [`INSTRUCTION_WIDTH-1:0]  oInstructionBus,
 output wire                           oInstructionWriteEnable,
 output wire                           oInstructionWriteEnable,
 output wire [`ROM_ADDRESS_WIDTH-1:0]  oInstructionWriteAddress,
 output wire [`ROM_ADDRESS_WIDTH-1:0]  oInstructionWriteAddress,
 inout wire [`WIDTH-1:0]               oData,
 inout wire [`WIDTH-1:0]               oData,
 output wire                           oBusy,
 output wire                           oBusy,
 output wire                           oDone,
 output wire                           oDone,
 //Theia specific interfaces
 //Theia specific interfaces
 input wire MST_I,
 input wire MST_I,
 //Wish Bone Interfaces
 //Wish Bone Interfaces
output wire [31:0]   DAT_O,
output wire [31:0]   DAT_O,
input wire [31:0]    DAT_I,
input wire [31:0]    DAT_I,
input wire           ACK_I,
input wire           ACK_I,
output wire          ACK_O,
output wire          ACK_O,
output wire [31:0]   ADR_O,
output wire [31:0]   ADR_O,
output wire [31:0]   ADR_I,
output wire [31:0]   ADR_I,
output wire          WE_O,
output wire          WE_O,
input wire           WE_I,
input wire           WE_I,
output wire          STB_O,
output wire          STB_O,
input wire           STB_I,
input wire           STB_I,
output wire          CYC_O,
output wire          CYC_O,
input wire           CYC_I,
input wire           CYC_I,
input wire  [1:0]    TGA_I,
input wire  [1:0]    TGA_I,
output wire     [1:0]    TGC_O,
output wire     [1:0]    TGC_O,
input wire           GNT_I
input wire           GNT_I
);
);
 
 
 
 
wire [`WIDTH-1:0]          wMEMToWBM2__ReadDataElement;
wire [`WIDTH-1:0]          wMEMToWBM2__ReadDataElement;
wire [`WIDTH-1:0]          wMEMToWBM2__ReadDataElement2;
wire [`WIDTH-1:0]          wMEMToWBM2__ReadDataElement2;
wire                       wMEMToWBM_2__Enable;
wire                       wMEMToWBM_2__Enable;
wire                       wWBMToMEM2__Done;
wire                       wWBMToMEM2__Done;
wire                       wWBM_2_WBMToMEM_DataAvailable;
wire                       wWBM_2_WBMToMEM_DataAvailable;
wire [`WIDTH-1:0]          wWBM_2_WBMToMEM_Data;
wire [`WIDTH-1:0]          wWBM_2_WBMToMEM_Data;
wire [`WIDTH-1:0]          wWBS_2__WBMToMEM_Frame;
wire [`WIDTH-1:0]          wWBS_2__WBMToMEM_Frame;
wire                       wWBMToMEM_2_WBM_Enable;
wire                       wWBMToMEM_2_WBM_Enable;
wire [`WIDTH-1:0]          wWBMToMEM_2_WBM_Address;
wire [`WIDTH-1:0]          wWBMToMEM_2_WBM_Address;
wire                       wWBMToMEM2__oDataWriteEnable;
wire                       wWBMToMEM2__oDataWriteEnable;
wire                       wAddrerssSelector2_oDataWriteEnable;
wire                       wAddrerssSelector2_oDataWriteEnable;
wire [`DATA_ROW_WIDTH-1:0] wWBMToMEM2__oDataBus;
wire [`DATA_ROW_WIDTH-1:0] wWBMToMEM2__oDataBus;
wire [`DATA_ROW_WIDTH-1:0] wWBSToMEM2__oDataBus;
wire [`DATA_ROW_WIDTH-1:0] wWBSToMEM2__oDataBus;
wire                       wAddressSelector_2__SetAddress;
wire                       wAddressSelector_2__SetAddress;
wire [`WIDTH-1:0]          wMEMToWBM_2__Address;
wire [`WIDTH-1:0]          wMEMToWBM_2__Address;
wire                       wMEMToWBM_2__Done;
wire                       wMEMToWBM_2__Done;
wire                       w2WBMToMEM__Enable;
wire                       w2WBMToMEM__Enable;
wire                       w2WBMToMEM__SetAddress;
wire                       w2WBMToMEM__SetAddress;
wire                       wWBS_2__WBSToMEM_FrameAvailable;
wire                       wWBS_2__WBSToMEM_FrameAvailable;
wire[`WIDTH-1:0]           wWBS_2__WBMToMEM_Address;
wire[`WIDTH-1:0]           wWBS_2__WBMToMEM_Address;
wire                       wWBSToMEM2__oDataWriteEnable;
wire                       wWBSToMEM2__oDataWriteEnable;
wire[`DATA_ADDRESS_WIDTH-1:0] wWBSToMEM2__oDataWriteAddress;
wire[`DATA_ADDRESS_WIDTH-1:0] wWBSToMEM2__oDataWriteAddress;
wire[`DATA_ADDRESS_WIDTH-1:0] wWBMToMEM2__oDataWriteAddress;
wire[`DATA_ADDRESS_WIDTH-1:0] wWBMToMEM2__oDataWriteAddress;
 
 
 
 
assign oBusy = CYC_O;
assign oBusy = CYC_O;
wire wReadOperation;
wire wReadOperation;
assign wReadOperation = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? 0 : 1;
assign wReadOperation = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? 0 : 1;
 
 
 
 
assign wMEMToWBM_2__Address    = ( iAdr_O_Type == `ADR_IMM ) ? iAdr_O_Imm  : wMEMToWBM2__ReadDataElement;
assign wMEMToWBM_2__Address    = ( iAdr_O_Type == `ADR_IMM ) ? iAdr_O_Imm  : wMEMToWBM2__ReadDataElement;
assign w2WBMToMEM__Enable    = ( iAdr_O_Type == `ADR_IMM ) ? iEnable       : wMEMToWBM_2__Enable;
assign w2WBMToMEM__Enable    = ( iAdr_O_Type == `ADR_IMM ) ? iEnable       : wMEMToWBM_2__Enable;
//assign oDone                  = ( (iAdr_O_Type == `ADR_IMM) && !(iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ) 
//assign oDone                  = ( (iAdr_O_Type == `ADR_IMM) && !(iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ) 
//? wWBMToMEM2__Done : wMEMToWBM_2__Done;
//? wWBMToMEM2__Done : wMEMToWBM_2__Done;
 
 
//TODO: WHEN ADR_POINTER Then Done is not until we got the 3 values from X,Y,Z in iAdr_O_Pointer
//TODO: WHEN ADR_POINTER Then Done is not until we got the 3 values from X,Y,Z in iAdr_O_Pointer
assign oDone = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE || iAdr_O_Type == `ADR_POINTER ) ? wMEMToWBM_2__Done : wWBMToMEM2__Done;
assign oDone = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE || iAdr_O_Type == `ADR_POINTER ) ? wMEMToWBM_2__Done : wWBMToMEM2__Done;
 
 
assign oDataWriteEnable  = (MST_I == 1'b1) ? wWBSToMEM2__oDataWriteEnable : (wWBMToMEM2__oDataWriteEnable);// ^ wAddrerssSelector2_oDataWriteEnable);
assign oDataWriteEnable  = (MST_I == 1'b1) ? wWBSToMEM2__oDataWriteEnable : (wWBMToMEM2__oDataWriteEnable);// ^ wAddrerssSelector2_oDataWriteEnable);
assign oDataWriteAddress = (MST_I == 1'b1) ? wWBSToMEM2__oDataWriteAddress : wWBMToMEM2__oDataWriteAddress;
assign oDataWriteAddress = (MST_I == 1'b1) ? wWBSToMEM2__oDataWriteAddress : wWBMToMEM2__oDataWriteAddress;
assign oDataBus          = (MST_I == 1'b1) ? wWBSToMEM2__oDataBus : wWBMToMEM2__oDataBus;
assign oDataBus          = (MST_I == 1'b1) ? wWBSToMEM2__oDataBus : wWBMToMEM2__oDataBus;
 
 
 
 
 
 
 
 
 
 
 wire [`DATA_ADDRESS_WIDTH-1:0] wMEMToWBM2_WBMToMEM_RAMWriteAddr;
 wire [`DATA_ADDRESS_WIDTH-1:0] wMEMToWBM2_WBMToMEM_RAMWriteAddr;
 wire [`DATA_ADDRESS_WIDTH-1:0] w2WBMToMEM_MEMWriteAddress;
 wire [`DATA_ADDRESS_WIDTH-1:0] w2WBMToMEM_MEMWriteAddress;
 
 
assign w2WBMToMEM_MEMWriteAddress = ( iAdr_O_Type == `ADR_IMM) ? iAdr_DataWriteBack : wMEMToWBM2_WBMToMEM_RAMWriteAddr;
assign w2WBMToMEM_MEMWriteAddress = ( iAdr_O_Type == `ADR_IMM) ? iAdr_DataWriteBack : wMEMToWBM2_WBMToMEM_RAMWriteAddr;
 
 
wire w2MEMToWBM_BusOperationComplete;
wire w2MEMToWBM_BusOperationComplete;
assign w2MEMToWBM_BusOperationComplete = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? ACK_I  :  wWBMToMEM2__Done;
assign w2MEMToWBM_BusOperationComplete = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? ACK_I  :  wWBMToMEM2__Done;
 
 
 
 
wire [`DATA_ADDRESS_WIDTH-1:0] w2MEMToWBM_DataPointer;
wire [`DATA_ADDRESS_WIDTH-1:0] w2MEMToWBM_DataPointer;
assign w2MEMToWBM_DataPointer = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? iDat_O_Pointer : iAdr_O_Pointer;
assign w2MEMToWBM_DataPointer = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? iDat_O_Pointer : iAdr_O_Pointer;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
MEM2WBMUnitB MEMToWBM
MEM2WBMUnitB MEMToWBM
(
(
.Clock(                        Clock                                           ),
.Clock(                        Clock                                           ),
.Reset(                        Reset                                           ),
.Reset(                        Reset                                           ),
.iEnable(                      iEnable & (~iAdr_O_Type | iBusCyc_Type)         ),
.iEnable(                      iEnable & (~iAdr_O_Type | iBusCyc_Type)         ),
.iMEMDataPointer(           w2MEMToWBM_DataPointer                          ),
.iMEMDataPointer(           w2MEMToWBM_DataPointer                          ),
.iMEMDataPointer2(           iAdr_O_Pointer                          ),
.iMEMDataPointer2(           iAdr_O_Pointer                          ),
.iReadDataBus(                 iReadDataBus                                                                     ),   //3 Elements comming from DMEM
.iReadDataBus(                 iReadDataBus                                                                     ),   //3 Elements comming from DMEM
.iReadDataBus2(                iReadDataBus2                                   ),
.iReadDataBus2(                iReadDataBus2                                   ),
.oReadDataElement(             wMEMToWBM2__ReadDataElement                     ),       //1 out of 3 elements we read
.oReadDataElement(             wMEMToWBM2__ReadDataElement                     ),       //1 out of 3 elements we read
.oReadDataElement2(            wMEMToWBM2__ReadDataElement2                     ),      //1 out of 3 elements we read
.oReadDataElement2(            wMEMToWBM2__ReadDataElement2                     ),      //1 out of 3 elements we read
.oDataReadAddress(              oDataReadAddress                                ),
.oDataReadAddress(              oDataReadAddress                                ),
.oDataReadAddress2(              oDataReadAddress2                             ),
.oDataReadAddress2(              oDataReadAddress2                             ),
.oDataWriteEnable(              wAddrerssSelector2_oDataWriteEnable             ),   //Always zero
.oDataWriteEnable(              wAddrerssSelector2_oDataWriteEnable             ),   //Always zero
.oDataAvailable(              wMEMToWBM_2__Enable                             ),    //Data from MEM available
.oDataAvailable(              wMEMToWBM_2__Enable                             ),    //Data from MEM available
.iRequestNextElement(          w2MEMToWBM_BusOperationComplete                 ),
.iRequestNextElement(          w2MEMToWBM_BusOperationComplete                 ),
.iDataInitialStorageAddress(    iAdr_DataWriteBack                              ), ////########
.iDataInitialStorageAddress(    iAdr_DataWriteBack                              ), ////########
.oDataWriteAddress(             wMEMToWBM2_WBMToMEM_RAMWriteAddr        ), ////########
.oDataWriteAddress(             wMEMToWBM2_WBMToMEM_RAMWriteAddr        ), ////########
.oDone(                        wMEMToWBM_2__Done                               )
.oDone(                        wMEMToWBM_2__Done                               )
);
);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
wire [`DATA_ADDRESS_WIDTH-1:0] wTemp1;
wire [`DATA_ADDRESS_WIDTH-1:0] wTemp1;
 assign wWBMToMEM2__oDataWriteAddress = (iAdr_O_Type == `ADR_IMM) ? iAdr_DataWriteBack : wTemp1;
 assign wWBMToMEM2__oDataWriteAddress = (iAdr_O_Type == `ADR_IMM) ? iAdr_DataWriteBack : wTemp1;
WBM2MEMUnit WBMToMEM
WBM2MEMUnit WBMToMEM
(
(
.Clock(                 Clock                                     ),
.Clock(                 Clock                                     ),
.Reset(                 Reset                                     ),
.Reset(                 Reset                                     ),
.iEnable(              w2WBMToMEM__Enable & (wReadOperation | MST_I)  ), //Don't write stuff to MEM unless is Read bus cycle
.iEnable(              w2WBMToMEM__Enable & (wReadOperation | MST_I)  ), //Don't write stuff to MEM unless is Read bus cycle
 
 
.iStore(                iStore | ~iAdr_O_Type                     ),
.iStore(                iStore | ~iAdr_O_Type                     ),
.iWriteBack_Set( iWriteBack_Set ),
.iWriteBack_Set( iWriteBack_Set ),
.iAdr_DataWriteBack(w2WBMToMEM_MEMWriteAddress              ),
.iAdr_DataWriteBack(w2WBMToMEM_MEMWriteAddress              ),
//.iAdr_DataWriteBack(      iAdr_DataWriteBack ),
//.iAdr_DataWriteBack(      iAdr_DataWriteBack ),
.iWBMDataAvailable(     wWBM_2_WBMToMEM_DataAvailable             ),
.iWBMDataAvailable(     wWBM_2_WBMToMEM_DataAvailable             ),
.iWBMData(              wWBM_2_WBMToMEM_Data                      ),
.iWBMData(              wWBM_2_WBMToMEM_Data                      ),
 
 
.oDataBus(               wWBMToMEM2__oDataBus                     ),
.oDataBus(               wWBMToMEM2__oDataBus                     ),
.oData(                 oData                                     ),
.oData(                 oData                                     ),
.oEnableWBM(           wWBMToMEM_2_WBM_Enable                   ),
.oEnableWBM(           wWBMToMEM_2_WBM_Enable                   ),
.oDataWriteAddress(      wTemp1            ),///*******************!!!!!!!!!!!!!!
.oDataWriteAddress(      wTemp1            ),///*******************!!!!!!!!!!!!!!
.oDataWriteEnable(       wWBMToMEM2__oDataWriteEnable             ),
.oDataWriteEnable(       wWBMToMEM2__oDataWriteEnable             ),
.oDone(                 wWBMToMEM2__Done                          )
.oDone(                 wWBMToMEM2__Done                          )
);
);
 
 
 
 
 
 
wire [`WIDTH-1:0] wADR_O_InitialAddress;
wire [`WIDTH-1:0] wADR_O_InitialAddress;
assign wADR_O_InitialAddress = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? wMEMToWBM2__ReadDataElement2 : wMEMToWBM_2__Address;
assign wADR_O_InitialAddress = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? wMEMToWBM2__ReadDataElement2 : wMEMToWBM_2__Address;
wire wIncrement_Address_O;
wire wIncrement_Address_O;
assign wIncrement_Address_O = iEnable & ACK_I;
assign wIncrement_Address_O = iEnable & ACK_I;
 
 
 
 
 
 
wire                 wMEMToWBM2__Done;
wire                 wMEMToWBM2__Done;
wire                 wMEMToWBM2__Trigger;
wire                 wMEMToWBM2__Trigger;
wire[`WB_WIDTH-1:0]  wMEMToWBM_2_Data;
wire[`WB_WIDTH-1:0]  wMEMToWBM_2_Data;
wire                 w2MEMToWBM__Trigger;
wire                 w2MEMToWBM__Trigger;
wire                 wWBM2_MEMToWBM_DataWriteDone;
wire                 wWBM2_MEMToWBM_DataWriteDone;
 
 
 
 
wire w2WBM_iEnable;
wire w2WBM_iEnable;
 
 
assign w2WBM_iEnable = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? wMEMToWBM_2__Enable : iEnable;
assign w2WBM_iEnable = (iBusCyc_Type == `WB_SIMPLE_WRITE_CYCLE) ? wMEMToWBM_2__Enable : iEnable;
 
 
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
wire wSTB_O;
wire wSTB_O;
 
 
//If the address is a pointer, we need 1 cycle to read the data back from MEM
//If the address is a pointer, we need 1 cycle to read the data back from MEM
//before we can the set the value into WBM
//before we can the set the value into WBM
wire wAddress_Set_Delayed;
wire wAddress_Set_Delayed;
FFD_POSEDGE_SYNCRONOUS_RESET # (1) FFD32_SetDelay
FFD_POSEDGE_SYNCRONOUS_RESET # (1) FFD32_SetDelay
(
(
        .Clock(         Clock ),
        .Clock(         Clock ),
        .Reset(         Reset ),
        .Reset(         Reset ),
        .Enable( 1'b1 ),
        .Enable( 1'b1 ),
        .D( iAdr_O_Set ),
        .D( iAdr_O_Set ),
        .Q( wAddress_Set_Delayed )
        .Q( wAddress_Set_Delayed )
 
 
);
);
 
 
//If the Addr is IMM then just set it whenever iAdr_O_Set is set, but if we have a pointer, then use
//If the Addr is IMM then just set it whenever iAdr_O_Set is set, but if we have a pointer, then use
//wAddress_Set_Delayed at the beginning and then wWBMToMEM2__Done
//wAddress_Set_Delayed at the beginning and then wWBMToMEM2__Done
wire wWBM_iAddress_Set = (iAdr_O_Type == `ADR_POINTER) ? (wAddress_Set_Delayed | wWBMToMEM2__Done) :    iAdr_O_Set;
wire wWBM_iAddress_Set = (iAdr_O_Type == `ADR_POINTER) ? (wAddress_Set_Delayed | wWBMToMEM2__Done) :    iAdr_O_Set;
 
 
assign STB_O = wSTB_O & ~oDone;
assign STB_O = wSTB_O & ~oDone;
 
 
        WishBoneMasterUnit WBM
        WishBoneMasterUnit WBM
        (
        (
                .CLK_I(         Clock ),
                .CLK_I(         Clock ),
                .RST_I(         Reset ),
                .RST_I(         Reset ),
                .DAT_I(         DAT_I ),
                .DAT_I(         DAT_I ),
                .DAT_O(  DAT_O ),
                .DAT_O(  DAT_O ),
                .ACK_I(         ACK_I  ),
                .ACK_I(         ACK_I  ),
                .ADR_O(         ADR_O ),
                .ADR_O(         ADR_O ),
                .WE_O(  WE_O ),
                .WE_O(  WE_O ),
                .STB_O( wSTB_O ),
                .STB_O( wSTB_O ),
                .CYC_O( CYC_O   ),
                .CYC_O( CYC_O   ),
                .TGC_O( TGC_O   ),
                .TGC_O( TGC_O   ),
                .GNT_I(  GNT_I ),
                .GNT_I(  GNT_I ),
 
 
                .iEnable(                       w2WBM_iEnable       ),
                .iEnable(                       w2WBM_iEnable       ),
                .iBusCyc_Type(    iBusCyc_Type                     ),
                .iBusCyc_Type(    iBusCyc_Type                     ),
                .iAddress_Set(  wWBM_iAddress_Set  ),
                .iAddress_Set(  wWBM_iAddress_Set  ),
                .iAddress(            wADR_O_InitialAddress            ),
                .iAddress(            wADR_O_InitialAddress            ),
                .oDataReady(            wWBM_2_WBMToMEM_DataAvailable    ),
                .oDataReady(            wWBM_2_WBMToMEM_DataAvailable    ),
                .iData(           wMEMToWBM2__ReadDataElement      ),
                .iData(           wMEMToWBM2__ReadDataElement      ),
                .oData(                                 wWBM_2_WBMToMEM_Data                       )
                .oData(                                 wWBM_2_WBMToMEM_Data                       )
        );
        );
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
WishBoneSlaveUnit WBS
WishBoneSlaveUnit WBS
(
(
 
 
                .CLK_I(         Clock  ),
                .CLK_I(         Clock  ),
                .RST_I(         Reset  ),
                .RST_I(         Reset  ),
                .STB_I(  STB_I  ),
                .STB_I(  STB_I  ),
           .WE_I(   WE_I   ),
           .WE_I(   WE_I   ),
                .DAT_I(  DAT_I  ),
                .DAT_I(  DAT_I  ),
           .ADR_I(  ADR_I  ),
           .ADR_I(  ADR_I  ),
                .TGA_I(  TGA_I  ),
                .TGA_I(  TGA_I  ),
                .ACK_O(  ACK_O  ),
                .ACK_O(  ACK_O  ),
                .CYC_I(  CYC_I  ),
                .CYC_I(  CYC_I  ),
                .MST_I(  MST_I ),
                .MST_I(  MST_I ),
 
 
                .oDataBus(               wWBSToMEM2__oDataBus                    ),
                .oDataBus(               wWBSToMEM2__oDataBus                    ),
                .oInstructionBus(        oInstructionBus                         ),
                .oInstructionBus(        oInstructionBus                         ),
                .oDataWriteAddress(      wWBSToMEM2__oDataWriteAddress           ),
                .oDataWriteAddress(      wWBSToMEM2__oDataWriteAddress           ),
                .oDataWriteEnable(       wWBSToMEM2__oDataWriteEnable            ),
                .oDataWriteEnable(       wWBSToMEM2__oDataWriteEnable            ),
                .oInstructionWriteAddress(      oInstructionWriteAddress         ),
                .oInstructionWriteAddress(      oInstructionWriteAddress         ),
                .oInstructionWriteEnable(       oInstructionWriteEnable          )
                .oInstructionWriteEnable(       oInstructionWriteEnable          )
 
 
 
 
 
 
);
);
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
 
 
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

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