- renamed signal names
- added pkt_done flag (TX idle) - transmitter commands: packet alloc : request ram for packet packet commit : sends packet 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@829 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
+15
-15
@@ -67,9 +67,9 @@ ARCHITECTURE behavior OF emac_tx IS
|
|||||||
|
|
||||||
signal nwords_free : word_ptr_t;
|
signal nwords_free : word_ptr_t;
|
||||||
signal alloc_size : word_ptr_t;
|
signal alloc_size : word_ptr_t;
|
||||||
signal alloc_en : std_logic;
|
signal mem_alloc_en : std_logic;
|
||||||
|
|
||||||
signal free_en : std_logic;
|
signal mem_free_en : std_logic;
|
||||||
signal commit_en : std_logic;
|
signal commit_en : std_logic;
|
||||||
signal uncommit_en : std_logic;
|
signal uncommit_en : std_logic;
|
||||||
|
|
||||||
@@ -127,8 +127,8 @@ ARCHITECTURE behavior OF emac_tx IS
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
ctrl_out.tx_req <= alloc_req;
|
ctrl_out.pkt_alloc_req <= alloc_req;
|
||||||
|
ctrl_out.pkt_done <= cmd_fifo_empty;
|
||||||
mii_tx_er <= ctrl_in.tx_er;
|
mii_tx_er <= ctrl_in.tx_er;
|
||||||
|
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ host_state_next:
|
|||||||
end process;
|
end process;
|
||||||
|
|
||||||
host_state:
|
host_state:
|
||||||
process(host_s, alloc_req, alloc_OK, fill_rdy, din_vld)
|
process(host_s, alloc_req, alloc_OK, fill_rdy, din_vld, ctrl_in.pkt_commit_en)
|
||||||
begin
|
begin
|
||||||
|
|
||||||
flush_en <= '0';
|
flush_en <= '0';
|
||||||
@@ -176,7 +176,7 @@ host_state:
|
|||||||
fill_ptr_adv <= '0';
|
fill_ptr_adv <= '0';
|
||||||
commit_en <= '0';
|
commit_en <= '0';
|
||||||
alloc_ack <= '0';
|
alloc_ack <= '0';
|
||||||
alloc_en <= '0';
|
mem_alloc_en <= '0';
|
||||||
|
|
||||||
host_sn <= host_s;
|
host_sn <= host_s;
|
||||||
|
|
||||||
@@ -215,13 +215,13 @@ host_state:
|
|||||||
fill_ptr_adv <= not fill_rdy and din_vld;
|
fill_ptr_adv <= not fill_rdy and din_vld;
|
||||||
if alloc_req = '1' then
|
if alloc_req = '1' then
|
||||||
host_sn <= host_alloc;
|
host_sn <= host_alloc;
|
||||||
elsif fill_rdy = '1' then
|
elsif fill_rdy = '1' or ctrl_in.pkt_commit_en = '1' then
|
||||||
host_sn <= host_commit;
|
host_sn <= host_commit;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
when host_commit =>
|
when host_commit =>
|
||||||
commit_en <= '1';
|
commit_en <= '1';
|
||||||
alloc_en <= '1';
|
mem_alloc_en <= '1';
|
||||||
host_sn <= host_idle;
|
host_sn <= host_idle;
|
||||||
|
|
||||||
when others =>
|
when others =>
|
||||||
@@ -239,7 +239,7 @@ alloc_request_logic:
|
|||||||
if rising_edge(clk) then
|
if rising_edge(clk) then
|
||||||
if rst = '1' then
|
if rst = '1' then
|
||||||
alloc_req <= '0';
|
alloc_req <= '0';
|
||||||
elsif ctrl_in.tx_req_en = '1' and alloc_req = '0' then
|
elsif ctrl_in.pkt_alloc_en = '1' and alloc_req = '0' then
|
||||||
alloc_req <= '1';
|
alloc_req <= '1';
|
||||||
fill_remain <= ctrl_in.tx_size(1 downto 0);
|
fill_remain <= ctrl_in.tx_size(1 downto 0);
|
||||||
fill_size <= ctrl_in.tx_size(word_ptr_t'left+2 downto 2);
|
fill_size <= ctrl_in.tx_size(word_ptr_t'left+2 downto 2);
|
||||||
@@ -289,9 +289,9 @@ nwords_free_counter:
|
|||||||
if rising_edge(clk) then
|
if rising_edge(clk) then
|
||||||
if flush_en = '1' then
|
if flush_en = '1' then
|
||||||
nwords_free <= (others => '1');
|
nwords_free <= (others => '1');
|
||||||
elsif alloc_en = '1' then
|
elsif mem_alloc_en = '1' then
|
||||||
nwords_free <= nwords_free - fill_size;
|
nwords_free <= nwords_free - fill_size;
|
||||||
elsif free_en = '1' then
|
elsif mem_free_en = '1' then
|
||||||
nwords_free <= nwords_free + xfer_size;
|
nwords_free <= nwords_free + xfer_size;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
@@ -345,7 +345,7 @@ xfer_state_next:
|
|||||||
end process;
|
end process;
|
||||||
|
|
||||||
xfer_state:
|
xfer_state:
|
||||||
process(xfer_s, cmd_fifo_empty, xfer_odd, xfer_rdy, inter_frame_gap_rdy, alloc_en, mii_fifo_full)
|
process(xfer_s, cmd_fifo_empty, xfer_odd, xfer_rdy, inter_frame_gap_rdy, mem_alloc_en, mii_fifo_full)
|
||||||
begin
|
begin
|
||||||
|
|
||||||
xfer_cnt_set <= '0';
|
xfer_cnt_set <= '0';
|
||||||
@@ -354,7 +354,7 @@ xfer_state:
|
|||||||
xfer_ptr_adv <= '0';
|
xfer_ptr_adv <= '0';
|
||||||
xfer_remain_en <= '0';
|
xfer_remain_en <= '0';
|
||||||
mii_fifo_we <= '0';
|
mii_fifo_we <= '0';
|
||||||
free_en <= '0';
|
mem_free_en <= '0';
|
||||||
uncommit_en <= '0';
|
uncommit_en <= '0';
|
||||||
|
|
||||||
xfer_sn <= xfer_s;
|
xfer_sn <= xfer_s;
|
||||||
@@ -396,8 +396,8 @@ xfer_state:
|
|||||||
end if;
|
end if;
|
||||||
|
|
||||||
when xfer_free =>
|
when xfer_free =>
|
||||||
free_en <= not alloc_en;
|
mem_free_en <= not mem_alloc_en;
|
||||||
if alloc_en = '0' then
|
if mem_alloc_en = '0' then
|
||||||
uncommit_en <= '1';
|
uncommit_en <= '1';
|
||||||
xfer_sn <= xfer_idle;
|
xfer_sn <= xfer_idle;
|
||||||
end if;
|
end if;
|
||||||
|
|||||||
Reference in New Issue
Block a user