37 lines
1.3 KiB
VHDL
37 lines
1.3 KiB
VHDL
-- -------------------------------------------------------------------------- --
|
|
-- 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
|
|
-- -------------------------------------------------------------------------- --
|
|
|
|
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
|
|
library trashernet;
|
|
use trashernet.trashernet_pkg.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;
|