Line 1... |
Line 1... |
/**********************************************************************************
|
|
Theia, Ray Cast Programable graphic Processing Unit.
|
|
Copyright (C) 2010 Diego Valverde (diego.valverde.g@gmail.com)
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
***********************************************************************************/
|
|
|
|
/**********************************************************************************
|
|
Description:
|
|
This is the top level block for THEIA.
|
|
THEIA core has 5 main logical blocks called Units.
|
|
This module implements the interconections between the Units.
|
|
|
|
Units:
|
|
> EXE: Mananges execution logic for the SHADERS.
|
|
> GEO: Manages geometry data structures.
|
|
> IO: Input/Output (Wishbone).
|
|
> MEM: Internal memory, separate for Instructions and data.
|
|
> CONTROL: Main control Finite state machine.
|
|
|
|
Internal Buses:
|
|
THEIA has separate instruction and data buses.
|
|
THEIA avoids using tri-state buses by having separate input/output
|
|
for each bus.
|
|
There are 2 separate data buses since the Data memory
|
|
has a Dual read channel.
|
|
Please see the MEM unit chapter in the documentation for more details.
|
|
|
|
External Buses:
|
|
External buses are managed by the IO Unit.
|
|
External buses follow the wishbone protocol.
|
|
Please see the IO unit chapter in the documentation for more details.
|
|
**********************************************************************************/
|
|
|
|
`timescale 1ns / 1ps
|
`timescale 1ns / 1ps
|
`include "aDefinitions.v"
|
`include "aDefinitions.v"
|
|
|
module THEIACORE
|
//---------------------------------------------------------------------------
|
|
module THEIA
|
(
|
(
|
|
|
input wire CLK_I, //Input clock
|
input wire CLK_I, //Input clock
|
input wire RST_I, //Input reset
|
input wire RST_I, //Input reset
|
//Theia Interfaces
|
//Theia Interfaces
|
Line 71... |
Line 25... |
input wire CYC_I, //Bus cycle signal, see wishbone documentation
|
input wire CYC_I, //Bus cycle signal, see wishbone documentation
|
output wire [1:0] TGC_O, //Bus cycle tag, see THEAI documentation
|
output wire [1:0] TGC_O, //Bus cycle tag, see THEAI documentation
|
input wire [1:0] TGA_I, //Input address tag, see THEAI documentation
|
input wire [1:0] TGA_I, //Input address tag, see THEAI documentation
|
output wire [1:0] TGA_O, //Output address tag, see THEAI documentation
|
output wire [1:0] TGA_O, //Output address tag, see THEAI documentation
|
input wire [1:0] TGC_I, //Bus cycle tag, see THEAI documentation
|
input wire [1:0] TGC_I, //Bus cycle tag, see THEAI documentation
|
|
input wire [`MAX_CORES-1:0] SEL_I, //The WishBone Master uses this signal to configure a specific core (TBD, not sure is needed)
|
|
input wire [`MAX_CORES-1:0] RENDREN_I,
|
//Control Register
|
//Control Register
|
input wire [15:0] CREG_I
|
input wire [15:0] CREG_I,
|
|
output wire DONE_O
|
|
|
);
|
);
|
|
|
//Alias this signals
|
|
wire Clock,Reset;
|
|
assign Clock = CLK_I;
|
|
assign Reset = RST_I;
|
|
|
|
wire [`DATA_ROW_WIDTH-1:0] wEXE_2__MEM_WriteData;
|
|
wire [`DATA_ROW_WIDTH-1:0] wUCODE_RAMBus;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wEXE_2__MEM_wDataWriteAddress;
|
|
wire w2IO__AddrIsImm;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wUCODE_RAMAddress;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] w2IO__Adr_O_Pointer;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wGEO2_IO__Adr_O_Pointer;
|
|
wire wEXE_2__DataWriteEnable;
|
|
wire wUCODE_RAMWriteEnable;
|
|
wire [2:0] RamBusOwner;
|
|
//Unit intercoanection wires
|
|
|
|
wire wCU2__MicrocodeExecutionDone;
|
|
wire [`ROM_ADDRESS_WIDTH-1:0] InitialCodeAddress;
|
|
wire [`ROM_ADDRESS_WIDTH-1:0] wInstructionPointer1,wInstructionPointer2;
|
|
wire [`INSTRUCTION_WIDTH-1:0] wEncodedInstruction1,wEncodedInstruction2,wIO2_MEM__ExternalInstruction;
|
|
wire wCU2__ExecuteMicroCode;
|
|
wire [`ROM_ADDRESS_WIDTH-1:0] wIO2_MEM__InstructionWriteAddr;
|
|
wire [95:0] wMEM_2__EXE_DataRead0, wMEM_2__EXE_DataRead1,wMEM_2__IO_DataRead0, wMEM_2__IO_DataRead1;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wEXE_2__MEM_DataReadAddress0,wEXE_2__MEM_DataReadAddress1;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wUCODE_RAMReadAddress0,wUCODE_RAMReadAddress1;
|
|
|
|
|
|
wire [`WIDTH-1:0] w2IO__AddressOffset;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] w2IO__DataWriteAddress;
|
|
wire w2IO__Store;
|
|
wire w2IO__EnableWBMaster;
|
|
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wIO2_MEM__DataWriteAddress;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wIO_2_MEM__DataReadAddress0;
|
|
wire [`DATA_ROW_WIDTH-1:0] wIO2_MEM__Bus;
|
|
wire [`WIDTH-1:0] wIO2_MEM__Data;
|
|
wire [`WIDTH-1:0] wIO2_WBM__Address;
|
|
wire wIO2_MEM__DataWriteEnable;
|
|
wire wIO2__Done;
|
|
wire wCU2_GEO__GeometryFetchEnable;
|
|
wire wIFU2__MicroCodeReturnValue;
|
|
wire wCU2_BCU__ACK;
|
|
wire wGEO2_CU__RequestAABBIU;
|
|
wire wGEO2_CU__RequestBIU;
|
|
wire wGEO2_CU__RequestTCC;
|
|
wire wGEO2_CU__GeometryUnitDone;
|
|
wire wGEO2_CU__Sync;
|
|
wire wEXE2__uCodeDone;
|
|
wire wEXE2_IFU__EXEBusy;
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wEXE2_IDU_DataFordward_LastDestination;
|
|
wire wALU2_EXE__BranchTaken;
|
|
wire wALU2_IFU_BranchNotTaken;
|
|
wire w2IO__SetAddress;
|
|
wire wIDU2_IFU__IDUBusy;
|
|
//Control Registe wires
|
|
wire[15:0] wCR2_ControlRegister;
|
|
wire wCR2_TextureMappingEnabled;
|
|
wire wGEO2_CU__TFFDone;
|
|
wire wCU2_GEO__TriggerTFF;
|
|
wire wIO2_MEM_InstructionWriteEnable;
|
|
wire wCU2_IO__WritePixel;
|
|
wire wGEO2_IO__AddrIsImm;
|
|
wire[31:0] wGEO2_IO__AddressOffset;
|
|
wire wGEO2_IO__EnableWBMaster;
|
|
wire wGEO2_IO__SetAddress;
|
|
wire[`WIDTH-1:0] wGEO2__CurrentPitch,wCU2_GEO_Pitch;
|
|
wire wCU2_GEO__SetPitch,wCU2_GEO__IncPicth;
|
|
wire wCU2_FlipMemEnabled;
|
|
wire w2MEM_FlipMemory;
|
|
|
|
`ifdef DEBUG
|
|
wire [`ROM_ADDRESS_WIDTH-1:0] wDEBUG_IDU2_EXE_InstructionPointer;
|
|
`endif
|
|
//--------------------------------------------------------
|
|
|
|
|
|
/*
|
|
///////////////// TODO CHANGE FOR MUXES ////////////////////////////////
|
|
assign wEXE_2__MEM_WriteData = ( RamBusOwner == `REG_BUS_OWNED_BY_UCODE ) ?
|
|
wUCODE_RAMBus : `DATA_ROW_WIDTH'bz;
|
|
|
|
assign wEXE_2__MEM_WriteData = ( RamBusOwner == `REG_BUS_OWNED_BY_GFU || MST_I == 1'b1) ?
|
|
wIO2_MEM__Bus : `DATA_ROW_WIDTH'bz;
|
|
|
|
assign wEXE_2__MEM_wDataWriteAddress = ( RamBusOwner == `REG_BUS_OWNED_BY_UCODE ) ?
|
|
wUCODE_RAMAddress : `DATA_ADDRESS_WIDTH'bz;
|
|
|
|
assign wEXE_2__MEM_wDataWriteAddress = ( RamBusOwner == `REG_BUS_OWNED_BY_GFU || MST_I == 1'b1) ?
|
|
wIO2_MEM__DataWriteAddress : `DATA_ADDRESS_WIDTH'bz;
|
|
|
|
|
|
MUXFULLPARALELL_2SEL_GENERIC # ( `DATA_ADDRESS_WIDTH ) MUX_RA0
|
|
(
|
|
.Sel(RamBusOwner[1:0]),
|
|
.I1(`DATA_ADDRESS_WIDTH'b0),
|
|
.I2(wIO_2_MEM__DataReadAddress0),
|
|
.I3(wUCODE_RAMReadAddress0),
|
|
.O1(wEXE_2__MEM_DataReadAddress0)
|
|
);
|
|
|
|
|
wire [`MAX_CORES-1:0] wDone;
|
|
wire [`MAX_CORES-1:0] wBusGranted,wBusRequest;
|
|
wire [`WB_WIDTH-1:0] wDAT_O_0,wDAT_O_1,wDAT_O_2,wDAT_O_3;
|
|
wire [`WB_WIDTH-1:0] wADR_O_0,wADR_O_1,wADR_O_2,wADR_O_3;
|
|
wire [1:0] wTGA_O_0,wTGA_O_1,wTGA_O_2,wTGA_O_3;
|
|
wire [1:0] wBusSelect;
|
|
|
|
//wire wSTB_O_0,wSTB_O_1,wSTB_O_2,wSTB_O_3;
|
|
//wire wWE_O_0,wWE_O_1,wWE_O_2,wWE_O_3;
|
|
|
|
wire [`MAX_CORES-1:0] wSTB_O,wWE_O;
|
|
|
|
wire wACK_O_0,wACK_O_1,wACK_O_2,wACK_O_3;
|
|
|
|
wire [`MAX_CORES-1:0] wSTB_I;
|
|
wire [`MAX_CORES-1:0] wMST_I;
|
|
wire [`MAX_CORES-1:0] wACK_I;
|
|
wire [`MAX_CORES-1:0] wCYC_I;
|
|
wire [1:0] wTGA_I[`MAX_CORES-1:0];
|
|
|
assign wEXE_2__DataWriteEnable = ( RamBusOwner == `REG_BUS_OWNED_BY_UCODE && MST_I == 1'b0) ?
|
//assign DONE_O = wDone[0] & wDone[1] & wDone[2] & wDone[3];
|
wUCODE_RAMWriteEnable : 1'bz;
|
//assign DONE_O = wDone[1];
|
|
assign DONE_O = wDone[0] & wDone[1];
|
|
|
assign wEXE_2__DataWriteEnable = ( RamBusOwner == `REG_BUS_OWNED_BY_GFU || MST_I == 1'b1) ?
|
//----------------------------------------------------------------
|
wIO2_MEM__DataWriteEnable : 1'bz;
|
// assign wDone[3:1] = 3'b111;
|
*/
|
assign wBusRequest[3:2] = 0;
|
assign wCR2_TextureMappingEnabled = wCR2_ControlRegister[ `CR_EN_TEXTURE ];
|
assign wSTB_O[3:2] = 0;
|
wire wCU2_FlipMem;
|
assign wWE_O[3:2] = 0;
|
//--------------------------------------------------------
|
Module_BusArbitrer ARB1
|
//Control Unit Instance
|
|
ControlUnit CU
|
|
(
|
(
|
.Clock(Clock),
|
.Clock( CLK_I ),
|
.Reset(Reset),
|
.Reset( RST_I ),
|
.oFlipMemEnabled( wCU2_FlipMemEnabled ),
|
.iRequest( wBusRequest ),
|
.oFlipMem( wCU2_FlipMem ),
|
.oGrant( wBusGranted ),
|
.iControlRegister( wCR2_ControlRegister ),
|
.oBusSelect( wBusSelect )
|
.oRamBusOwner( RamBusOwner ),
|
|
.oGFUEnable( wCU2_GEO__GeometryFetchEnable ),
|
|
.iTriggerAABBIURequest( wGEO2_CU__RequestAABBIU ),
|
|
.iTriggerBIURequest( wGEO2_CU__RequestBIU ),
|
|
.iTriggertTCCRequest( wGEO2_CU__RequestTCC ),
|
|
.oUCodeEnable( wCU2__ExecuteMicroCode ),
|
|
.oCodeInstructioPointer( InitialCodeAddress ),
|
|
.iUCodeDone( wCU2__MicrocodeExecutionDone ),
|
|
.iIODone( wIO2__Done ),
|
|
.oIOWritePixel( wCU2_IO__WritePixel ),
|
|
.iUCodeReturnValue( wIFU2__MicroCodeReturnValue ),
|
|
.iGEOSync( wGEO2_CU__Sync ),
|
|
.iTFFDone( wGEO2_CU__TFFDone ),
|
|
.oTriggerTFF( wCU2_GEO__TriggerTFF ),
|
|
.MST_I( MST_I ),
|
|
.oSetCurrentPitch( wCU2_GEO__SetPitch ),
|
|
.iGFUDone( wGEO2_CU__GeometryUnitDone )
|
|
|
|
);
|
);
|
|
//----------------------------------------------------------------
|
|
//The Muxes
|
|
//DAT_O Mux
|
|
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX_DAT_O
|
//--------------------------------------------------------
|
|
|
|
//assign w2MEM_FlipMemory = (wCU2__ExecuteMicroCode | wCU2_FlipMem ) & wCU2_FlipMemEnabled;
|
|
assign w2MEM_FlipMemory = wCU2_FlipMem & wCU2_FlipMemEnabled;
|
|
MemoryUnit MEM
|
|
(
|
(
|
.Clock(Clock),
|
.Sel(wBusSelect),
|
.Reset(Reset),
|
.I1(wDAT_O_0),
|
|
.I2(wDAT_O_1),
|
.iFlipMemory( w2MEM_FlipMemory ),
|
.I3(wDAT_O_2),
|
|
.I4(wDAT_O_3),
|
//Data Bus to/from EXE
|
.O1( DAT_O )
|
.iDataReadAddress1_EXE( wEXE_2__MEM_DataReadAddress0 ),
|
);
|
.iDataReadAddress2_EXE( wEXE_2__MEM_DataReadAddress1 ),
|
|
.oData1_EXE( wMEM_2__EXE_DataRead0 ),
|
|
.oData2_EXE( wMEM_2__EXE_DataRead1 ),
|
|
.iDataWriteEnable_EXE( wEXE_2__DataWriteEnable ),
|
|
.iDataWriteAddress_EXE( wEXE_2__MEM_wDataWriteAddress ),
|
|
.iData_EXE( wEXE_2__MEM_WriteData ),
|
|
|
|
//Data Bus to/from IO
|
|
|
|
.iDataReadAddress1_IO( wIO_2_MEM__DataReadAddress0 ),
|
|
.iDataReadAddress2_IO( wIO_2_MEM__DataReadAddress1 ),
|
|
.oData1_IO( wMEM_2__IO_DataRead0 ),
|
|
.oData2_IO( wMEM_2__IO_DataRead1 ),
|
|
.iDataWriteEnable_IO( wIO2_MEM__DataWriteEnable ),
|
|
.iDataWriteAddress_IO( wIO2_MEM__DataWriteAddress ),
|
|
.iData_IO( wIO2_MEM__Bus ),
|
|
|
|
|
|
//Instruction Bus
|
|
.iInstructionReadAddress1( wInstructionPointer1 ),
|
|
.iInstructionReadAddress2( wInstructionPointer2 ),
|
|
.oInstruction1( wEncodedInstruction1 ),
|
|
.oInstruction2( wEncodedInstruction2 ),
|
|
.iInstructionWriteEnable( wIO2_MEM_InstructionWriteEnable ),
|
|
.iInstructionWriteAddress( wIO2_MEM__InstructionWriteAddr ),
|
|
.iInstruction( wIO2_MEM__ExternalInstruction ),
|
|
.iControlRegister( CREG_I ),
|
|
.oControlRegister( wCR2_ControlRegister )
|
|
|
|
|
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX_ADR_O
|
|
(
|
|
.Sel(wBusSelect),
|
|
.I1(wADR_O_0),
|
|
.I2(wADR_O_1),
|
|
.I3(wADR_O_2),
|
|
.I4(wADR_O_3),
|
|
.O1( ADR_O )
|
);
|
);
|
|
|
////--------------------------------------------------------
|
|
|
|
|
|
ExecutionUnit EXE
|
MUXFULLPARALELL_2SEL_GENERIC # ( 1 ) MUX_STB_O
|
(
|
(
|
|
.Sel(wBusSelect),
|
|
.I1(wSTB_O[0]),
|
|
.I2(wSTB_O[1]),
|
|
.I3(wSTB_O[2]),
|
|
.I4(wSTB_O[3]),
|
|
.O1( STB_O )
|
|
);
|
|
|
.Clock( Clock),
|
|
.Reset( Reset ),
|
|
.iInitialCodeAddress( InitialCodeAddress ),
|
|
.iInstruction1( wEncodedInstruction1 ),
|
|
.iInstruction2( wEncodedInstruction2 ),
|
|
.oInstructionPointer1( wInstructionPointer1 ),
|
|
.oInstructionPointer2( wInstructionPointer2 ),
|
|
.iDataRead0( wMEM_2__EXE_DataRead0 ),
|
|
.iDataRead1( wMEM_2__EXE_DataRead1 ),
|
|
.iTrigger( wCU2__ExecuteMicroCode ),
|
|
.oDataReadAddress0( wEXE_2__MEM_DataReadAddress0 ),
|
|
.oDataReadAddress1( wEXE_2__MEM_DataReadAddress1 ),
|
|
.oDataWriteEnable( wEXE_2__DataWriteEnable ),
|
|
.oDataWriteAddress( wEXE_2__MEM_wDataWriteAddress ),
|
|
.oDataBus( wEXE_2__MEM_WriteData ),
|
|
.oReturnCode( wIFU2__MicroCodeReturnValue ),
|
|
.oDone( wCU2__MicrocodeExecutionDone )
|
|
|
|
|
MUXFULLPARALELL_2SEL_GENERIC # ( 1 ) MUX_WE_O
|
|
(
|
|
.Sel(wBusSelect),
|
|
.I1(wWE_O[0]),
|
|
.I2(wWE_O[1]),
|
|
.I3(wWE_O[2]),
|
|
.I4(wWE_O[3]),
|
|
.O1( WE_O )
|
);
|
);
|
|
|
////--------------------------------------------------------
|
|
wire wGEO2__RequestingTextures;
|
|
wire w2IO_WriteBack_Set;
|
|
|
|
GeometryUnit GEO
|
MUXFULLPARALELL_2SEL_GENERIC # ( 2 ) MUX_TGA_O
|
(
|
(
|
.Clock( Clock ),
|
.Sel(wBusSelect),
|
.Reset( Reset ),
|
.I1(wTGA_O_0),
|
.iEnable( wCU2_GEO__GeometryFetchEnable ),
|
.I2(wTGA_O_1),
|
.iTexturingEnable( wCR2_TextureMappingEnabled ),
|
.I3(wTGA_O_2),
|
//Wires from IO
|
.I4(wTGA_O_3),
|
.iData_WBM( wIO2_MEM__Data ),
|
.O1( TGA_O )
|
.iDataReady_WBM( wIO2__Done ),
|
|
//Wires to WBM
|
|
.oAddressWBM_Imm( wGEO2_IO__AddressOffset ),
|
|
.oAddressWBM_fromMEM( wGEO2_IO__Adr_O_Pointer ),
|
|
.oAddressWBM_IsImm( wGEO2_IO__AddrIsImm ),
|
|
.oEnable_WBM( wGEO2_IO__EnableWBMaster ),
|
|
.oSetAddressWBM( wGEO2_IO__SetAddress ),
|
|
.oSetIOWriteBackAddr( w2IO_WriteBack_Set ),
|
|
//Wires to CU
|
|
.oRequest_AABBIU( wGEO2_CU__RequestAABBIU ),
|
|
.oRequest_BIU( wGEO2_CU__RequestBIU ),
|
|
.oRequest_TCC( wGEO2_CU__RequestTCC ),
|
|
.oTFFDone( wGEO2_CU__TFFDone ),
|
|
//Wires to RAM-Bus MUX
|
|
.oRAMWriteAddress( w2IO__DataWriteAddress ),
|
|
.oRAMWriteEnable( w2IO__Store ),
|
|
//Wires from Execution Unit
|
|
.iMicrocodeExecutionDone( wCU2__MicrocodeExecutionDone ),
|
|
.iMicroCodeReturnValue( wIFU2__MicroCodeReturnValue ),
|
|
.oSync( wGEO2_CU__Sync ),
|
|
.iTrigger_TFF( wCU2_GEO__TriggerTFF ),
|
|
.iBIUHit( wIFU2__MicroCodeReturnValue ),
|
|
.oRequestingTextures( wGEO2__RequestingTextures ),
|
|
.oDone( wGEO2_CU__GeometryUnitDone )
|
|
);
|
);
|
|
|
|
|
assign TGA_O = (wGEO2__RequestingTextures) ? 2'b1: 2'b0;
|
assign ACK_O = (wACK_O_0 | wACK_O_1);// | wACK_O_2 | wACK_O_3);
|
//---------------------------------------------------------------------------------------------------
|
|
wire[`DATA_ADDRESS_WIDTH-1:0] wIO_2_MEM__DataReadAddress1;
|
|
assign wEXE_2__MEM_DataReadAddress1 = (wCU2_IO__WritePixel == 0) ? wUCODE_RAMReadAddress1 : wIO_2_MEM__DataReadAddress1;
|
|
assign w2IO__EnableWBMaster = (wCU2_IO__WritePixel == 0 ) ? wGEO2_IO__EnableWBMaster : wCU2_IO__WritePixel;
|
|
assign w2IO__AddrIsImm = (wCU2_IO__WritePixel == 0 ) ? wGEO2_IO__AddrIsImm : 1'b1;
|
|
assign w2IO__AddressOffset = (wCU2_IO__WritePixel == 0 ) ? wGEO2_IO__AddressOffset : 32'b0;
|
|
assign w2IO__Adr_O_Pointer = (wCU2_IO__WritePixel == 0 ) ? wGEO2_IO__Adr_O_Pointer : `OREG_PIXEL_PITCH;
|
|
wire w2IO_MasterCycleType;
|
|
assign w2IO_MasterCycleType = (wCU2_IO__WritePixel) ? `WB_SIMPLE_WRITE_CYCLE : `WB_SIMPLE_READ_CYCLE;
|
|
|
|
|
assign wMST_I[0] = (SEL_I[0]) ? MST_I : 0;
|
|
assign wMST_I[1] = (SEL_I[1]) ? MST_I : 0;
|
|
assign wMST_I[2] = (SEL_I[2]) ? MST_I : 0;
|
|
assign wMST_I[3] = (SEL_I[3]) ? MST_I : 0;
|
|
|
|
assign wSTB_I[0] = (SEL_I[0]) ? STB_I : 0;
|
|
assign wSTB_I[1] = (SEL_I[1]) ? STB_I : 0;
|
|
assign wSTB_I[2] = (SEL_I[2]) ? STB_I : 0;
|
|
assign wSTB_I[3] = (SEL_I[3]) ? STB_I : 0;
|
|
|
assign w2IO__SetAddress = (wCU2_IO__WritePixel == 0 )? wGEO2_IO__SetAddress : wCU2_GEO__SetPitch;
|
assign wCYC_I[0] = (SEL_I[0]) ? CYC_I : 0;
|
|
assign wCYC_I[1] = (SEL_I[1]) ? CYC_I : 0;
|
|
assign wCYC_I[2] = (SEL_I[2]) ? CYC_I : 0;
|
|
assign wCYC_I[3] = (SEL_I[3]) ? CYC_I : 0;
|
|
|
|
assign wTGA_I[0] = (SEL_I[0]) ? TGA_I : 0;
|
|
assign wTGA_I[1] = (SEL_I[1]) ? TGA_I : 0;
|
|
assign wTGA_I[2] = (SEL_I[2]) ? TGA_I : 0;
|
|
assign wTGA_I[3] = (SEL_I[3]) ? TGA_I : 0;
|
|
|
IO_Unit IO
|
//----------------------------------------------------------------
|
|
wire foo;
|
|
assign foo = ACK_I;
|
|
THEIACORE THEIA_CORE0
|
(
|
(
|
.Clock( Clock ),
|
.CLK_I( CLK_I ),
|
.Reset( Reset ),
|
.RST_I( RST_I ),
|
.iEnable( w2IO__EnableWBMaster ),
|
.RENDREN_I( RENDREN_I[0] ),
|
.iBusCyc_Type( w2IO_MasterCycleType ),
|
|
|
|
.iStore( w2IO__Store ),
|
|
.iAdr_DataWriteBack( w2IO__DataWriteAddress ),
|
|
.iAdr_O_Set( w2IO__SetAddress ),
|
|
.iAdr_O_Imm( w2IO__AddressOffset ),
|
|
.iAdr_O_Type( w2IO__AddrIsImm ),
|
|
.iAdr_O_Pointer( w2IO__Adr_O_Pointer ),
|
|
.iReadDataBus( wMEM_2__IO_DataRead0 ),
|
|
.iReadDataBus2( wMEM_2__IO_DataRead1 ),
|
|
.iDat_O_Pointer( `OREG_PIXEL_COLOR ),
|
|
|
|
|
|
.oDataReadAddress( wIO_2_MEM__DataReadAddress0 ),
|
|
.oDataReadAddress2( wIO_2_MEM__DataReadAddress1 ),
|
|
.oDataWriteAddress( wIO2_MEM__DataWriteAddress ),
|
|
.oDataBus( wIO2_MEM__Bus ),
|
|
.oInstructionBus( wIO2_MEM__ExternalInstruction ),
|
|
|
|
.oDataWriteEnable( wIO2_MEM__DataWriteEnable ),
|
|
.oData( wIO2_MEM__Data ),
|
|
.oInstructionWriteEnable( wIO2_MEM_InstructionWriteEnable ),
|
|
.oInstructionWriteAddress( wIO2_MEM__InstructionWriteAddr ),
|
|
.iWriteBack_Set( w2IO_WriteBack_Set ),
|
|
|
|
.oDone( wIO2__Done ),
|
//Slave signals
|
.MST_I( MST_I ),
|
|
//Wish Bone Interface
|
|
.DAT_I( DAT_I ),
|
|
.DAT_O( DAT_O ),
|
|
.ACK_I( ACK_I ),
|
|
.ACK_O( ACK_O ),
|
|
.ADR_O( ADR_O ),
|
|
.ADR_I( ADR_I ),
|
.ADR_I( ADR_I ),
|
.WE_O( WE_O ),
|
|
.WE_I( WE_I ),
|
.WE_I( WE_I ),
|
.STB_O( STB_O ),
|
.STB_I( wSTB_I[0] ),
|
.STB_I( STB_I ),
|
//-----------------------------------
|
.CYC_O( CYC_O ),
|
//This signal behaves in a very funny way...
|
.TGA_I( TGA_I ),
|
//
|
.CYC_I( CYC_I ),
|
.ACK_I( ACK_I ),//& wBusGranted[0] ),//wACK_I[0] ), //WTF??? ok I think it works fine like this...
|
.TGC_O( TGC_O )
|
//-----------------------------------
|
|
.CYC_I( wCYC_I[0] ),
|
|
.MST_I( wMST_I[0] ),
|
|
.TGA_I( wTGA_I[0] ),
|
|
.CREG_I( CREG_I ),
|
|
|
|
//Master Signals
|
|
.WE_O ( wWE_O[0] ),
|
|
.STB_O( wSTB_O[0] ),
|
|
.ACK_O( wACK_O_0 ),
|
|
.DAT_O( wDAT_O_0 ),
|
|
.ADR_O( wADR_O_0 ),
|
|
.CYC_O( wBusRequest[0] ),
|
|
.GNT_I( wBusGranted[0] ),
|
|
.TGA_O( wTGA_O_0 ),
|
|
`ifdef DEBUG
|
|
.iDebug_CoreID( `MAX_CORES'd0 ),
|
|
`endif
|
|
//Other
|
|
.DAT_I( DAT_I ),
|
|
.DONE_O( wDone[0] )
|
|
|
|
);
|
|
//----------------------------------------------------------------
|
|
THEIACORE THEIA_CORE1
|
|
(
|
|
.CLK_I( CLK_I ),
|
|
.RST_I( RST_I ),
|
|
.RENDREN_I( RENDREN_I[1] ),
|
|
|
|
//Slave signals
|
|
.ADR_I( ADR_I ),
|
|
.WE_I( WE_I ),
|
|
.STB_I( wSTB_I[1] ),//ok
|
|
.ACK_I( ACK_I ),//& wBusGranted[1] ),//wACK_I[0] ), //WTF??? ok I think it works fine like this...
|
|
.CYC_I( wCYC_I[1] ),//ok
|
|
.MST_I( wMST_I[1] ),//ok
|
|
.TGA_I( wTGA_I[1] ),//ok
|
|
.CREG_I( CREG_I ),
|
|
|
|
//Master Signals
|
|
.WE_O ( wWE_O[1] ),
|
|
.STB_O( wSTB_O[1] ),
|
|
.ACK_O( wACK_O_1 ),
|
|
.DAT_O( wDAT_O_1 ),
|
|
.ADR_O( wADR_O_1 ),
|
|
.CYC_O( wBusRequest[1] ),
|
|
.GNT_I( wBusGranted[1] ),
|
|
.TGA_O( wTGA_O_1 ),
|
|
`ifdef DEBUG
|
|
.iDebug_CoreID( `MAX_CORES'd1 ),
|
|
`endif
|
|
//Other
|
|
.DAT_I( DAT_I ),
|
|
.DONE_O( wDone[1] )
|
|
|
);
|
);
|
//---------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------
|
|
|
|
|
endmodule
|
endmodule
|
|
//---------------------------------------------------------------------------
|
|
|
No newline at end of file
|
No newline at end of file
|