- added gigabit_en pin

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@885 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2010-04-08 19:03:50 +00:00
parent e40bb138ba
commit 0737dc8c74
+3 -9
View File
@@ -12,8 +12,6 @@ ENTITY pkt_gen IS
(
f_sysclk : real := 100.0;
TX_RAM_SIZE : natural := 2048;
PKT_DLY_MIN : real := 1.0E-6;
PKT_DLY_MAX : real := 100.0E-6;
PKT_SIZE_MIN : natural := 64;
PKT_SIZE_MAX : natural := 1518
@@ -23,6 +21,7 @@ ENTITY pkt_gen IS
clk : in STD_LOGIC;
rst : in STD_LOGIC;
en : in STD_LOGIC;
gigabit_en : in STD_LOGIC;
mii_tx_clk : in STD_LOGIC;
mii_tx_en : out STD_LOGIC;
mii_tx_er : out STD_LOGIC;
@@ -38,7 +37,6 @@ ARCHITECTURE behavior OF pkt_gen IS
signal pkt_data : unsigned(31 downto 0);
signal pkt_nbytes : word_ptr_t := X"0040";
signal pkt_nwords : word_ptr_t := X"0010";
signal pkt_delay : natural := natural(1.0*f_sysclk);
signal fill_size : word_ptr_t;
signal fill_cnt : word_ptr_t;
@@ -73,13 +71,13 @@ host_state_next:
end process;
host_state:
process(host_s, tx_ctrl_out, pkt_nbytes, fill_rdy, en)
process(host_s, tx_ctrl_out, pkt_nbytes, fill_rdy, en, gigabit_en)
begin
tx_ctrl_in.pkt_alloc_en <= '0';
tx_ctrl_in.pkt_commit_en <= '0';
tx_ctrl_in.reset <= '0';
tx_ctrl_in.Gbps_en <= '0';
tx_ctrl_in.Gbps_en <= gigabit_en;
tx_ctrl_in.tx_size <= pkt_nbytes;
fill_set <= '0';
fill_en <= '0';
@@ -132,7 +130,6 @@ host_state:
pkt_generator:
process(clk)
variable size : word_ptr_t;
variable delay : natural;
variable krand : real;
variable seed1 : integer;
variable seed2 : integer;
@@ -141,7 +138,6 @@ pkt_generator:
if rising_edge(clk) then
if rst = '1' then
size := to_unsigned(PKT_SIZE_MIN, word_ptr_t'length);
delay := natural(1.0E6*PKT_DLY_MIN*f_sysclk);
seed1 := 31101970;
seed2 := 12586901;
tx_packets <= 0;
@@ -149,11 +145,9 @@ pkt_generator:
elsif tx_ctrl_in.pkt_commit_en = '1' then
uniform(seed1, seed2, krand);
size := to_unsigned(PKT_SIZE_MIN + natural(real(PKT_SIZE_MAX-PKT_SIZE_MIN)*krand), word_ptr_t'length);
delay := natural(1.0E6*f_sysclk*(PKT_DLY_MIN + (PKT_DLY_MAX-PKT_DLY_MIN)*krand));
tx_packets <= tx_packets + 1;
tx_bytes <= tx_bytes + to_integer(pkt_nbytes);
end if;
pkt_delay <= delay;
pkt_nbytes <= size;
if size(1 downto 0) = 0 then
pkt_nwords <= "00" & size(word_ptr_t'left downto 2);