trashernet/bench/bench_pkg.vhd

27 lines
710 B
VHDL

library ieee;
use ieee.std_logic_1164.all;
library trashernet;
use trashernet.trashernet_types.all;
package bench_pkg is
procedure send_data(signal rx_p : inout std_logic; constant data : in byte_vector);
end package bench_pkg;
package body bench_pkg is
procedure send_data(signal rx_p : inout std_logic; constant data : in byte_vector) is
begin
for i in data'low to data'high loop
report (" TX Byte: " & to_hstring(data(i)));
for j in data(i)'low to data(i)'high loop
rx_p <= not data(i)(j);
wait for 50 ns;
rx_p <= data(i)(j);
wait for 50 ns;
end loop;
end loop;
wait for 16 us; -- IPG
report "Frame TX complete";
end procedure send_data;
end package body bench_pkg;