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

Subversion Repositories opencpu32

[/] [opencpu32/] [trunk/] [hdl/] [opencpu32/] [testControlUnit.vhd] - Diff between revs 46 and 48

Show entire file | Details | Blame | View Log

Rev 46 Rev 48
Line 34... Line 34...
           clk : in  STD_LOGIC;                                                                                         --! Main system clock
           clk : in  STD_LOGIC;                                                                                         --! Main system clock
           FlagsDp : in  STD_LOGIC_VECTOR (2 downto 0);                          --! Flags comming from the Datapath
           FlagsDp : in  STD_LOGIC_VECTOR (2 downto 0);                          --! Flags comming from the Datapath
           DataDp : in  STD_LOGIC_VECTOR (n downto 0);                           --! Data comming from the Datapath
           DataDp : in  STD_LOGIC_VECTOR (n downto 0);                           --! Data comming from the Datapath
                          outEnDp : out  typeEnDis;                                                                             --! Enable/Disable datapath output
                          outEnDp : out  typeEnDis;                                                                             --! Enable/Disable datapath output
           MuxDp : out  dpMuxInputs;                                                                            --! Select on datapath data from (Memory, Imediate, RegFileA, RegFileB, AluOut)
           MuxDp : out  dpMuxInputs;                                                                            --! Select on datapath data from (Memory, Imediate, RegFileA, RegFileB, AluOut)
                          MuxRegDp : out STD_LOGIC_VECTOR(1 downto 0);                           --! Select Alu InputA (Memory,Imediate,RegFileA)
                          MuxRegDp : out dpMuxAluIn;                                                                            --! Select Alu InputA (Memory,Imediate,RegFileA)
           ImmDp : out  STD_LOGIC_VECTOR (n downto 0);                           --! Imediate value passed to the Datapath
           ImmDp : out  STD_LOGIC_VECTOR (n downto 0);                           --! Imediate value passed to the Datapath
           DpAluOp : out  aluOps;                                                                                       --! Alu operations
           DpAluOp : out  aluOps;                                                                                       --! Alu operations
                          DpRegFileWriteAddr : out  generalRegisters;                           --! General register address to write
                          DpRegFileWriteAddr : out  generalRegisters;                           --! General register address to write
           DpRegFileWriteEn : out  STD_LOGIC;                                                   --! Enable register write
           DpRegFileWriteEn : out  STD_LOGIC;                                                   --! Enable register write
           DpRegFileReadAddrA : out  generalRegisters;                          --! General register address to read
           DpRegFileReadAddrA : out  generalRegisters;                          --! General register address to read
Line 62... Line 62...
   signal MemoryDataInput : std_logic_vector(n downto 0) := (others => '0');      --! Wire to connect Test signal to component
   signal MemoryDataInput : std_logic_vector(n downto 0) := (others => '0');      --! Wire to connect Test signal to component
 
 
        --Outputs
        --Outputs
   signal outEnDp : typeEnDis;                                                                                                                          --! Wire to connect Test signal to component
   signal outEnDp : typeEnDis;                                                                                                                          --! Wire to connect Test signal to component
        signal MuxDp : dpMuxInputs;                                                                                                                             --! Wire to connect Test signal to component
        signal MuxDp : dpMuxInputs;                                                                                                                             --! Wire to connect Test signal to component
        signal MuxRegDp : std_logic_vector(1 downto 0);                                                                          --! Wire to connect Test signal to component
        signal MuxRegDp : dpMuxAluIn;                                                                                                                           --! Wire to connect Test signal to component
   signal ImmDp : std_logic_vector(n downto 0);                                                                                  --! Wire to connect Test signal to component
   signal ImmDp : std_logic_vector(n downto 0);                                                                                  --! Wire to connect Test signal to component
        signal DpAluOp : aluOps;                                                                                                                                        --! Wire to connect Test signal to component
        signal DpAluOp : aluOps;                                                                                                                                        --! Wire to connect Test signal to component
   signal DpRegFileWriteAddr : generalRegisters;                                                                                --! Wire to connect Test signal to component
   signal DpRegFileWriteAddr : generalRegisters;                                                                                --! Wire to connect Test signal to component
   signal DpRegFileWriteEn : std_logic;                                                                                                 --! Wire to connect Test signal to component
   signal DpRegFileWriteEn : std_logic;                                                                                                 --! Wire to connect Test signal to component
   signal DpRegFileReadAddrA : generalRegisters;                                                                                --! Wire to connect Test signal to component
   signal DpRegFileReadAddrA : generalRegisters;                                                                                --! Wire to connect Test signal to component
Line 245... Line 245...
                assert DpRegFileWriteAddr = r2 report "Invalid value" severity FAILURE;
                assert DpRegFileWriteAddr = r2 report "Invalid value" severity FAILURE;
                assert MuxDp = fromAlu report "Invalid value" severity FAILURE;
                assert MuxDp = fromAlu report "Invalid value" severity FAILURE;
                assert DpAluOp = alu_sum report "Invalid value" severity FAILURE;
                assert DpAluOp = alu_sum report "Invalid value" severity FAILURE;
                assert DpRegFileReadEnB = '1' report "Invalid value" severity FAILURE;
                assert DpRegFileReadEnB = '1' report "Invalid value" severity FAILURE;
                assert DpRegFileReadEnA = '1' report "Invalid value" severity FAILURE;
                assert DpRegFileReadEnA = '1' report "Invalid value" severity FAILURE;
                assert MuxRegDp = muxRegPos(fromRegFileA) report "Invalid value" severity FAILURE;
                assert MuxRegDp = fromRegFileA report "Invalid value" severity FAILURE;
                wait for CLK_period;    -- Executing ... 1
                wait for CLK_period;    -- Executing ... 1
 
 
                -- State writing on the registers
                -- State writing on the registers
                assert DpRegFileWriteEn = '1' report "Invalid value" severity FAILURE;
                assert DpRegFileWriteEn = '1' report "Invalid value" severity FAILURE;
 
 
Line 277... Line 277...
                -- Verify if signals for the datapath are valid         
                -- Verify if signals for the datapath are valid         
                assert ImmDp = conv_std_logic_vector(2, nBits) report "Invalid value" severity FAILURE;
                assert ImmDp = conv_std_logic_vector(2, nBits) report "Invalid value" severity FAILURE;
                assert DpRegFileWriteAddr = r2 report "Invalid value" severity FAILURE;
                assert DpRegFileWriteAddr = r2 report "Invalid value" severity FAILURE;
      assert DpAluOp = alu_sum report "Invalid value" severity FAILURE;
      assert DpAluOp = alu_sum report "Invalid value" severity FAILURE;
                assert MuxDp = fromAlu report "Invalid value" severity FAILURE;
                assert MuxDp = fromAlu report "Invalid value" severity FAILURE;
                assert MuxRegDp = muxRegPos(fromImediate) report "Invalid value" severity FAILURE;
                assert MuxRegDp = fromImediate report "Invalid value" severity FAILURE;
                assert DpRegFileReadAddrB = r2 report "Invalid value" severity FAILURE;
                assert DpRegFileReadAddrB = r2 report "Invalid value" severity FAILURE;
                assert DpRegFileReadEnB = '1' report "Invalid value" severity FAILURE;
                assert DpRegFileReadEnB = '1' report "Invalid value" severity FAILURE;
 
 
                wait for CLK_period;    -- Executing ... 1
                wait for CLK_period;    -- Executing ... 1
 
 
Line 344... Line 344...
 
 
                wait for CLK_period;    -- Executing ... 3
                wait for CLK_period;    -- Executing ... 3
 
 
                wait for CLK_period;    -- Executing ... 4
                wait for CLK_period;    -- Executing ... 4
 
 
                wait for CLK_period;    -- Executing ... 4
                --wait for CLK_period;  -- Executing ... 4
 
 
 
                -------------------------------------------------------------------------------------------------
 
 
 
                -- jmp 0 (Jump to position 0)--------------------------------------------------------------------
 
                REPORT "jmp 0" SEVERITY NOTE;
 
                MemoryDataInput <= jmp_val & conv_std_logic_vector(0,4) & conv_std_logic_vector(0, 22);
 
                wait for CLK_period;    -- Fetch
 
                wait for CLK_period;    -- Decode
 
                wait for CLK_period;    -- Execute
 
 
 
                -- Write the command to a file (This will be usefull for the top Testing later)
 
                WRITE (line_out, MemoryDataInput);
 
                WRITELINE (cmdfile, line_out);
 
 
 
                --wait for CLK_period;  -- Executing ... 1
 
                --assert MemoryDataRdAddr = conv_std_logic_vector(0, 32) report "Invalid value" severity FAILURE;
 
 
 
                --wait for CLK_period;  -- Executing ... 2
 
 
 
                -------------------------------------------------------------------------------------------------
 
 
 
                -- jmpr 3 (Jump to position Current + 3)--------------------------------------------------------------------
 
                REPORT "jmpr 3" SEVERITY NOTE;
 
                MemoryDataInput <= jmpr_val & conv_std_logic_vector(0,4) & conv_std_logic_vector(3, 22);
 
                wait for CLK_period;    -- Fetch
 
                wait for CLK_period;    -- Decode
 
                wait for CLK_period;    -- Execute
 
 
 
                -- Write the command to a file (This will be usefull for the top Testing later)
 
                WRITE (line_out, MemoryDataInput);
 
                WRITELINE (cmdfile, line_out);
 
 
 
                wait for CLK_period;    -- Executing ... 1
 
                --assert MemoryDataRdAddr = conv_std_logic_vector(3, 32) report "Invalid value" severity FAILURE;
 
 
 
                --wait for CLK_period;  -- Executing ... 2
 
 
                -------------------------------------------------------------------------------------------------
                -------------------------------------------------------------------------------------------------
 
 
      -- Close file
      -- Close file
                file_close(cmdfile);
                file_close(cmdfile);

powered by: WebSVN 2.1.0

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