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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_1.2/] [rtl/] [CONTROL/] [Unit_Control.v] - Diff between revs 71 and 76

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

Rev 71 Rev 76
Line 76... Line 76...
`define CU_WAIT_USERCONSTANTS           43
`define CU_WAIT_USERCONSTANTS           43
`define CU_ACK_USERCONSTANTS 44
`define CU_ACK_USERCONSTANTS 44
`define CU_TRIGGER_USERPIXELSHADER 45
`define CU_TRIGGER_USERPIXELSHADER 45
`define CU_WAIT_FOR_USERPIXELSHADER 46
`define CU_WAIT_FOR_USERPIXELSHADER 46
`define CU_ACK_USERPIXELSHADER 47
`define CU_ACK_USERPIXELSHADER 47
 
`define CU_DONE 48
 
`define CU_WAIT_FOR_RENDER_ENABLE 49
 
 
//--------------------------------------------------------------
//--------------------------------------------------------------
module ControlUnit
module ControlUnit
(
(
 
 
Line 102... Line 104...
output reg[2:0]                              oRamBusOwner,
output reg[2:0]                              oRamBusOwner,
input wire                                   iIODone,
input wire                                   iIODone,
output reg                                   oSetCurrentPitch,
output reg                                   oSetCurrentPitch,
output reg                                   oFlipMemEnabled,
output reg                                   oFlipMemEnabled,
output reg                                   oFlipMem,
output reg                                   oFlipMem,
output reg                                   oIOWritePixel
output reg                                   oIOWritePixel,
 
input wire                                  iRenderEnable,
 
 
 
`ifdef DEBUG
 
input wire[`MAX_CORES-1:0]                  iDebug_CoreID,
 
`endif
 
 
 
output reg                                   oDone
 
 
);
);
 
 
//Internal State Machine varibles
//Internal State Machine varibles
reg     [5:0]    CurrentState;
reg     [5:0]    CurrentState;
Line 119... Line 128...
        integer log;
        integer log;
 
 
        initial
        initial
        begin
        begin
 
 
        $display("Opening ucode dump file....\n");
        //$display("Opening ucode dump file....\n");
        ucode_file = $fopen("CU.log","w");
        ucode_file = $fopen("CU.log","w");
        end
        end
 
 
`endif
`endif
 
 
Line 177... Line 186...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 1;
                oSetCurrentPitch        <= 1;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState                                       <= `CU_WAIT_FOR_INITIAL_CONFIGURATION;
                NextState                                       <= `CU_WAIT_FOR_INITIAL_CONFIGURATION;
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
 
 
        `CU_WAIT_FOR_INITIAL_CONFIGURATION:
        `CU_WAIT_FOR_INITIAL_CONFIGURATION:
        begin
        begin
        $display("CU_WAIT_FOR_INITIAL_CONFIGURATION");
        //$display("CORE: %d CU_WAIT_FOR_INITIAL_CONFIGURATION", iDebug_CoreID);
//              `ifdef DEBUG
//              `ifdef DEBUG
//                      `LOGME"%d Control: CU_WAIT_FOR_INITIAL_CONFIGURATION\n",$time);
//                      `LOGME"%d Control: CU_WAIT_FOR_INITIAL_CONFIGURATION\n",$time);
//              `endif
//              `endif
 
 
                oRamBusOwner                            <= 0;
                oRamBusOwner                            <= 0;
Line 202... Line 212...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;         
                //oIncCurrentPitch        <= 0;         
 
 
                if ( MST_I  )
                if ( MST_I  )
                        NextState <= `CU_PERFORM_INTIAL_CONFIGURATION;//`CU_WAIT_FOR_CONFIG_DATA_READ;
                        NextState <= `CU_PERFORM_INTIAL_CONFIGURATION;//`CU_WAIT_FOR_CONFIG_DATA_READ;
                else
                else
Line 214... Line 225...
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_PERFORM_INTIAL_CONFIGURATION:
        `CU_PERFORM_INTIAL_CONFIGURATION:
        begin
        begin
 
        //$display("CORE: %d CU_PERFORM_INTIAL_CONFIGURATION", iDebug_CoreID);
        oRamBusOwner                            <= 0;
        oRamBusOwner                            <= 0;
                oCodeInstructioPointer  <= 0;
                oCodeInstructioPointer  <= 0;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 0;
                oUCodeEnable                            <= 0;
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 225... Line 237...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;         
                //oIncCurrentPitch        <= 0;         
 
 
                if ( MST_I  )
                if ( MST_I  == 0 && iRenderEnable == 1'b1)
                        NextState <= `CU_PERFORM_INTIAL_CONFIGURATION;//`CU_WAIT_FOR_CONFIG_DATA_READ;
                        NextState <= `CU_CLEAR_REGISTERS;//`CU_WAIT_FOR_CONFIG_DATA_READ;
                else
                else
                        NextState <= `CU_CLEAR_REGISTERS;
                        NextState <= `CU_PERFORM_INTIAL_CONFIGURATION;
 
 
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_CLEAR_REGISTERS:
        `CU_CLEAR_REGISTERS:
        begin
        begin
 
        //$display("CORE: %d CU_CLEAR_REGISTERS", iDebug_CoreID);
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d CU_CLEAR_REGISTERS\n",$time);
                `LOGME"%d CU_CLEAR_REGISTERS\n",$time);
        `endif
        `endif
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
Line 251... Line 266...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1;
                oFlipMem                                                <= 1;
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                oDone                   <= 0;
 
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState                                       <= `CU_WAIT_CLEAR_REGISTERS;
                NextState                                       <= `CU_WAIT_CLEAR_REGISTERS;
        end
        end
//-----------------------------------------     
//-----------------------------------------     
        `CU_WAIT_CLEAR_REGISTERS:
        `CU_WAIT_CLEAR_REGISTERS:
        begin
        begin
//      `ifdef DEBUG
//      `ifdef DEBUG
//              `LOGME"%d CU_WAIT_CLEAR_REGISTERS\n",$time);
//              `LOGME"%d CU_WAIT_CLEAR_REGISTERS\n",$time);
//      `endif  
//      `endif  
 
                //$display("CORE: %d CU_WAIT_CLEAR_REGISTERS", iDebug_CoreID);
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_INITIAL;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_INITIAL;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 0;
                oUCodeEnable                            <= 0;
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 274... Line 290...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_CLEAR_REGISTERS;
                        NextState <= `CU_ACK_CLEAR_REGISTERS;
                else
                else
Line 285... Line 302...
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_ACK_CLEAR_REGISTERS:
        `CU_ACK_CLEAR_REGISTERS:
        begin
        begin
 
 
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d CU_ACK_CLEAR_REGISTERS\n", $time);
                `LOGME"%d CU_ACK_CLEAR_REGISTERS\n", $time);
        `endif
        `endif
 
 
 
        //$display("CORE: %d CU_ACK_CLEAR_REGISTERS", iDebug_CoreID);
 
 
                oRamBusOwner                            <= 0;
                oRamBusOwner                            <= 0;
                oCodeInstructioPointer  <= 0;
                oCodeInstructioPointer  <= 0;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 0; //*        
                oUCodeEnable                            <= 0; //*        
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 300... Line 320...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_CONFIG_DATA_READ;
                NextState <= `CU_WAIT_FOR_CONFIG_DATA_READ;
        end
        end
 
 
 
 
 
 
        //-----------------------------------------
        //-----------------------------------------
        `CU_WAIT_FOR_CONFIG_DATA_READ:
        `CU_WAIT_FOR_CONFIG_DATA_READ:
        begin
        begin
        $display("CU_WAIT_FOR_CONFIG_DATA_READ");
 
//              `ifdef DEBUG
//              `ifdef DEBUG
//                      `LOGME"%d Control: CU_WAIT_FOR_CONFIG_DATA_READ\n",$time);
//                      `LOGME"%d Control: CU_WAIT_FOR_CONFIG_DATA_READ\n",$time);
//              `endif
//              `endif
 
 
 
 
 
//$display("CORE: %d CU_WAIT_FOR_CONFIG_DATA_READ", iDebug_CoreID);
 
 
                oRamBusOwner                            <= 0;//`REG_BUS_OWNED_BY_BCU;
                oRamBusOwner                            <= 0;//`REG_BUS_OWNED_BY_BCU;
                oCodeInstructioPointer  <= 0;
                oCodeInstructioPointer  <= 0;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 0;
                oUCodeEnable                            <= 0;
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 326... Line 350...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( MST_I == 0  )
                if ( MST_I == 0  )
                        NextState <= `CU_PRECALCULATE_CONSTANTS;
                        NextState <= `CU_PRECALCULATE_CONSTANTS;
                else
                else
Line 337... Line 362...
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_PRECALCULATE_CONSTANTS:
        `CU_PRECALCULATE_CONSTANTS:
        begin
        begin
        $display("CU_PRECALCULATE_CONSTANTS");
//$display("CORE: %d CU_PRECALCULATE_CONSTANTS", iDebug_CoreID);
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_PRECALCULATE_CONSTANTS\n", $time);
                `LOGME"%d Control: CU_PRECALCULATE_CONSTANTS\n", $time);
        `endif
        `endif
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
Line 353... Line 378...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_CONSTANT;
                NextState <= `CU_WAIT_FOR_CONSTANT;
 
 
        end
        end
Line 377... Line 403...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_PRECALCULATE_CONSTANTS;
                        NextState <= `CU_ACK_PRECALCULATE_CONSTANTS;
                else
                else
Line 388... Line 415...
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_ACK_PRECALCULATE_CONSTANTS:
        `CU_ACK_PRECALCULATE_CONSTANTS:
        begin
        begin
        $display("CU_ACK_PRECALCULATE_CONSTANTS");
        //$display("CORE: %d CU_ACK_PRECALCULATE_CONSTANTS", iDebug_CoreID);
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_ACK_PRECALCULATE_CONSTANTS\n", $time);
                `LOGME"%d Control: CU_ACK_PRECALCULATE_CONSTANTS\n", $time);
        `endif
        `endif
 
 
 
 
Line 405... Line 432...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_TRIGGER_USERCONSTANTS;//CU_WAIT_FOR_TASK;
                NextState <= `CU_TRIGGER_USERCONSTANTS;//CU_WAIT_FOR_TASK;
 
 
        end
        end
Line 418... Line 446...
        begin
        begin
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_TRIGGER_RGU\n",$time);
                `LOGME"%d Control: CU_TRIGGER_RGU\n",$time);
        `endif
        `endif
 
 
 
                //$display("CORE: %d CU_TRIGGER_USERCONSTANTS", iDebug_CoreID);
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_USERCONSTANTS;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_USERCONSTANTS;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 1;   //*
                oUCodeEnable                            <= 1;   //*
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 429... Line 459...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_USERCONSTANTS;
                NextState <= `CU_WAIT_USERCONSTANTS;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 452... Line 483...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_USERCONSTANTS;
                        NextState <= `CU_ACK_USERCONSTANTS;
                else
                else
Line 466... Line 498...
        begin
        begin
 
 
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_ACK_RGU\n",$time);
                `LOGME"%d Control: CU_ACK_RGU\n",$time);
        `endif
        `endif
 
 
 
        //$display("CORE: %d CU_ACK_USERCONSTANTS", iDebug_CoreID);
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oCodeInstructioPointer  <= 0;
                oCodeInstructioPointer  <= 0;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 0; //*        
                oUCodeEnable                            <= 0; //*        
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 477... Line 512...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_RGU;
                        NextState <= `CU_WAIT_FOR_RENDER_ENABLE;
                else
                else
                        NextState <= `CU_ACK_USERCONSTANTS;
                        NextState <= `CU_ACK_USERCONSTANTS;
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
 
        `CU_WAIT_FOR_RENDER_ENABLE:
 
        begin
 
        //$display("CORE: %d CU_WAIT_FOR_RENDER_ENABLE", iDebug_CoreID);
 
 
 
                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;
 
                //oIncCurrentPitch        <= 0;
 
 
 
                if ( iRenderEnable)
 
                        NextState <= `CU_TRIGGER_RGU;
 
                else
 
                        NextState <= `CU_WAIT_FOR_RENDER_ENABLE;
 
        end
 
        //-----------------------------------------
        `CU_TRIGGER_RGU:
        `CU_TRIGGER_RGU:
        begin
        begin
 
 
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_TRIGGER_RGU\n",$time);
                `LOGME"%d Control: CU_TRIGGER_RGU\n",$time);
        `endif
        `endif
 
 
 
        //$display("CORE: %d CU_TRIGGER_RGU", iDebug_CoreID);
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_RGU;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_RGU;
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oUCodeEnable                            <= 1;   //*
                oUCodeEnable                            <= 1;   //*
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 504... Line 566...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_RGU;
                NextState <= `CU_WAIT_FOR_RGU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 527... Line 590...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_RGU;
                        NextState <= `CU_ACK_RGU;
                else
                else
Line 552... Line 616...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_GEO;
                        NextState <= `CU_TRIGGER_GEO;
                else
                else
Line 564... Line 629...
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_TRIGGER_GEO:
        `CU_TRIGGER_GEO:
        begin
        begin
 
 
 
        //$display("CORE: %d CU_TRIGGER_GEO", iDebug_CoreID);
 
 
 
 
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_TRIGGER_GEO\n",$time);
                `LOGME"%d Control: CU_TRIGGER_GEO\n",$time);
        `endif
        `endif
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_GFU;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_GFU;
Line 579... Line 647...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_GEO_SYNC;
                NextState <= `CU_WAIT_FOR_GEO_SYNC;
 
 
        end
        end
Line 603... Line 672...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
        if (iGEOSync & iTriggerAABBIURequest )
        if (iGEOSync & iTriggerAABBIURequest )
                NextState <= `CU_TRIGGER_AABBIU;
                NextState <= `CU_TRIGGER_AABBIU;
        else if (iGEOSync & iTriggerBIURequest)
        else if (iGEOSync & iTriggerBIURequest)
Line 620... Line 690...
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_TRIGGER_TCC:
        `CU_TRIGGER_TCC:
        begin
        begin
        //$display("CU_TRIGGER_TCC");
        ////$display("CU_TRIGGER_TCC");
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_TRIGGER_TCC\n",$time);
                `LOGME"%d Control: CU_TRIGGER_TCC\n",$time);
        `endif
        `endif
 
 
           oRamBusOwner                                 <= `REG_BUS_OWNED_BY_UCODE;
           oRamBusOwner                                 <= `REG_BUS_OWNED_BY_UCODE;
Line 636... Line 706...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1; //We need u,v from last IO read cycle
                oFlipMem                                                <= 1; //We need u,v from last IO read cycle
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
                oDone                   <= 0;
 
 
          NextState  <= `WAIT_FOR_TCC;
          NextState  <= `WAIT_FOR_TCC;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `WAIT_FOR_TCC:
        `WAIT_FOR_TCC:
        begin
        begin
 
 
        //$display("WAIT_FOR_TCC");
        ////$display("WAIT_FOR_TCC");
           oRamBusOwner                                 <= `REG_BUS_OWNED_BY_UCODE;
           oRamBusOwner                                 <= `REG_BUS_OWNED_BY_UCODE;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_TCC;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_TCC;
                oUCodeEnable                            <= 0;    //*
                oUCodeEnable                            <= 0;    //*
                oGFUEnable                                      <= 0;
                oGFUEnable                                      <= 0;
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
Line 657... Line 728...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
           if ( iUCodeDone )
           if ( iUCodeDone )
                        NextState <= `CU_ACK_UCODE;
                        NextState <= `CU_ACK_UCODE;
                else
                else
Line 696... Line 768...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
           oTriggerTFF             <= 0;
           oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1;
                oFlipMem                                                <= 1;
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                oDone                   <= 0;
 
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if (wHit && !iControlRegister[`CR_EN_TEXTURE] )
                if (wHit && !iControlRegister[`CR_EN_TEXTURE] )
                        NextState <= `CU_TRIGGER_PSU;
                        NextState <= `CU_TRIGGER_PSU;
                else if (wHit && iControlRegister[`CR_EN_TEXTURE])
                else if (wHit && iControlRegister[`CR_EN_TEXTURE])
Line 719... Line 792...
        begin
        begin
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_TRIGGER_TFF\n",$time);
                `LOGME"%d Control: CU_TRIGGER_TFF\n",$time);
        `endif
        `endif
 
 
        //$display("CU_TRIGGER_TFF");
        ////$display("CU_TRIGGER_TFF");
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_GFU;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_GFU;
                oCodeInstructioPointer  <= 0;
                oCodeInstructioPointer  <= 0;
                oUCodeEnable                            <= 0;
                oUCodeEnable                            <= 0;
                oGFUEnable                                      <= 1;
                oGFUEnable                                      <= 1;
Line 733... Line 806...
                oTriggerTFF             <= 1;       //*
                oTriggerTFF             <= 1;       //*
           oSetCurrentPitch        <= 0;
           oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;  //NO need, we did this n check hit
                oFlipMem                                                <= 0;  //NO need, we did this n check hit
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
                oDone                   <= 0;
 
 
                NextState <= `CU_WAIT_FOR_TFF;
                NextState <= `CU_WAIT_FOR_TFF;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        `CU_WAIT_FOR_TFF:
        `CU_WAIT_FOR_TFF:
Line 751... Line 825...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
 
 
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
        if (iTFFDone)
        if (iTFFDone)
                NextState <= `CU_TRIGGER_PSU_WITH_TEXTURE;
                NextState <= `CU_TRIGGER_PSU_WITH_TEXTURE;
Line 779... Line 854...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1;
                oFlipMem                                                <= 1;
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                oDone                   <= 0;
 
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
           //oIncCurrentPitch        <= 0;
           //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_PSU;
                NextState <= `CU_WAIT_FOR_PSU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 804... Line 880...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1;
                oFlipMem                                                <= 1;
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                oDone                   <= 0;
 
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_AABBIU;
                NextState <= `CU_WAIT_FOR_AABBIU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 819... Line 896...
//      `ifdef DEBUG
//      `ifdef DEBUG
//              `LOGME"%d Control: CU_WAIT_FOR_AABBIU\n",$time);
//              `LOGME"%d Control: CU_WAIT_FOR_AABBIU\n",$time);
//      `endif
//      `endif
 
 
 
 
//      $display("iUCodeDone",iUCodeDone);
//      //$display("iUCodeDone",iUCodeDone);
 
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_AABBIU;
                oCodeInstructioPointer  <= `ENTRYPOINT_INDEX_AABBIU;
                oUCodeEnable                            <= 0;
                oUCodeEnable                            <= 0;
                oGFUEnable                                      <= 1;
                oGFUEnable                                      <= 1;
Line 832... Line 909...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                begin
                begin
        //         $display("iUCodeDone\n",iUCodeDone);
        //         //$display("iUCodeDone\n",iUCodeDone);
        //              $stop();
        //              $stop();
                        NextState <= `CU_ACK_UCODE;
                        NextState <= `CU_ACK_UCODE;
                end
                end
                else
                else
                        NextState <= `CU_WAIT_FOR_AABBIU;
                        NextState <= `CU_WAIT_FOR_AABBIU;
Line 861... Line 939...
                        rHitFlopEnable                          <= 1;
                        rHitFlopEnable                          <= 1;
         oTriggerTFF             <= 0;
         oTriggerTFF             <= 0;
                        oSetCurrentPitch        <= 0;
                        oSetCurrentPitch        <= 0;
                        oFlipMemEnabled         <= 1;
                        oFlipMemEnabled         <= 1;
                        oFlipMem                                                <= 1;
                        oFlipMem                                                <= 1;
                        //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                        oDone                   <= 0;
 
                        ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                        //oIncCurrentPitch        <= 0;
                        //oIncCurrentPitch        <= 0;
                //      $stop();
                //      $stop();
 
 
                        NextState <= `CU_WAIT_FOR_BIU;
                        NextState <= `CU_WAIT_FOR_BIU;
 
 
Line 886... Line 965...
                        rHitFlopEnable                          <= 1;
                        rHitFlopEnable                          <= 1;
         oTriggerTFF             <= 0;
         oTriggerTFF             <= 0;
                        oSetCurrentPitch        <= 0;
                        oSetCurrentPitch        <= 0;
                        oFlipMemEnabled         <= 1;
                        oFlipMemEnabled         <= 1;
                        oFlipMem                                                <= 0;
                        oFlipMem                                                <= 0;
 
                        oDone                   <= 0;
                        //oIncCurrentPitch        <= 0;
                        //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_UCODE;
                        NextState <= `CU_ACK_UCODE;
                else
                else
Line 914... Line 994...
                        rHitFlopEnable                          <= 0;
                        rHitFlopEnable                          <= 0;
         oTriggerTFF             <= 0;
         oTriggerTFF             <= 0;
                        oSetCurrentPitch        <= 0;
                        oSetCurrentPitch        <= 0;
                        oFlipMemEnabled         <= 0;
                        oFlipMemEnabled         <= 0;
                        oFlipMem                                                <= 0;
                        oFlipMem                                                <= 0;
 
                        oDone                   <= 0;
                        //oIncCurrentPitch        <= 0;
                        //oIncCurrentPitch        <= 0;
 
 
        //              $stop();
        //              $stop();
 
 
                        if ( iUCodeDone == 0 )
                        if ( iUCodeDone == 0 )
Line 944... Line 1025...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1;
                oFlipMem                                                <= 1;
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                oDone                   <= 0;
 
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_WAIT_FOR_PSU;
                NextState <= `CU_WAIT_FOR_PSU;
        end
        end
Line 969... Line 1051...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_PSU;
                        NextState <= `CU_ACK_PSU;
Line 996... Line 1079...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_USERPIXELSHADER;
                        NextState <= `CU_TRIGGER_USERPIXELSHADER;
                else
                else
Line 1027... Line 1111...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 1;
                oFlipMem                                                <= 1;
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                oDone                   <= 0;
 
                ////$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_SET_PICTH;
                NextState <= `CU_SET_PICTH;
 
 
Line 1048... Line 1133...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 1; //*
                oSetCurrentPitch        <= 1; //*
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_WAIT_FOR_PCU;
                NextState <= `CU_WAIT_FOR_PCU;
        end
        end
Line 1072... Line 1158...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iIODone )
                if ( iIODone )
                        NextState <= `CU_ACK_PCU;
                        NextState <= `CU_ACK_PCU;
                else
                else
Line 1098... Line 1185...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_TRIGGER_NPU;
                NextState <= `CU_TRIGGER_NPU;
 
 
        end
        end
Line 1120... Line 1208...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_NPU;
                NextState <= `CU_WAIT_NPU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 1138... Line 1227...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_NPU;
                        NextState <= `CU_ACK_NPU;
                else
                else
                        NextState <= `CU_WAIT_NPU;
                        NextState <= `CU_WAIT_NPU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
 
        /*
 
        Next Pixel generation: here we either goto
 
        to RGU for the next pixel, or we have no
 
        more pixels so we are done we our picture!
 
        */
        `CU_ACK_NPU:
        `CU_ACK_NPU:
        begin
        begin
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_ACK_PSU\n",$time);
                `LOGME"%d Control: CU_ACK_PSU\n",$time);
        `endif
        `endif
Line 1163... Line 1258...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0 && iUCodeReturnValue == 1)
                        NextState <= `CU_TRIGGER_RGU;
                        NextState <= `CU_TRIGGER_RGU;
 
                else if (iUCodeDone == 0 && iUCodeReturnValue == 0)
 
                        NextState <= `CU_DONE;
                else
                else
                        NextState <= `CU_ACK_NPU;
                        NextState <= `CU_ACK_NPU;
 
 
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
 
        `CU_DONE:
 
        begin
 
                oRamBusOwner                            <= `REG_BUS_OWNED_BY_UCODE;
 
                oCodeInstructioPointer  <= 0;
 
                oUCodeEnable                            <= 0;
 
                oGFUEnable                                      <= 0;
 
                oIOWritePixel                           <= 0;
 
                rResetHitFlop                           <= 0;
 
                rHitFlopEnable                          <= 0;
 
      oTriggerTFF             <= 0;
 
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
 
                oDone                   <= 1;
 
                //oIncCurrentPitch        <= 0;
 
 
 
 
 
                NextState <= `CU_DONE;
 
 
 
        end
        //-----------------------------------------
        //-----------------------------------------
        /*
        /*
        Here we no longer use GFU so set Enable to zero
        Here we no longer use GFU so set Enable to zero
        */
        */
        `CU_TRIGGER_USERPIXELSHADER:
        `CU_TRIGGER_USERPIXELSHADER:
Line 1194... Line 1312...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_WAIT_FOR_USERPIXELSHADER;
                NextState <= `CU_WAIT_FOR_USERPIXELSHADER;
        end
        end
Line 1218... Line 1337...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_USERPIXELSHADER;
                        NextState <= `CU_ACK_USERPIXELSHADER;
Line 1245... Line 1365...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 1;
                oFlipMemEnabled         <= 1;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_PCU;
                        NextState <= `CU_TRIGGER_PCU;
                else
                else
Line 1273... Line 1394...
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMemEnabled         <= 0;
                oFlipMem                                                <= 0;
                oFlipMem                                                <= 0;
 
                oDone                   <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_AFTER_RESET_STATE;
                NextState <= `CU_AFTER_RESET_STATE;
        end
        end
        //-----------------------------------------
        //-----------------------------------------

powered by: WebSVN 2.1.0

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