diff --git a/lib/emac/src/tb_emac_top_jb.vhd b/lib/emac/src/tb_emac_top_jb.vhd index 5b2ce3e..bf6c9a2 100644 --- a/lib/emac/src/tb_emac_top_jb.vhd +++ b/lib/emac/src/tb_emac_top_jb.vhd @@ -514,6 +514,157 @@ STIMULUS: process begin + -- 100 Mbps + wait for 6*MII_CLK_PERIOD; + RST <= '0'; + wait for 60*CLK_PERIOD; + emac_rx_reset_100mbps; + emac_tx_reset_100mbps; + pktgen_gigabit <= '0'; + pktgen_fcs_en <= '1'; + wait for 60*CLK_PERIOD; + + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + emac_alloc (1004); + + for i in 1 to 1 loop + for j in 1 to 10 loop + emac_alloc (72); + emac_write (72); + end loop; + wait for 1 ms; + end loop; + + wait for 60*CLK_PERIOD; + + wait until rising_edge(mii_tx_clk_board) and mii_tx_en = '0'; + + loop_back_en <= '1'; + + emac_alloc (74); + emac_write (74); + + emac_alloc (105); + emac_write (105); + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_alloc (103); + emac_write (103); + + emac_read (0); + emac_free; + + emac_alloc (71); + emac_write (71); + + emac_read (0); + emac_free; + + emac_alloc (82); + emac_write (82); + + emac_alloc (86); + emac_write (86); + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_alloc (77); + emac_write (77); + + emac_alloc (99); + emac_write (99); + + emac_alloc (65); + emac_write (65); + + emac_alloc (321); + emac_write (321); + + emac_read (0); + emac_free; + + emac_alloc (1111); + emac_write (1111); + + emac_read (0); + emac_free; + + emac_alloc (73); + emac_write (73); + + emac_alloc (107); + emac_write (107); + + emac_alloc (83); + emac_write (83); + + emac_read (0); + emac_free; + + emac_alloc (72); + emac_write (72); + + emac_alloc (1003); + emac_write (1003); + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + emac_read (0); + emac_free; + + wait for 60*CLK_PERIOD; + + loop_back_en <= '0'; + pktgen_en <= '1'; + pkt_count <= 0; + for i in 1 to 500 loop + wait for 1 us; + emac_read (0); + emac_free; + pkt_count <= pkt_count + 1; + end loop; + pktgen_en <= '0'; + emac_read (0); + emac_free; + + + -- 1000 MBps + RST <= '1'; wait for 6*MII_CLK_PERIOD; RST <= '0'; wait for 60*CLK_PERIOD; @@ -661,7 +812,6 @@ STIMULUS: process emac_read (0); emac_free; - wait; end process;