Line 217... |
Line 217... |
store_buy_sell <= search_buy_sell_i;
|
store_buy_sell <= search_buy_sell_i;
|
store_px <= search_px_i;
|
store_px <= search_px_i;
|
store_qty <= search_qty_i;
|
store_qty <= search_qty_i;
|
store_sec <= search_sec_i;
|
store_sec <= search_sec_i;
|
store_id <= search_id_i;
|
store_id <= search_id_i;
|
state <= 6;
|
state <= 5;
|
elsif search_px_type_i = std_logic_vector'("11100") then
|
elsif search_px_type_i = std_logic_vector'("11100") then
|
-- incoming price, register it and start the state machine
|
-- incoming price, register it and start the state machine
|
b1_px_type <= search_px_type_i;
|
b1_px_type <= search_px_type_i;
|
b1_buy_sell <= search_buy_sell_i;
|
b1_buy_sell <= search_buy_sell_i;
|
b1_px <= search_px_i;
|
b1_px <= search_px_i;
|
Line 235... |
Line 235... |
store_px <= search_px_i;
|
store_px <= search_px_i;
|
store_qty <= search_qty_i;
|
store_qty <= search_qty_i;
|
store_sec <= search_sec_i;
|
store_sec <= search_sec_i;
|
store_id <= search_id_i;
|
store_id <= search_id_i;
|
--b2_px_type <= std_logic_vector'(std_logic_vector'("00000"));
|
--b2_px_type <= std_logic_vector'(std_logic_vector'("00000"));
|
state <= 10;
|
state <= 9;
|
else -- nothing 10000 (avoid ZZZZZ)
|
else -- nothing 10000 (avoid ZZZZZ)
|
-- no action - flash up Z's
|
-- no action - flash up Z's
|
order_px_type_o <= std_logic_vector'("10000"); -- avoiding ZZZZZ
|
order_px_type_o <= std_logic_vector'("10000"); -- avoiding ZZZZZ
|
order_buy_sell_o <= (others => 'Z'); -- 111 buy, 000 sell
|
order_buy_sell_o <= (others => 'Z'); -- 111 buy, 000 sell
|
order_px_o <= (others => 'Z'); -- price
|
order_px_o <= (others => 'Z'); -- price
|
Line 259... |
Line 259... |
order_px_o <= (others => 'Z'); -- price
|
order_px_o <= (others => 'Z'); -- price
|
order_qty_o <= (others => 'Z'); -- quantity
|
order_qty_o <= (others => 'Z'); -- quantity
|
order_sec_o <= (others => 'Z'); -- 7x 8bits securities identifier
|
order_sec_o <= (others => 'Z'); -- 7x 8bits securities identifier
|
order_id_o <= (others => 'Z'); -- unique/identifier/counter
|
order_id_o <= (others => 'Z'); -- unique/identifier/counter
|
state <= 16;
|
state <= 16;
|
|
when 5 =>
|
|
-- wait a clock cycle for search_item procesing
|
|
b1_px_valid <= '0';
|
|
state <= 6;
|
when 6 =>
|
when 6 =>
|
-- sent query to set px and qty for a given security
|
-- sent query to set px and qty for a given security
|
if b2_px_type = std_logic_vector'("00110") then
|
if b2_px_type = std_logic_vector'("00110") then
|
-- it's a known security and the value has been set
|
-- it's a known security and the value has been set
|
order_px_type_o <= b2_px_type;
|
order_px_type_o <= b2_px_type;
|
Line 288... |
Line 292... |
b1_px <= store_px;
|
b1_px <= store_px;
|
b1_qty <= store_qty;
|
b1_qty <= store_qty;
|
b1_sec <= store_sec;
|
b1_sec <= store_sec;
|
b1_id <= std_logic_vector(to_unsigned(searchitems_count,16));
|
b1_id <= std_logic_vector(to_unsigned(searchitems_count,16));
|
b1_px_valid <= '1';
|
b1_px_valid <= '1';
|
state <= 4; -- increment items counter / send success
|
state <= 3; -- increment items counter / send success
|
end if;
|
end if;
|
end if;
|
end if;
|
|
when 3 =>
|
|
-- wait a clock cycle for search_item procesing
|
|
b1_px_valid <= '0';
|
|
state <= 4;
|
when 4 =>
|
when 4 =>
|
-- have set a new item, increment count and return
|
-- have set a new item, increment count and return
|
searchitems_count <= searchitems_count + 1;
|
searchitems_count <= searchitems_count + 1;
|
order_px_type_o <= std_logic_vector'("01010"); -- b2_px_type; --
|
order_px_type_o <= std_logic_vector'("01010"); -- b2_px_type; --
|
order_buy_sell_o <= (others => 'Z');
|
order_buy_sell_o <= (others => 'Z');
|
Line 317... |
Line 325... |
b1_qty <= (others => 'Z');
|
b1_qty <= (others => 'Z');
|
b1_sec <= (others => 'Z');
|
b1_sec <= (others => 'Z');
|
b1_id <= (others => 'Z');
|
b1_id <= (others => 'Z');
|
b1_px_valid <= '0';
|
b1_px_valid <= '0';
|
state <= 16;
|
state <= 16;
|
|
when 9 =>
|
|
-- wait a clock cycle for search_item procesing
|
|
b1_px_valid <= '0';
|
|
state <= 10;
|
when 10 =>
|
when 10 =>
|
if b2_px_type = std_logic_vector'("11100") then
|
if b2_px_type = std_logic_vector'("11100") then
|
-- got a hit .. send it
|
-- got a hit .. send it
|
order_px_type_o <= std_logic_vector'("11100");
|
order_px_type_o <= std_logic_vector'("11100");
|
order_px_valid_o <= '1';
|
order_px_valid_o <= '1';
|