bench: Clean up HWITL bench

This commit is contained in:
Markus Koch 2022-05-13 20:42:18 +02:00
parent e420b08eb2
commit 8f4e996d57

View File

@ -44,11 +44,6 @@ architecture mac of top_hwitl is
constant F_CLK : integer := 50000000; constant F_CLK : integer := 50000000;
constant F_CLK_PHY : integer := 140000000; constant F_CLK_PHY : integer := 140000000;
constant LED_BLINK : boolean_vector(led_n'range) := (
6 downto 2 => true,
others => false
);
constant ETH_CONFIG : configuration_t := ( constant ETH_CONFIG : configuration_t := (
mac_address => (x"00", x"ff", x"ff", x"11", x"22", x"33") mac_address => (x"00", x"ff", x"ff", x"11", x"22", x"33")
); );
@ -57,8 +52,6 @@ architecture mac of top_hwitl is
signal clk_phy : std_logic; signal clk_phy : std_logic;
signal phy_pll_lock : std_logic; signal phy_pll_lock : std_logic;
signal led_sig : std_logic_vector(led_n'range);
signal phy_out : phy_out_t; signal phy_out : phy_out_t;
signal phy_in : phy_in_t; signal phy_in : phy_in_t;
@ -70,9 +63,6 @@ architecture mac of top_hwitl is
constant BYTE_CNT_MAX : integer := 100; constant BYTE_CNT_MAX : integer := 100;
signal byte_cnt : integer range 0 to BYTE_CNT_MAX; signal byte_cnt : integer range 0 to BYTE_CNT_MAX;
signal button_n_sync : std_logic_vector(button_n'range);
signal button : std_logic_vector(button_n'range);
constant TMO_MAX : integer := integer(round((real(F_CLK) * 0.25))) - 1; constant TMO_MAX : integer := integer(round((real(F_CLK) * 0.25))) - 1;
signal tmo : integer range 0 to TMO_MAX; signal tmo : integer range 0 to TMO_MAX;
begin begin
@ -118,42 +108,6 @@ begin
end if; end if;
end process reset_sync; end process reset_sync;
ledcon_inst : entity work.ledcon
generic map(
F_CLK => F_CLK,
BLINK => LED_BLINK
)
port map(
clk => clk,
rst => rst,
sig => led_sig,
led_n => led_n
);
led_sig <= (
0 => phy_pll_lock,
1 => phy_out.carrier_detect,
2 => phy_out.rx_active,
3 => phy_out.rx_error,
4 => mac_out.rx_mac_crc_ok,
5 => mac_out.rx_mac_crc_error,
6 => mac_out.tx_active,
7 => '0'
);
synchronizer_inst : entity trashernet.synchronizer
generic map(
SIZE => 2
)
port map(
clk => clk,
rst => rst,
data_in => button_n(0),
data_out => button_n_sync(0)
);
button <= not button_n_sync;
receiver : process(clk, rst) is receiver : process(clk, rst) is
begin begin
if rst then if rst then
@ -174,7 +128,7 @@ begin
end if; end if;
end if; end if;
if (tmo = 0) or (button(0) = '1') then if tmo = 0 then
state <= TX; state <= TX;
byte_cnt <= BYTE_CNT_MAX; byte_cnt <= BYTE_CNT_MAX;
mac_in.tx_header.mac_destination <= (others => x"FF"); mac_in.tx_header.mac_destination <= (others => x"FF");
@ -229,11 +183,6 @@ architecture eth of top_hwitl is
constant F_CLK : integer := 50000000; constant F_CLK : integer := 50000000;
constant F_CLK_PHY : integer := 140000000; constant F_CLK_PHY : integer := 140000000;
constant LED_BLINK : boolean_vector(led_n'range) := (
6 downto 2 => true,
others => false
);
constant ETH_CONFIG : configuration_t := ( constant ETH_CONFIG : configuration_t := (
mac_address => (x"00", x"ff", x"ff", x"11", x"22", x"33") mac_address => (x"00", x"ff", x"ff", x"11", x"22", x"33")
); );