Compare commits

..

2 Commits

Author SHA1 Message Date
d1e0143c9d phy: Fix TX manchester encoding
Ethernet uses "inverted" manchester as per IEEE 802.3.
2022-01-23 16:02:31 +01:00
1bcddf4273 phy: Improve NLP timeout accuracy 2022-01-23 16:01:33 +01:00

View File

@ -56,7 +56,7 @@ begin
signal bit_cnt : integer range 0 to 7; signal bit_cnt : integer range 0 to 7;
-- NLP supervision -- NLP supervision
constant NLP_TIMEOUT_CNT_MAX : integer := integer(round(real(F_CLK) * 16.0 * 10.0 ** (-3))); -- Every 16 ms constant NLP_TIMEOUT_CNT_MAX : integer := integer(round(real(F_CLK) * 16.0 * 10.0 ** (-3))) - 1; -- Every 16 ms
signal nlp_timeout_cnt : integer range 0 to NLP_TIMEOUT_CNT_MAX; signal nlp_timeout_cnt : integer range 0 to NLP_TIMEOUT_CNT_MAX;
begin begin
-- Synchronize RX input -- Synchronize RX input
@ -396,8 +396,8 @@ begin
tx_p <= '1'; tx_p <= '1';
tx_n <= '0'; tx_n <= '0';
when ACTIVE => when ACTIVE =>
tx_p <= sr(sr'low) xor bit_stage; tx_p <= sr(sr'low) xnor bit_stage;
tx_n <= not (sr(sr'low) xor bit_stage); tx_n <= not (sr(sr'low) xnor bit_stage);
end case; end case;
end if; end if;
end process driver; end process driver;