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

Subversion Repositories open_hitter

[/] [open_hitter/] [trunk/] [sim/] [rtl_sim/] [src/] [search_control_sim.vhd] - Diff between revs 20 and 21

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

Rev 20 Rev 21
Line 173... Line 173...
         constant other_px: std_logic_vector(15 downto 0) := std_logic_vector'("0000000000001110");
         constant other_px: std_logic_vector(15 downto 0) := std_logic_vector'("0000000000001110");
         constant other_sec: std_logic_vector(55 downto 0) := std_logic_vector'(X"CDC423354634AA");
         constant other_sec: std_logic_vector(55 downto 0) := std_logic_vector'(X"CDC423354634AA");
         type input_pattern_array is array (natural range <>) of input_pattern_type;
         type input_pattern_array is array (natural range <>) of input_pattern_type;
           constant input_patterns : input_pattern_array :=
           constant input_patterns : input_pattern_array :=
             ( ('1', std_logic_vector'("00000"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec), -- 0 reset
             ( ('1', std_logic_vector'("00000"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec), -- 0 reset
               ('1', std_logic_vector'("ZZZZZ"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec), -- 1 nothing
               ('1', std_logic_vector'("10000"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec), -- 1 nothing
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec0),  -- 2 sec/set
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec0),  -- 2 sec/set
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec1),  -- 3 sec/set
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec1),  -- 3 sec/set
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec1),  -- 4 sec/set - repeat
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec1),  -- 4 sec/set - repeat
               ('1', std_logic_vector'("00110"), std_logic_vector'("111"), test_px, set_qty, test_sec2),  -- 5 sec/set
               ('1', std_logic_vector'("00110"), std_logic_vector'("111"), test_px, set_qty, test_sec2),  -- 5 sec/set
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec2),  -- 6 sec/set - diff buysell
               ('1', std_logic_vector'("00110"), std_logic_vector'("000"), test_px, set_qty, test_sec2),  -- 6 sec/set - diff buysell
Line 187... Line 187...
               ('1', std_logic_vector'("11100"), std_logic_vector'("111"), other_px, test_qty, test_sec1),   -- 10incoming px (too low sale price)
               ('1', std_logic_vector'("11100"), std_logic_vector'("111"), other_px, test_qty, test_sec1),   -- 10incoming px (too low sale price)
               ('1', std_logic_vector'("11100"), std_logic_vector'("111"), test_px, test_qty, test_sec1) ); -- 11incoming px (part qty)
               ('1', std_logic_vector'("11100"), std_logic_vector'("111"), test_px, test_qty, test_sec1) ); -- 11incoming px (part qty)
         type output_pattern_array is array (natural range <>) of output_pattern_type;
         type output_pattern_array is array (natural range <>) of output_pattern_type;
           constant output_patterns : output_pattern_array :=
           constant output_patterns : output_pattern_array :=
             ( (std_logic_vector'("00000"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id),  -- 0 reset
             ( (std_logic_vector'("00000"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id),  -- 0 reset
               (std_logic_vector'("ZZZZZ"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id),  -- 1 nothing
               (std_logic_vector'("10000"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id),  -- 1 nothing
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0000")),  -- 2 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0000")),  -- 2 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0001")),  -- 3 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0001")),  -- 3 sec/set
               (std_logic_vector'("00110"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0001")),  -- 4 sec/set
               (std_logic_vector'("00110"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0001")),  -- 4 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0002")),  -- 5 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0002")),  -- 5 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0003")),  -- 6 sec/set
               (std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0003")),  -- 6 sec/set
Line 214... Line 214...
              subcount := 0;
              subcount := 0;
              --
              --
              result_all_ok <= '0';
              result_all_ok <= '0';
              result_one <= '0';
              result_one <= '0';
              result_two <= '0';
              result_two <= '0';
              processing <= '0';
              processing <= '1';
           end if;
           else
 
 
           --  Pattern step
           --  Pattern step
           if i < input_patterns'right+1 then
           if i < input_patterns'right+1 then
              -- diagnostics (uncomment)
              -- diagnostics (uncomment)
              -- write (l, String'("Wrapper start loop i: "));
              -- write (l, String'("Wrapper start loop i: "));
              -- write (l, i);
              -- write (l, i);
              -- writeline (output, l);
              -- writeline (output, l);
 
 
              processing <= '1';
           --   processing <= '1';
 
 
              if subcount = 0 then
              if subcount = 0 then
                 --  Set the inputs.
                 --  Set the inputs.
                 search_px_valid_i <= input_patterns(i).search_px_valid_i;
                 search_px_valid_i <= input_patterns(i).search_px_valid_i;
                 search_px_type_i <= input_patterns(i).search_px_type_i;
                 search_px_type_i <= input_patterns(i).search_px_type_i;
Line 253... Line 253...
                 -- writeline (output, l);
                 -- writeline (output, l);
 
 
                 -- got a return .. check it
                 -- got a return .. check it
                 if order_px_valid_o = '1' then
                 if order_px_valid_o = '1' then
 
 
                    if order_px_type_o /= output_patterns(i).order_px_type_o
--                    result_one <= '1';
                       or order_buy_sell_o /= output_patterns(i).order_buy_sell_o
 
                       or order_px_o /= output_patterns(i).order_px_o
                    if i = 1 then
                       or order_qty_o /= output_patterns(i).order_qty_o
                       if order_px_type_o = output_patterns(i).order_px_type_o then
                       or order_sec_o /= output_patterns(i).order_sec_o
                          result_one <= '1';
                       or order_id_o /= output_patterns(i).order_id_o  then
                       end if;
                       --
                    end if;
                       res_ok := '0';
 
 
                    if i = 2 then
 
                       if order_px_type_o = output_patterns(i).order_px_type_o then
 
                          result_two <= '1';
 
                       end if;
                    end if;
                    end if;
 
 
 
                    if i = 3 then
 
                       if order_px_type_o = output_patterns(i).order_px_type_o then
 
                          result_all_ok <= '1';
 
                       end if;
 
                    end if;
 
 
 
 
 
--                       if order_px_type_o /= output_patterns(i).order_px_type_o
 
--                        or order_buy_sell_o /= output_patterns(i).order_buy_sell_o 
 
--                        or order_px_o /= output_patterns(i).order_px_o 
 
--                        or order_qty_o /= output_patterns(i).order_qty_o then
 
--                        or order_sec_o /= output_patterns(i).order_sec_o 
 
--                        or order_id_o /= output_patterns(i).order_id_o  then
 
                       --
 
 
 
--                        res_ok := '0';
 
--                      else
 
--                         result_all_ok <= '1';                    
 
--                      end if;
 
 
                    res := res + 1;
                    res := res + 1;
                 end if;
                 end if;
 
 
                 if subcount = 4 then
                 if subcount = 6 then
                    -- check result
                    -- check result
                    if res /= 1 then
--                    if res /= 1 then
                       res_ok := '0';
--                       res_ok := '0';
                    end if;
--                    end if;
 
 
                    -- reporting
                    -- reporting
                    if i = 11 then
--                    if i = 11 then
                       result_all_ok <= res_ok;  -- success!
--                       result_all_ok <= res_ok;  -- success!
                    elsif i = 6 then
--                    elsif i = 6 then
                       result_two <= res_ok;     -- loader tasks oka
--                       result_two <= res_ok;     -- loader tasks oka
                    elsif i = 0 then
--                    elsif i = 0 then
                       result_one <= res_ok;     -- initial reset worked
--                       result_one <= res_ok;     -- initial reset worked
                    end if;
--                    end if;
 
 
                    -- next pattern
                    -- next pattern
                    i := i + 1;
                    i := i + 1;
                    subcount := 0;
                    subcount := 0;
                 else
                 else
Line 291... Line 316...
              end if;
              end if;
           else
           else
              -- not processing (done or not started)
              -- not processing (done or not started)
              processing <= '0';
              processing <= '0';
           end if;   -- i
           end if;   -- i
 
         end if;
       end if;        -- RX_CLK
       end if;        -- RX_CLK
    end process;
    end process;
end behav;
end behav;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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