- added FCS-check (CRC32)

- added FCS check enable
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@895 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2010-04-09 09:00:38 +00:00
parent 330b7e019e
commit e7f4a5642a
+42 -2
View File
@@ -104,8 +104,15 @@ ARCHITECTURE behavior OF emac_rx IS
signal mac_chk_addr : mac_addr_t;
signal Gbps_en : std_logic;
signal fcs_chk_en : std_logic;
signal rx_en : std_logic;
signal fcs_vld : std_logic;
signal fcs_din_vld : std_logic;
signal fcs_din : unsigned(7 downto 0);
signal fcs : unsigned(31 downto 0);
signal fcs_chk_OK : std_logic;
type host_state_t is (host_init, host_flush, host_idle);
signal host_s, host_sn : host_state_t;
@@ -143,11 +150,11 @@ begin
ram_addr_a <= xfer_ptr;
ram_we_a <= xfer_en and sipo32_dout_vld;
xfer_vld <= mac_chk_OK or mac_chk_BC or xfer_promiscious;
xfer_vld <= (mac_chk_OK or mac_chk_BC or xfer_promiscious) and (not fcs_chk_en or fcs_chk_OK);
cmd_fifo_we <= commit_en and xfer_vld;
cmd_fifo_re <= ctrl_in.pkt_free_en;
cmd_pkt_valid_in <= '1';
cmd_pkt_valid_in <= fcs_chk_OK;
cmd_mac_ok_in <= mac_chk_OK;
cmd_bcast_in <= mac_chk_BC;
cmd_nbytes_in <= byte_count;
@@ -194,6 +201,7 @@ host2xfer_sync_register:
if rising_edge(mii_rx_clk) then
xfer_promiscious <= ctrl_in.promiscious;
Gbps_en <= ctrl_in.Gbps_en;
fcs_chk_en <= ctrl_in.fcs_chk_en;
mac_addr <= ctrl_in.mac_addr;
xfer_ram_limit <= host_ram_limit;
end if;
@@ -472,6 +480,38 @@ inst_sipo32 : entity work.sipo
);
inst_fcs: entity work.crc32
GENERIC MAP
(
crc32_init => X"00000000"
)
PORT MAP
(
rst => byte_count_rst,
clk => mii_rx_clk,
din_vld => fcs_din_vld,
din => fcs_din,
crc32_vld => fcs_vld,
crc32_out => fcs
);
fcs_din <= sipo32_din;
fcs_din_vld <= sipo32_en and sipo32_din_vld;
fcs_chk_register:
process(mii_rx_clk)
begin
if rising_edge(mii_rx_clk) then
if fcs_vld = '1' then
fcs_chk_OK <= '0';
if fcs = X"2144DF1C" then
fcs_chk_OK <= '1';
end if;
end if;
end if;
end process;
mii_input_register:
process(mii_rx_clk)
begin