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
/open_hitter/trunk/rtl/vhdl
- from Rev 21 to Rev 22
- ↔ Reverse comparison
Rev 21 → Rev 22
/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; |
/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 |