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

Subversion Repositories btc_dsha256

[/] [btc_dsha256/] [trunk/] [rtl/] [vhdl/] [TestBench/] [btc_dsha_TB.vhd] - Diff between revs 3 and 5

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

Rev 3 Rev 5
Line 115... Line 115...
        signal oFoundNonce_p : STD_LOGIC := '0';
        signal oFoundNonce_p : STD_LOGIC := '0';
        signal ovNonce : STD_LOGIC_VECTOR(31 downto 0) := (others=>'0');
        signal ovNonce : STD_LOGIC_VECTOR(31 downto 0) := (others=>'0');
        signal ovDigest : tDwordArray(0 to 7) := (others=>(others=>'0'));
        signal ovDigest : tDwordArray(0 to 7) := (others=>(others=>'0'));
 
 
        -- Add your code here ...
        -- Add your code here ...
        constant cREG_CLK_PERIOD : time := 30 ns; -- 33M Register Clock
        constant cREG_CLK_PERIOD : time := 10 ns; -- 100M Register Clock
        constant cPROC_CLK_PERIOD : time := 10 ns; -- 100M Processing Clock
        constant cPROC_CLK_PERIOD : time := 5 ns; -- 200M Processing Clock
        constant cRESET_INTERVAL : time := 71 ns;
        constant cRESET_INTERVAL : time := 71 ns;
        constant cSTRAT_TEST : integer := 25;
        constant cSTRAT_TEST : integer := 25;
 
 
        constant cCMD_ADDR : std_logic_vector(3 downto 0) := X"D";
        constant cCMD_ADDR : std_logic_vector(3 downto 0) := X"D";
        constant cCMD_NOP : std_logic_vector(15 downto 0) := X"0000";
        constant cCMD_NOP : std_logic_vector(15 downto 0) := X"0000";
Line 208... Line 208...
                elsif rising_edge(iClkReg) then
                elsif rising_edge(iClkReg) then
                        if sMidStateValid = '1' then
                        if sMidStateValid = '1' then
                                svWriteCnt <= svWriteCnt + '1';
                                svWriteCnt <= svWriteCnt + '1';
                        end if;
                        end if;
 
 
                        if svWriteCnt(3 downto 0) = X"F" and svWriteCnt(15 downto 4) <= conv_std_logic_vector(13, 12) then
                        if svWriteCnt(1 downto 0) = "11" and svWriteCnt(13 downto 2) <= conv_std_logic_vector(13, 12) then
                                iValid_p <= '1';
                                iValid_p <= '1';
                        else
                        else
                                iValid_p <= '0';
                                iValid_p <= '0';
                        end if;
                        end if;
                end if;
                end if;
Line 222... Line 222...
        begin
        begin
                if iRst_async = '1' then
                if iRst_async = '1' then
                        ivAddr <= (others=>'0');
                        ivAddr <= (others=>'0');
                        ivData <= (others=>'0');
                        ivData <= (others=>'0');
                elsif rising_edge(iClkReg) then
                elsif rising_edge(iClkReg) then
                        if svWriteCnt(3 downto 0) = X"F" then
                        if svWriteCnt(1 downto 0) = "11" then
                                case svWriteCnt(15 downto 4) is
                                case svWriteCnt(13 downto 2) is
                                        when X"000" =>
                                        when X"000" =>
                                        ivAddr <= X"0";
                                        ivAddr <= X"0";
                                        ivData <= svMidState(0);
                                        ivData <= svMidState(0);
 
 
                                        when X"001" =>
                                        when X"001" =>
Line 270... Line 270...
                                        ivAddr <= X"A";
                                        ivAddr <= X"A";
                                        ivData <= svWork(18);
                                        ivData <= svWork(18);
 
 
                                        when X"00B" =>
                                        when X"00B" =>
                                        ivAddr <= X"B";
                                        ivAddr <= X"B";
                                        ivData <= svWork(19) - X"20";
                                        ivData <= svWork(19) - X"02";
 
 
                                        when X"00C" =>
                                        when X"00C" =>
                                        ivAddr <= X"C";
                                        ivAddr <= X"C";
                                        ivData <= svWork(19) + X"20";
                                        ivData <= svWork(19) + X"02";
 
 
                                        when X"00D" =>
                                        when X"00D" =>
                                        ivAddr <= cCMD_ADDR;
                                        ivAddr <= cCMD_ADDR;
                                        ivData <= X"0000" & cCMD_START;
                                        ivData <= X"0000" & cCMD_START;
 
 

powered by: WebSVN 2.1.0

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