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 21 to Rev 22
    Reverse comparison

Rev 21 → Rev 22

/open_hitter/trunk/bench/vhdl/search_item_wrapper.vhd
183,7 → 183,7
begin
write (l, String'("Exercising search_item"));
writeline (output, l);
RX_CLK <= '1';
RX_CLK <= '0';
wait for 1 ns;
 
-- Check each pattern.
197,7 → 197,7
b1_sec <= input_patterns(i).b1_sec;
b1_id <= input_patterns(i).b1_id;
-- Clock once (falling edge) for the results.
RX_CLK <= '0';
RX_CLK <= '1';
wait for 1 ns;
-- Check the outputs.
assert b2_px_type = output_patterns(i).b2_px_type report "search_item_wrapper: test: " & integer'image(i) & " bad px type" severity error;
207,7 → 207,7
assert b2_sec = output_patterns(i).b2_sec report "search_item_wrapper: test: " & integer'image(i) & " bad sec" severity error;
assert b2_id = output_patterns(i).b2_id report "search_item_wrapper: test: " & integer'image(i) & " bad id" severity error;
-- Clock down.
RX_CLK <= '1';
RX_CLK <= '0';
wait for 1 ns;
end loop;
write (l, String'("Done search_item"));
/open_hitter/trunk/bench/vhdl/search_control_wrapper.vhd
199,8 → 199,8
(std_logic_vector'("11100"), std_logic_vector'("000"), test_px, remain_qty, test_sec1, std_logic_vector'(X"0001")) ); -- 11incoming px (part qty)
begin
-- diagnostics (uncomment)
-- write (l, String'("Exercising search_control"));
-- writeline (output, l);
write (l, String'("Exercising search_control"));
writeline (output, l);
RX_CLK <= '0';
wait for 1 us;
 
207,9 → 207,9
-- Check each pattern.
for i in input_patterns'range loop
-- diagnostics (uncomment)
-- write (l, String'("Wrapper start loop i: "));
-- write (l, i);
-- writeline (output, l);
-- write (l, String'("Wrapper start loop i: "));
-- write (l, i);
-- writeline (output, l);
 
-- Set the inputs.
search_px_valid_i <= input_patterns(i).search_px_valid_i;
225,13 → 225,17
search_px_valid_i <= '0';
-- Check the outputs.
res := 0;
for r in 0 to 3 loop
for r in 0 to 5 loop
-- diagnostics (uncomment)
-- write (l, String'(" Wrapper wait results r: "));
-- write (l, r);
-- write (l, String'(" order_px_valid_o: "));
-- write (l, std_logic'image(order_px_valid_o));
-- writeline (output, l);
-- write (l, String'(" Wrapper wait results r: "));
-- write (l, r);
-- write (l, String'(" order_px_valid_o: "));
-- write (l, std_logic'image(order_px_valid_o));
-- write (l, String'(" order_id_o: "));
-- for c in order_id_o'range loop
-- write(l, std_logic'image(order_id_o(c)) );
-- end loop;
-- writeline (output, l);
if order_px_valid_o = '1' then
assert order_px_type_o = output_patterns(i).order_px_type_o report "search_control_wrapper: test: " & integer'image(i) & " bad px type" severity error;
assert order_buy_sell_o = output_patterns(i).order_buy_sell_o report "search_control_wrapper: test: " & integer'image(i) & " bad buy_sell" severity error;
/open_hitter/trunk/rtl/vhdl/search_item.vhd
91,10 → 91,10
match: process (RX_CLK) is
-- variable l : line;
begin
if falling_edge(RX_CLK) then
if rising_edge(RX_CLK) then
 
-- diagnostic (uncomment)
-- write (l, String'(" Item Falling Edge"));
-- write (l, String'(" Item Rising Edge"));
-- write (l, String'(" b1_px_type: "));
-- for j in b1_px_type'range loop
-- write(l, std_logic'image(b1_px_type(j)) );
106,6 → 106,10
-- write (l, String'(" b1_id: "));
-- for j in b1_id'range loop
-- write(l, std_logic'image(b1_id(j)) );
-- end loop;
-- write (l, String'(" store_qty: "));
-- for j in store_qty'range loop
-- write(l, std_logic'image(store_qty(j)) );
-- end loop;
-- write (l, String'(" b1_px_valid: "));
-- write (l, std_logic'image(b1_px_valid) );
211,19 → 215,14
b2_sec <= store_sec; -- 7x 8bits securities identifier
b2_id <= item_id; -- unique/identifier/counter
b2_px <= b1_px; -- price
-- b2_qty <=
if b1_qty < store_qty then
-- update the store qty and adjust the return value
if ( to_integer(unsigned(b1_qty)) < to_integer(unsigned(store_qty)) ) then
b2_qty <= b1_qty;
else
b2_qty <= store_qty;
end if; -- quantity
-- update the store
-- store_qty
if (b1_qty < store_qty) then
store_qty <= std_logic_vector(to_unsigned( to_integer(unsigned(store_qty)) - to_integer(unsigned(b1_qty)) ,16 ));
else
b2_qty <= store_qty;
store_qty <= (others => '0');
end if;
end if;
b2_px_type <= std_logic_vector'(std_logic_vector'("11100"));
requires_reset <= '1';
end if;
/open_hitter/trunk/rtl/vhdl/search_control.vhd
219,7 → 219,7
store_qty <= search_qty_i;
store_sec <= search_sec_i;
store_id <= search_id_i;
state <= 6;
state <= 5;
elsif search_px_type_i = std_logic_vector'("11100") then
-- incoming price, register it and start the state machine
b1_px_type <= search_px_type_i;
237,7 → 237,7
store_sec <= search_sec_i;
store_id <= search_id_i;
--b2_px_type <= std_logic_vector'(std_logic_vector'("00000"));
state <= 10;
state <= 9;
else -- nothing 10000 (avoid ZZZZZ)
-- no action - flash up Z's
order_px_type_o <= std_logic_vector'("10000"); -- avoiding ZZZZZ
261,6 → 261,10
order_sec_o <= (others => 'Z'); -- 7x 8bits securities identifier
order_id_o <= (others => 'Z'); -- unique/identifier/counter
state <= 16;
when 5 =>
-- wait a clock cycle for search_item procesing
b1_px_valid <= '0';
state <= 6;
when 6 =>
-- sent query to set px and qty for a given security
if b2_px_type = std_logic_vector'("00110") then
290,9 → 294,13
b1_sec <= store_sec;
b1_id <= std_logic_vector(to_unsigned(searchitems_count,16));
b1_px_valid <= '1';
state <= 4; -- increment items counter / send success
state <= 3; -- increment items counter / send success
end if;
end if;
when 3 =>
-- wait a clock cycle for search_item procesing
b1_px_valid <= '0';
state <= 4;
when 4 =>
-- have set a new item, increment count and return
searchitems_count <= searchitems_count + 1;
319,6 → 327,10
b1_id <= (others => 'Z');
b1_px_valid <= '0';
state <= 16;
when 9 =>
-- wait a clock cycle for search_item procesing
b1_px_valid <= '0';
state <= 10;
when 10 =>
if b2_px_type = std_logic_vector'("11100") then
-- got a hit .. send it

powered by: WebSVN 2.1.0

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