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 63 and 71

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

Rev 63 Rev 71
Line 100... Line 100...
input wire                                   iTFFDone,
input wire                                   iTFFDone,
input wire                                   MST_I,
input wire                                   MST_I,
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                                   oFlipMem,
output reg                                   oIOWritePixel
output reg                                   oIOWritePixel
 
 
);
);
 
 
//Internal State Machine varibles
//Internal State Machine varibles
Line 173... Line 175...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 1;
                rResetHitFlop                           <= 1;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 1;
                oSetCurrentPitch        <= 1;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState                                       <= `CU_WAIT_FOR_INITIAL_CONFIGURATION;
                NextState                                       <= `CU_WAIT_FOR_INITIAL_CONFIGURATION;
 
 
        end
        end
Line 196... Line 200...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 1;
                rResetHitFlop                           <= 1;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 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 217... Line 223...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 1;
                rResetHitFlop                           <= 1;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 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 241... Line 249...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1;
 
                //$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
//-----------------------------------------     
//-----------------------------------------     
Line 261... Line 272...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_CLEAR_REGISTERS;
                        NextState <= `CU_ACK_CLEAR_REGISTERS;
                else
                else
Line 285... Line 298...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_CONFIG_DATA_READ;
                NextState <= `CU_WAIT_FOR_CONFIG_DATA_READ;
        end
        end
 
 
Line 309... Line 324...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( MST_I == 0  )
                if ( MST_I == 0  )
                        NextState <= `CU_PRECALCULATE_CONSTANTS;
                        NextState <= `CU_PRECALCULATE_CONSTANTS;
                else
                else
Line 334... Line 351...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_CONSTANT;
                NextState <= `CU_WAIT_FOR_CONSTANT;
 
 
        end
        end
Line 356... Line 375...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_PRECALCULATE_CONSTANTS;
                        NextState <= `CU_ACK_PRECALCULATE_CONSTANTS;
                else
                else
Line 382... Line 403...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_TRIGGER_USERCONSTANTS;//CU_WAIT_FOR_TASK;
                NextState <= `CU_TRIGGER_USERCONSTANTS;//CU_WAIT_FOR_TASK;
 
 
        end
        end
        //-----------------------------------------
        //-----------------------------------------
        //TODO:
 
        `CU_TRIGGER_USERCONSTANTS:
        `CU_TRIGGER_USERCONSTANTS:
        begin
        begin
        `ifdef DEBUG
        `ifdef DEBUG
                `LOGME"%d Control: CU_TRIGGER_RGU\n",$time);
                `LOGME"%d Control: CU_TRIGGER_RGU\n",$time);
        `endif
        `endif
Line 404... Line 427...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_USERCONSTANTS;
                NextState <= `CU_WAIT_USERCONSTANTS;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 425... Line 450...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_USERCONSTANTS;
                        NextState <= `CU_ACK_USERCONSTANTS;
                else
                else
Line 448... Line 475...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_RGU;
                        NextState <= `CU_TRIGGER_RGU;
                else
                else
Line 473... Line 502...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_RGU;
                NextState <= `CU_WAIT_FOR_RGU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 494... Line 525...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_RGU;
                        NextState <= `CU_ACK_RGU;
                else
                else
Line 517... Line 550...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_GEO;
                        NextState <= `CU_TRIGGER_GEO;
                else
                else
Line 542... Line 577...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 1;   //*
                rResetHitFlop                           <= 1;   //*
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_GEO_SYNC;
                NextState <= `CU_WAIT_FOR_GEO_SYNC;
 
 
        end
        end
Line 564... Line 601...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 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 595... Line 634...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1; //We need u,v from last IO read cycle
 
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
          NextState  <= `WAIT_FOR_TCC;
          NextState  <= `WAIT_FOR_TCC;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 613... Line 655...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
           if ( iUCodeDone )
           if ( iUCodeDone )
                        NextState <= `CU_ACK_UCODE;
                        NextState <= `CU_ACK_UCODE;
                else
                else
Line 650... Line 694...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
           oTriggerTFF             <= 0;
           oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1;
 
                //$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 683... Line 730...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 1;       //*
                oTriggerTFF             <= 1;       //*
           oSetCurrentPitch        <= 0;
           oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;  //NO need, we did this n check hit
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_FOR_TFF;
                NextState <= `CU_WAIT_FOR_TFF;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 700... Line 749...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
 
 
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
        if (iTFFDone)
        if (iTFFDone)
                NextState <= `CU_TRIGGER_PSU_WITH_TEXTURE;
                NextState <= `CU_TRIGGER_PSU_WITH_TEXTURE;
        else
        else
Line 725... Line 777...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1;
 
                //$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 747... Line 802...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1;
 
                //$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 772... Line 830...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                begin
                begin
        //         $display("iUCodeDone\n",iUCodeDone);
        //         $display("iUCodeDone\n",iUCodeDone);
Line 799... Line 859...
                        oIOWritePixel                           <= 0;
                        oIOWritePixel                           <= 0;
                        rResetHitFlop                           <= 0;//1;        
                        rResetHitFlop                           <= 0;//1;        
                        rHitFlopEnable                          <= 1;
                        rHitFlopEnable                          <= 1;
         oTriggerTFF             <= 0;
         oTriggerTFF             <= 0;
                        oSetCurrentPitch        <= 0;
                        oSetCurrentPitch        <= 0;
 
                        oFlipMemEnabled         <= 1;
 
                        oFlipMem                                                <= 1;
 
                        //$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 821... Line 884...
                        oIOWritePixel                           <= 0;
                        oIOWritePixel                           <= 0;
                        rResetHitFlop                           <= 0;
                        rResetHitFlop                           <= 0;
                        rHitFlopEnable                          <= 1;
                        rHitFlopEnable                          <= 1;
         oTriggerTFF             <= 0;
         oTriggerTFF             <= 0;
                        oSetCurrentPitch        <= 0;
                        oSetCurrentPitch        <= 0;
 
                        oFlipMemEnabled         <= 1;
 
                        oFlipMem                                                <= 0;
                        //oIncCurrentPitch        <= 0;
                        //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_UCODE;
                        NextState <= `CU_ACK_UCODE;
                else
                else
Line 847... Line 912...
                        oIOWritePixel                           <= 0;
                        oIOWritePixel                           <= 0;
                        rResetHitFlop                           <= 0;
                        rResetHitFlop                           <= 0;
                        rHitFlopEnable                          <= 0;
                        rHitFlopEnable                          <= 0;
         oTriggerTFF             <= 0;
         oTriggerTFF             <= 0;
                        oSetCurrentPitch        <= 0;
                        oSetCurrentPitch        <= 0;
 
                        oFlipMemEnabled         <= 0;
 
                        oFlipMem                                                <= 0;
                        //oIncCurrentPitch        <= 0;
                        //oIncCurrentPitch        <= 0;
 
 
        //              $stop();
        //              $stop();
 
 
                        if ( iUCodeDone == 0 )
                        if ( iUCodeDone == 0 )
Line 875... Line 942...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1;
 
                //$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 897... Line 967...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_PSU;
                        NextState <= `CU_ACK_PSU;
Line 922... Line 994...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_USERPIXELSHADER;
                        NextState <= `CU_TRIGGER_USERPIXELSHADER;
                else
                else
Line 951... Line 1025...
                oIOWritePixel                           <= 1; //*
                oIOWritePixel                           <= 1; //*
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 1;
 
                //$display("\n\n %d XOXOXOXOX FLIP XOXOXOXOXOX\n\n",$time);
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_SET_PICTH;
                NextState <= `CU_SET_PICTH;
 
 
Line 969... Line 1046...
                oIOWritePixel                           <= 1; //*
                oIOWritePixel                           <= 1; //*
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 1; //*
                oSetCurrentPitch        <= 1; //*
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_WAIT_FOR_PCU;
                NextState <= `CU_WAIT_FOR_PCU;
        end
        end
Line 991... Line 1070...
                oIOWritePixel                           <= 1;
                oIOWritePixel                           <= 1;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iIODone )
                if ( iIODone )
                        NextState <= `CU_ACK_PCU;
                        NextState <= `CU_ACK_PCU;
                else
                else
Line 1015... Line 1096...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_TRIGGER_NPU;
                NextState <= `CU_TRIGGER_NPU;
 
 
        end
        end
Line 1035... Line 1118...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                NextState <= `CU_WAIT_NPU;
                NextState <= `CU_WAIT_NPU;
        end
        end
        //-----------------------------------------
        //-----------------------------------------
Line 1051... Line 1136...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_NPU;
                        NextState <= `CU_ACK_NPU;
                else
                else
Line 1074... Line 1161...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_RGU;
                        NextState <= `CU_TRIGGER_RGU;
                else
                else
Line 1103... Line 1192...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                NextState <= `CU_WAIT_FOR_USERPIXELSHADER;
                NextState <= `CU_WAIT_FOR_USERPIXELSHADER;
        end
        end
Line 1125... Line 1216...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
                oTriggerTFF             <= 0;
                oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
 
 
                if ( iUCodeDone )
                if ( iUCodeDone )
                        NextState <= `CU_ACK_USERPIXELSHADER;
                        NextState <= `CU_ACK_USERPIXELSHADER;
Line 1150... Line 1243...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 1;
 
                oFlipMem                                                <= 0;
                //oIncCurrentPitch        <= 0;
                //oIncCurrentPitch        <= 0;
 
 
                if ( iUCodeDone  == 0)
                if ( iUCodeDone  == 0)
                        NextState <= `CU_TRIGGER_PCU;
                        NextState <= `CU_TRIGGER_PCU;
                else
                else
Line 1176... Line 1271...
                oIOWritePixel                           <= 0;
                oIOWritePixel                           <= 0;
                rResetHitFlop                           <= 0;
                rResetHitFlop                           <= 0;
                rHitFlopEnable                          <= 0;
                rHitFlopEnable                          <= 0;
      oTriggerTFF             <= 0;
      oTriggerTFF             <= 0;
                oSetCurrentPitch        <= 0;
                oSetCurrentPitch        <= 0;
 
                oFlipMemEnabled         <= 0;
 
                oFlipMem                                                <= 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.