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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [icarus_version/] [rtl/] [Unit_Control.v] - Diff between revs 174 and 178

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

Rev 174 Rev 178
Line 84... Line 84...
`define CU_DONE 48
`define CU_DONE 48
`define CU_WAIT_FOR_RENDER_ENABLE 49
`define CU_WAIT_FOR_RENDER_ENABLE 49
`define CU_ACK_TCC 50
`define CU_ACK_TCC 50
`define CU_WAIT_FOR_HOST_DATA_AVAILABLE 51
`define CU_WAIT_FOR_HOST_DATA_AVAILABLE 51
`define CU_WAIT_FOR_HOST_DATA_ACK 52
`define CU_WAIT_FOR_HOST_DATA_ACK 52
 
`define CU_COMMIT_PIXEL_RESULT 53
//--------------------------------------------------------------
//--------------------------------------------------------------
module ControlUnit
module ControlUnit
(
(
 
 
input  wire                                  Clock,
input  wire                                  Clock,
Line 568... Line 569...
                oDone                   = 0;
                oDone                   = 0;
                oResultCommited                 = 0;
                oResultCommited                 = 0;
                //oIncCurrentPitch        = 0;
                //oIncCurrentPitch        = 0;
 
 
                if ( iRenderEnable)
                if ( iRenderEnable)
                        NextState = `CU_TRIGGER_RGU;
                        NextState = `CU_WAIT_FOR_HOST_DATA_AVAILABLE;//`CU_TRIGGER_RGU;
                else
                else
                        NextState = `CU_WAIT_FOR_RENDER_ENABLE;
                        NextState = `CU_WAIT_FOR_RENDER_ENABLE;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_TRIGGER_RGU:
        /*
        begin
        `CU_TRIGGER_RGU:
 
        begin
        `ifdef DEBUG_CU
 
                $display("CORE: %d CU_TRIGGER_RGU", iDebug_CoreID);
 
        `endif
 
 
 
 
 
                //oRamBusOwner                          = `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  = `ENTRYPOINT_INDEX_RGU;
 
                oGFUEnable                                      = 0;
 
                oUCodeEnable                            = 1;    //*
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
      oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 0;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 0;
 
                //oIncCurrentPitch        = 0;
 
 
 
                NextState = `CU_WAIT_FOR_RGU;
 
        end
 
        //-----------------------------------------
 
        `CU_WAIT_FOR_RGU:
 
        begin
 
 
 
//      `ifdef DEBUG_CU
 
//              $display("%d Control: CU_WAIT_FOR_RGU\n",$time);
 
//      `endif
 
 
 
                //oRamBusOwner                          = `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  = 0;
 
                oGFUEnable                                      = 0;
 
                oUCodeEnable                            = 0;
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
      oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 0;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 0;
 
                //oIncCurrentPitch        = 0;
 
 
 
                if ( iUCodeDone )
 
                        NextState = `CU_ACK_RGU;
 
                else
 
                        NextState = `CU_WAIT_FOR_RGU;
 
        end
 
        //-----------------------------------------
 
        `CU_ACK_RGU:
 
        begin
 
 
 
        `ifdef DEBUG_CU
 
                $display("CORE: %d CU_ACK_RGU", iDebug_CoreID);
 
        `endif
 
                //oRamBusOwner                          = `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  = 0;
 
                oGFUEnable                                      = 0;
 
                oUCodeEnable                            = 0; //* 
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
      oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 1;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 0;
 
                //oIncCurrentPitch        = 0;
 
 
 
                if ( iUCodeDone  == 0 & iRenderEnable == 1)
        `ifdef DEBUG_CU
                        NextState = `CU_WAIT_FOR_HOST_DATA_AVAILABLE;//`CU_TRIGGER_GEO;///////////// GET RID OF GEO!!!
                $display("CORE: %d CU_TRIGGER_RGU", iDebug_CoreID);
                else
        `endif
                        NextState = `CU_ACK_RGU;
 
 
 
 
                //oRamBusOwner                          = `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  = `ENTRYPOINT_INDEX_RGU;
 
                oGFUEnable                                      = 0;
 
                oUCodeEnable                            = 1;
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
      oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 0;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 0;
 
                //oIncCurrentPitch        = 0;
 
 
 
                NextState = `CU_WAIT_FOR_RGU;
 
        end
 
        //-----------------------------------------
 
        `CU_WAIT_FOR_RGU:
 
        begin
 
 
 
//      `ifdef DEBUG_CU
 
//              $display("%d Control: CU_WAIT_FOR_RGU\n",$time);
 
//      `endif
 
 
 
                //oRamBusOwner                          = `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  = 0;
 
                oGFUEnable                                      = 0;
 
                oUCodeEnable                            = 0;
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
      oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 0;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 0;
 
                //oIncCurrentPitch        = 0;
 
 
 
                if ( iUCodeDone )
 
                        NextState = `CU_ACK_RGU;
 
                else
 
                        NextState = `CU_WAIT_FOR_RGU;
 
        end
 
        //-----------------------------------------
 
        `CU_ACK_RGU:
 
        begin
 
 
 
        `ifdef DEBUG_CU
 
                $display("CORE: %d CU_ACK_RGU", iDebug_CoreID);
 
        `endif
 
                //oRamBusOwner                          = `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  = 0;
 
                oGFUEnable                                      = 0;
 
                oUCodeEnable                            = 0;
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
      oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 1;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 0;
 
                //oIncCurrentPitch        = 0;
 
 
 
                if ( iUCodeDone  == 0 & iRenderEnable == 1)
 
                        NextState = `CU_WAIT_FOR_HOST_DATA_AVAILABLE;//`CU_TRIGGER_GEO;///////////// GET RID OF GEO!!!
 
                else
 
                        NextState = `CU_ACK_RGU;
 
 
        end
        end
 
        */
        //-----------------------------------------
        //-----------------------------------------
        `CU_TRIGGER_TCC:
        `CU_TRIGGER_TCC:
        begin
        begin
        ////$display("CU_TRIGGER_TCC");
        ////$display("CU_TRIGGER_TCC");
        `ifdef DEBUG_CU
        `ifdef DEBUG_CU
Line 937... Line 940...
                        oDone                   = 0;
                        oDone                   = 0;
                        oResultCommited                 = 0;
                        oResultCommited                 = 0;
                        //oIncCurrentPitch        = 0;
                        //oIncCurrentPitch        = 0;
 
 
        //              $stop();
        //              $stop();
 
        /*
                        if ( iUCodeDone == 1'b0 & iSceneTraverseComplete == 1'b1)
                        if ( iUCodeDone == 1'b0 & iSceneTraverseComplete == 1'b1)
                                NextState =  `CU_CHECK_HIT;
                                NextState =  `CU_CHECK_HIT;
                        else if ( iUCodeDone == 1'b0 & iSceneTraverseComplete == 1'b0) //ERROR!!! What if iSceneTraverseComplete will become 1 a cycle after this??
                        else if ( iUCodeDone == 1'b0 & iSceneTraverseComplete == 1'b0) //ERROR!!! What if iSceneTraverseComplete will become 1 a cycle after this??
                                NextState = `CU_WAIT_FOR_HOST_DATA_ACK;//`CU_WAIT_FOR_HOST_DATA_AVAILABLE;
                                NextState = `CU_WAIT_FOR_HOST_DATA_ACK;//`CU_WAIT_FOR_HOST_DATA_AVAILABLE;
 
                        else
 
                                NextState = `CU_ACK_MAIN;
 
                */
 
                if (iUCodeDone == 1'b0 && iUCodeReturnValue == 0)
 
                        NextState = `CU_WAIT_FOR_HOST_DATA_AVAILABLE;
 
                else if (iUCodeDone == 1'b0 && iUCodeReturnValue == 1)
 
         NextState = `CU_COMMIT_PIXEL_RESULT;
                        else
                        else
                                NextState = `CU_ACK_MAIN;
                                NextState = `CU_ACK_MAIN;
 
 
 
        end
 
        //-----------------------------------------
 
        `CU_COMMIT_PIXEL_RESULT:
 
        begin
 
                oCodeInstructioPointer  = 0;
 
                oUCodeEnable                            = 0;
 
                oGFUEnable                                      = 0;
 
                oIOWritePixel                           = 0;
 
                rResetHitFlop                           = 0;
 
                rHitFlopEnable                          = 0;
 
                oTriggerTFF             = 0;
 
                oSetCurrentPitch        = 0;
 
                oFlipMemEnabled         = 0;
 
                oFlipMem                                                = 0;
 
                oDone                   = 0;
 
                oResultCommited                 = 1;
 
 
 
 
 
                NextState = `CU_WAIT_FOR_HOST_DATA_AVAILABLE;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
 
 
        `CU_WAIT_FOR_PSU:
        `CU_WAIT_FOR_PSU:
        begin
        begin
 
 
//      `ifdef DEBUG_CU
//      `ifdef DEBUG_CU
//              $display("%d Control: CU_TRIGGER_PSU\n",$time);
//              $display("%d Control: CU_TRIGGER_PSU\n",$time);
Line 1085... Line 1113...
                oDone                   = 0;
                oDone                   = 0;
                oResultCommited                 = 0;
                oResultCommited                 = 0;
                //oIncCurrentPitch        = 0;
                //oIncCurrentPitch        = 0;
 
 
                if ( iUCodeDone  == 0 && iUCodeReturnValue == 1)
                if ( iUCodeDone  == 0 && iUCodeReturnValue == 1)
                        NextState = `CU_TRIGGER_RGU;
                        NextState = `CU_WAIT_FOR_HOST_DATA_AVAILABLE;//`CU_TRIGGER_RGU;
                else if (iUCodeDone == 0 && iUCodeReturnValue == 0)
                else if (iUCodeDone == 0 && iUCodeReturnValue == 0)
                        NextState = `CU_DONE;
                        NextState = `CU_DONE;
                else
                else
                        NextState = `CU_ACK_NPU;
                        NextState = `CU_ACK_NPU;
 
 

powered by: WebSVN 2.1.0

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