trashernet/bench/bench_pkg.vhd

37 lines
1.3 KiB
VHDL
Raw Normal View History

2021-09-04 19:33:32 +02:00
-- -------------------------------------------------------------------------- --
-- TRASHERNET - A Trashy Ethernet Stack for FPGAs --
-- -------------------------------------------------------------------------- --
-- bench_pkg.vhd : Types and functions used for the benches
-- -------------------------------------------------------------------------- --
-- Author : Markus Koch <markus@notsyncing.net>
-- Contributors : None
-- License : Mozilla Public License (MPL) Version 2
-- -------------------------------------------------------------------------- --
2021-08-30 12:14:58 +02:00
library ieee;
use ieee.std_logic_1164.all;
library trashernet;
use trashernet.trashernet_pkg.all;
2021-08-30 12:14:58 +02:00
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
2021-08-30 13:27:03 +02:00
report (" TX Byte: " & to_hstring(data(i)));
2021-08-30 12:14:58 +02:00
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;
2021-08-30 13:27:03 +02:00
wait for 16 us; -- IPG
report "Frame TX complete";
2021-08-30 12:14:58 +02:00
end procedure send_data;
end package body bench_pkg;