Цитата(Timmy @ Sep 25 2015, 14:22)
У меня нет, я работал с Lattice, и для гигабитного эзернета он сам умеет корректировать IDLE коды.
Таблицу можно надёжно построить, вставив в тестбенч какой-нибудь бесплатный энкодер, прогнав через него все коды, и посчитав паритет на 10-битном выходе. Или найти полную таблицу кодов в удобном для импорта виде, и опять же посчитать паритет.
Нашел вот такое описание, сейчас с ним занимаюсь:
Description
How and when should I use the CRC in the RocketIO dedicated hardware?
Solution
Gigabit Ethernet:
Your design should generate only the /K28.5/D16.2/ idle sequence for transmission, never /K28.5/D5.6/. When the RocketIO CRC determines that the running disparity must be inverted to satisfy Gigabit Ethernet requirements, it will convert the first /K28.5/D16.2/ idle following a packet to /K28.5/D5.6/, performing the necessary inversion.
Fiber Channel:
Your design should generate only the EOF frame delimiter for a beginning running disparity (RD), which is negative; these are the frame delimiters that begin with /K28.5/D21.4/ or /K28.5/D10.4/. Never generate the EOF frame delimiter for a beginning RD (which is positive); these are the frame delimiters that begin with /K28.5/D21.5/ or /K28.5/D10.5/.
When the RocketIO CRC determines that the running disparity must be inverted to satisfy Fiber Channel requirements, it will convert the second byte of the EOF frame delimiter (D21.4 or D10.4) to the value that is required to invert the running disparity (D21.5 or D10.5).
This Fiber Channel symbol swapping is disabled when TX_CRC_USE is set to "FALSE."
If the CRC of the RocketIO transceiver block is not used, the end-of-packet ordered set (Fiber Channel) or idle (Ethernet) is not automatically changed to maintain the disparity required by the standard (see the RocketIO User Guide, Chapter 3, CRC section for details).
In this case, you must manually send the correct end-of-packet character to maintain the disparity required by Fiber Channel. This requires that you maintain the running disparity in the fabric and present the correct EOP character to the RocketIO transceiver.
Here is a VHDL code example to switch between the two IDLE code groups in Ethernet. The same logic can be used to switch between the two EOP characters in Fiber Channel.
-------------------------------------------------------------------------------
-- Tx Disparity Generation Support.
-------------------------------------------------------------------------------
MANUAL_DISPARITY: if (C_USE_MGT_CRC = false) generate
-- Since we are not allowing the MGT to insert the CRC value at the end of a
-- frame, the MGT will not be correcting for the disparity at the end of each
-- frame transmitted: we must track the disparity ourselves and insert either
-- /I1/ or /I2/ appropriately as the first Idle following a frame.
-- /I1/ and /I2/ are IDLE codes for PCS, with opposite disparities. The EOFs in FC should work in the same way.
-- The disparity function is defined in the IEEE Ethernet spec, clause 36.2.4.4.
-- This describes the function as operating on the 10-bit code groups. Since we
-- are using the MGT's, there is no access to these 10-bit code groups. Instead
-- the 8-bit code groups which cause a disparity change are here decoded. The CODE_GRP mentioned is a single byte of raw data.
-- purpose: Creates a Partial product to calculate the Running Disparity,
-- based on upper 3 bits.
-- type : combinatorial -- BIT(7) BIT(6) BIT(5)
DISP3 <= (not CODE_GRP(6) and not CODE_GRP(5)) or -- x 0 0
(CODE_GRP(7) and CODE_GRP(6) and CODE_GRP(5)); -- 1 1 1
-- purpose: Creates a Partial product to calculate the Running Disparity,
-- based on lower 5 bits.
-- type : combinatorial -- BIT(4) BIT(3) BIT(2) BIT(1) BIT(0)
DISP5 <= (not CODE_GRP(2) and not CODE_GRP(1) and not CODE_GRP(0)) or -- x x 0 0 0
(CODE_GRP(1) and CODE_GRP(0) and ( -- 1 1 x 1 1
(CODE_GRP(4) and CODE_GRP(3)) or -- 0 1 1 1 1
(CODE_GRP(2) and (CODE_GRP(4) xor CODE_GRP(3))))) or -- 1 0 1 1 1
(CODE_GRP(4) and CODE_GRP(3) and CODE_GRP(2) -- 1 1 1 0 1
and (CODE_GRP(1) xor CODE_GRP(0))) or -- 1 1 1 1 0
(not CODE_GRP(4) and not CODE_GRP(3) and ( -- 0 0 0 0 1
(not CODE_GRP(2) and (CODE_GRP(1) xor CODE_GRP(0))) or -- 0 0 0 1 0
(CODE_GRP(2) and not CODE_GRP(1) and not CODE_GRP(0)))); -- 0 0 1 0 0
-- purpose: Creates the Disparity value.
-- type : sequential
GEN_DISPARITY: process (TX_CLK)
begin
if TX_CLK'event and TX_CLK = '1' then
if RESET = '1' then
DISPARITY <= '1';
else
if (INSERT_IDLE and EVEN) = '1' then
DISPARITY <= '0';
elsif (DISP3 xor DISP5) = '1' or K28p5 = '1' then
DISPARITY <= not DISPARITY;
end if;
end if;
end if;
end process GEN_DISPARITY;