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

Subversion Repositories open_hitter

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 15 to Rev 16
    Reverse comparison

Rev 15 → Rev 16

/open_hitter/trunk/bench/vhdl/search_control_wrapper.vhd
100,6 → 100,8
signal order_qty_o: std_logic_vector(15 downto 0); -- quantity
signal order_sec_o: std_logic_vector(55 downto 0); -- 7x 8bits securities identifier
signal order_id_o: std_logic_vector(15 downto 0); -- unique/identifier/counter
-- control
signal order_px_valid_o: std_logic;
begin
search_control_0: search_control
generic map ( searchitems => 3 )
120,10 → 122,13
order_px_o => order_px_o,
order_qty_o => order_qty_o,
order_sec_o => order_sec_o,
order_id_o => order_id_o
order_id_o => order_id_o,
-- control
order_px_valid_o => order_px_valid_o
);
process
variable l : line;
variable res : integer;
 
type input_pattern_type is record
-- control flag(s) on the incoming bus
182,12 → 187,11
(std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0001")), -- 2 sec/set
(std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0002")), -- 3 sec/set
(std_logic_vector'("01010"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, std_logic_vector'(X"0003")), -- 4 sec/set
(std_logic_vector'("ZZZZZ"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id), -- 5 bad sec/set (too many)
(std_logic_vector'("11111"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id), -- 5 bad sec/set (too many)
(std_logic_vector'("11100"), std_logic_vector'("000"), test_px, test_qty, test_sec1, test_id), -- 6 incoming px
(std_logic_vector'("ZZZZZ"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id), -- 7 incoming px (wrong security)
(std_logic_vector'("11110"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id), -- 7 incoming px (wrong security)
(std_logic_vector'("11101"), std_logic_vector'("ZZZ"), zz_px, zz_qty, zz_sec, zz_id), -- 8 incoming px (too low sale price)
(std_logic_vector'("11100"), std_logic_vector'("000"), test_px, remain_qty, test_sec1, test_id) ); -- 9 incoming px (part qty)
 
begin
write (l, String'("Exercising search_control"));
writeline (output, l);
208,22 → 212,30
RX_CLK <= '1';
wait for 1 ns;
-- Check the outputs.
write(l, i);
writeline (output, l);
assert order_px_type_o = output_patterns(i).order_px_type_o report "search_item_wrapper: bad px type" severity error;
assert order_buy_sell_o = output_patterns(i).order_buy_sell_o report "search_item_wrapper: bad buy_sell" severity error;
assert order_px_o = output_patterns(i).order_px_o report "search_item_wrapper: bad px" severity error;
assert order_qty_o = output_patterns(i).order_qty_o report "search_item_wrapper: bad qty" severity error;
assert order_sec_o = output_patterns(i).order_sec_o report "search_item_wrapper: bad sec" severity error;
assert order_id_o = output_patterns(i).order_id_o report "search_item_wrapper: bad id" severity error;
-- Clock down.
res := 0;
for r in 0 to 4 loop
if order_px_valid_o = '1' then
write(l, i);
writeline (output, l);
assert order_px_type_o = output_patterns(i).order_px_type_o report "search_control_wrapper: bad px type" severity error;
assert order_buy_sell_o = output_patterns(i).order_buy_sell_o report "search_control_wrapper: bad buy_sell" severity error;
assert order_px_o = output_patterns(i).order_px_o report "search_control_wrapper: bad px" severity error;
assert order_qty_o = output_patterns(i).order_qty_o report "search_control_wrapper: bad qty" severity error;
assert order_sec_o = output_patterns(i).order_sec_o report "search_control_wrapper: bad sec" severity error;
assert order_id_o = output_patterns(i).order_id_o report "search_control_wrapper: bad id" severity error;
res := res + 1;
end if;
-- Clock down.
RX_CLK <= '0';
wait for 1 ns;
search_px_valid_i <= '0';
RX_CLK <= '1';
wait for 1 ns;
end loop;
assert res = 1 report "search_control_wrapper: wrong number of results from input pattern message" severity error;
 
RX_CLK <= '0';
wait for 1 ns;
search_px_valid_i <= '0';
RX_CLK <= '1';
wait for 1 ns;
RX_CLK <= '0';
wait for 1 ns;
end loop;
-- assert false report "end of test" severity note;
/open_hitter/trunk/rtl/vhdl/search_control.vhd
107,7 → 107,8
b2_id: out std_logic_vector(15 downto 0) -- unique/identifier/counter
);
end component;
-- for search_item_0: search_item use entity work.search_item;
-- for search_item_0: search_item use entity work.search_item;
signal searchitems_count : integer := 0;
--
signal state : integer range 0 to 16 := 16;
-- pxdata: store price_packet
153,21 → 154,22
 
if search_px_type_i = std_logic_vector'("00000") then
-- do reset store and outputs
store_px_type <= (others => '0');
store_buy_sell <= (others => '0'); -- 111 buy, 000 sell
store_px <= (others => '0'); -- price
store_qty <= (others => '0'); -- quantity
store_sec <= (others => '0'); -- 7x 8bits securities identifier
-- not reset / generic store_id <= (others => '0'); -- unique/identifier/counter
order_px_type_o <= (others => 'Z');
order_buy_sell_o <= (others => 'Z'); -- 111 buy, 000 sell
order_px_o <= (others => 'Z'); -- price
order_qty_o <= (others => 'Z'); -- quantity
order_sec_o <= (others => 'Z'); -- 7x 8bits securities identifier
order_px_valid_o <= '1';
--
b2_px_type <= (others => 'Z');
b2_buy_sell <= (others => 'Z'); -- 111 buy, 000 sell
b2_px <= (others => 'Z'); -- price
b2_qty <= (others => 'Z'); -- quantity
b2_sec <= (others => 'Z'); -- 7x 8bits securities identifier
b2_id <= (others => 'Z'); -- unique/identifier/counter
b1_px_type <= (others => '0');
b1_buy_sell <= (others => '0'); -- 111 buy, 000 sell
b1_px <= (others => '0'); -- price
b1_qty <= (others => '0'); -- quantity
b1_sec <= (others => '0'); -- 7x 8bits securities identifier
-- b1_id <= (others => '0'); -- unique/identifier/counter
b1_px_valid <= '1';
--
b2_px_type <= std_logic_vector'(std_logic_vector'("00000"));
searchitems_count <= 0;
state <= 8;
 
elsif search_px_type_i = std_logic_vector'("00110") then
238,6 → 240,7
-- correct store_item but there was no match
b2_px_type <= std_logic_vector'("ZZZZZ");
state <= 16;
order_px_valid_o <= '0';
 
when others => null;
end case; -- state

powered by: WebSVN 2.1.0

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