Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
30
Issues
30
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit core collection
Commits
d16c342d
Commit
d16c342d
authored
Jul 16, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wr_mini_nic: partially fixed hang-on-RX-flood bug
parent
b0658a59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
12 deletions
+44
-12
wr_mini_nic.vhd
modules/wr_mini_nic/wr_mini_nic.vhd
+44
-12
No files found.
modules/wr_mini_nic/wr_mini_nic.vhd
View file @
d16c342d
...
...
@@ -6,7 +6,7 @@
-- Author : Tomasz Wlostowski
-- Company : CERN BE-Co-HT
-- Created : 2010-07-26
-- Last update: 2012-0
6-05
-- Last update: 2012-0
7-13
-- Platform : FPGA-generic
-- Standard : VHDL
-------------------------------------------------------------------------------
...
...
@@ -222,7 +222,7 @@ architecture behavioral of wr_mini_nic is
-- RX FSM stuff
-------------------------------------------------------------------------------
type
t_rx_fsm_state
is
(
RX_WAIT_SOF
,
RX_MEM_RESYNC
,
RX_MEM_FLUSH
,
RX_ALLOCATE_DESCRIPTOR
,
RX_DATA
,
RX_UPDATE_DESC
);
type
t_rx_fsm_state
is
(
RX_WAIT_SOF
,
RX_MEM_RESYNC
,
RX_MEM_FLUSH
,
RX_ALLOCATE_DESCRIPTOR
,
RX_DATA
,
RX_UPDATE_DESC
,
RX_IGNORE
,
RX_BUF_FULL
);
signal
nrx_state
:
t_rx_fsm_state
;
signal
nrx_avail
:
unsigned
(
g_memsize_log2
-1
downto
0
);
...
...
@@ -525,7 +525,7 @@ begin -- behavioral
if
(
ntx_cntr_is_zero
=
'1'
)
then
src_stb_int
<=
'0'
;
ntx_state
<=
TX_OOB1
;
-- ntx_mem_a <= ntx_mem_a + 1;
-- ntx_mem_a <= ntx_mem_a + 1;
else
ntx_cntr
<=
ntx_cntr
-
1
;
ntx_state
<=
TX_LWORD
;
...
...
@@ -712,9 +712,7 @@ begin -- behavioral
regs_in
.
mcr_rx_full_i
<=
'0'
;
nrx_newpacket
<=
'0'
;
snk_err_o
<=
'0'
;
snk_cyc_d0
<=
'0'
;
else
snk_cyc_d0
<=
snk_cyc_i
;
-- Host can modify the RX DMA registers only when the DMA engine is disabled
-- (MCR_RX_EN = 0)
...
...
@@ -735,7 +733,7 @@ begin -- behavioral
nrx_mem_a_saved
<=
unsigned
(
regs_out
.
rx_addr_o
(
g_memsize_log2
+
1
downto
2
));
nrx_bufstart
<=
unsigned
(
regs_out
.
rx_addr_o
(
g_memsize_log2
+
1
downto
2
));
regs_in
.
rx_addr_i
<=
(
others
=>
'0'
);
-- nrx_mem_a <= unsigned(minic_rx_addr_new(g_memsize_log2+1 downto 2));
-- nrx_mem_a <= unsigned(minic_rx_addr_new(g_memsize_log2+1 downto 2));
end
if
;
if
(
regs_out
.
rx_size_load_o
=
'1'
)
then
...
...
@@ -758,6 +756,15 @@ begin -- behavioral
-- State "Wait for start of frame". We wait until there's a start-of-frame condition
-- on the RX fabric and then we commence reception of the packet.
-------------------------------------------------------------------------------
--when RX_BUFFER_FULL =>
-- if(nrx_buf_full = '0') then
-- nrx_stall_mask <= '0';
-- nrx_state <= RX_WAIT_SOF;
-- else
-- nrx_stall_mask <= '1';
-- end if;
when
RX_WAIT_SOF
=>
-- TRIG0(2 downto 0) <= "000";
...
...
@@ -774,7 +781,7 @@ begin -- behavioral
regs_in
.
mcr_rx_full_i
<=
nrx_buf_full
;
snk_err_o
<=
nrx_buf_full
;
if
(
snk_cyc_i
=
'1'
and
snk_cyc_d0
=
'0'
and
nrx_buf_full
=
'0'
)
then
-- got start-of-frame?
if
(
snk_cyc_i
=
'1'
and
nrx_buf_full
=
'0'
)
then
-- got start-of-frame?
nrx_stall_mask
<=
'1'
;
nrx_state
<=
RX_ALLOCATE_DESCRIPTOR
;
else
...
...
@@ -1003,12 +1010,37 @@ begin -- behavioral
regs_in
.
mcr_rx_ready_i
<=
'1'
;
-- wait for another packet
nrx_state
<=
RX_WAIT_SOF
;
if
(
snk_cyc_i
=
'1'
)
then
nrx_state
<=
RX_IGNORE
;
elsif
(
nrx_buf_full
=
'1'
)
then
nrx_state
<=
RX_BUF_FULL
;
nrx_stall_mask
<=
'1'
;
else
nrx_state
<=
RX_WAIT_SOF
;
end
if
;
else
nrx_mem_wr
<=
'0'
;
end
if
;
when
others
=>
null
;
when
RX_IGNORE
=>
nrx_stall_mask
<=
'0'
;
if
(
snk_cyc_i
=
'0'
)
then
if
(
nrx_buf_full
=
'1'
)
then
nrx_stall_mask
<=
'1'
;
nrx_state
<=
RX_BUF_FULL
;
else
nrx_state
<=
RX_WAIT_SOF
;
end
if
;
end
if
;
when
RX_BUF_FULL
=>
if
(
nrx_buf_full
=
'0'
)
then
nrx_stall_mask
<=
'0'
;
nrx_state
<=
RX_WAIT_SOF
;
else
nrx_stall_mask
<=
'1'
;
end
if
;
end
case
;
end
if
;
end
if
;
...
...
@@ -1028,11 +1060,11 @@ begin -- behavioral
snk_stall_int
<=
'1'
;
elsif
(
regs_out
.
mcr_rx_en_o
=
'0'
or
nrx_state
=
RX_ALLOCATE_DESCRIPTOR
or
nrx_state
=
RX_UPDATE_DESC
or
nrx_state
=
RX_MEM_FLUSH
)
then
snk_stall_int
<=
'1'
;
-- the condition below forces the RX FSM to go into RX_MEM_RESYNC state. Don't
-- receive anything during this time
-- the condition below forces the RX FSM to go into RX_MEM_RESYNC state. Don't
-- receive anything during this time
elsif
(
nrx_toggle
=
'1'
and
mem_arb_rx
=
'1'
)
then
snk_stall_int
<=
'1'
;
elsif
(
nrx_stall_mask
=
'1'
or
(
snk_cyc_d0
=
'1'
and
snk_cyc_i
=
'0'
)
)
then
elsif
(
nrx_stall_mask
=
'1'
)
then
snk_stall_int
<=
'1'
;
else
snk_stall_int
<=
'0'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment