Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EtherBone Core
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
EtherBone Core
Commits
20b77d9e
Commit
20b77d9e
authored
13 years ago
by
Mathias Kreider
Browse files
Options
Downloads
Patches
Plain Diff
and another one ... buffer overflow
parent
d5ac06dc
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hdl/EB_SPEC_Test/EB_2_wb_converter.vhd
+38
-13
38 additions, 13 deletions
hdl/EB_SPEC_Test/EB_2_wb_converter.vhd
with
38 additions
and
13 deletions
hdl/EB_SPEC_Test/EB_2_wb_converter.vhd
+
38
−
13
View file @
20b77d9e
...
...
@@ -200,19 +200,46 @@ begin
return
'0'
;
end
if
;
end
active_high
;
-------------------------------------------------------------------------------
impure
function
wb_stb_wr_mid_packet
return
std_logic
is
begin
return
((
not
s_fifo_rx_am_empty
and
active_high
(
s_EB_RX_CUR_CYCLE
.
WR_CNT
>
0
))
or
(
s_WB_STB
and
s_WB_master_i
.
STALL
));
end
wb_stb_wr_mid_packet
;
impure
function
wb_stb_
mi
d_packet
(
op_count
:
unsigned
)
impure
function
wb_stb_
wr_en
d_packet
return
std_logic
is
begin
return
(
(
not
s_fifo_rx_
am_
empty
and
active_high
(
op_count
>
0
))
or
(
s_
W
B_
STB
and
s_
W
B_
master_i
.
STALL
));
end
wb_stb_
mi
d_packet
;
return
(
not
s_fifo_rx_empty
and
active_high
(
s_EB_RX_byte_cnt
=
s_
E
B_
packet_length
)
and
active_high
(
s_
E
B_
RX_CUR_CYCLE
.
WR_CNT
>
0
));
end
wb_stb_
wr_en
d_packet
;
impure
function
wb_stb_end_packet
(
op_count
:
unsigned
)
impure
function
wb_stb_wr
return
std_logic
is
begin
return
(
not
s_fifo_rx_empty
and
active_high
(
s_EB_RX_byte_cnt
=
s_EB_packet_length
)
and
active_high
(
op_count
>
0
));
end
wb_stb_end_packet
;
return
wb_stb_wr_mid_packet
or
wb_stb_wr_end_packet
;
end
wb_stb_wr
;
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
impure
function
wb_stb_rd_mid_packet
return
std_logic
is
begin
return
((
(
not
s_fifo_rx_am_empty
and
not
s_fifo_tx_am_full
)
and
active_high
(
s_EB_RX_CUR_CYCLE
.
RD_CNT
>
0
))
or
(
s_WB_STB
and
s_WB_master_i
.
STALL
));
end
wb_stb_rd_mid_packet
;
impure
function
wb_stb_rd_end_packet
return
std_logic
is
begin
return
(
(
not
s_fifo_rx_empty
and
not
s_fifo_tx_am_full
)
and
active_high
(
s_EB_RX_byte_cnt
=
s_EB_packet_length
)
and
active_high
(
s_EB_RX_CUR_CYCLE
.
RD_CNT
>
0
));
end
wb_stb_rd_end_packet
;
impure
function
wb_stb_rd
return
std_logic
is
begin
return
wb_stb_rd_mid_packet
or
wb_stb_rd_end_packet
;
end
wb_stb_rd
;
-------------------------------------------------------------------------------
component
alt_FIFO_am_full_flag
IS
PORT
...
...
@@ -741,10 +768,9 @@ begin
when
WB_WRITE
=>
s_WB_ADR
<=
std_logic_vector
(
s_WB_addr_cnt
);
s_WB_WE
<=
'1'
;
s_fifo_rx_pop
<=
'0'
;
s_WB_STB
<=
wb_stb_
mid_packet
(
s_EB_RX_CUR_CYCLE
.
WR_CNT
)
or
wb_stb_end_packet
(
s_EB_RX_CUR_CYCLE
.
WR_CNT
)
;
s_WB_STB
<=
wb_stb_
wr
;
if
((
wb_stb_mid_packet
(
s_EB_RX_CUR_CYCLE
.
WR_CNT
)
or
wb_stb_end_packet
(
s_EB_RX_CUR_CYCLE
.
WR_CNT
))
=
'1'
and
not
(
s_WB_STB
=
'1'
and
s_WB_master_i
.
STALL
=
'1'
))
then
if
(
wb_stb_wr
=
'1'
and
not
(
s_WB_STB
=
'1'
and
s_WB_master_i
.
STALL
=
'1'
))
then
s_EB_RX_CUR_CYCLE
.
WR_CNT
<=
s_EB_RX_CUR_CYCLE
.
WR_CNT
-1
;
if
(
s_EB_RX_CUR_CYCLE
.
WR_FIFO
=
'0'
)
then
...
...
@@ -782,10 +808,9 @@ begin
s_WB_ADR
<=
s_fifo_rx_q
;
s_fifo_rx_pop
<=
'0'
;
s_WB_STB
<=
wb_stb_
mid_packet
(
s_EB_RX_CUR_CYCLE
.
RD_CNT
)
or
wb_stb_end_packet
(
s_EB_RX_CUR_CYCLE
.
RD_CNT
)
;
s_WB_STB
<=
wb_stb_
rd
;
if
((
wb_stb_mid_packet
(
s_EB_RX_CUR_CYCLE
.
RD_CNT
)
or
wb_stb_end_packet
(
s_EB_RX_CUR_CYCLE
.
RD_CNT
))
=
'1'
and
not
(
s_WB_STB
=
'1'
and
s_WB_master_i
.
STALL
=
'1'
))
then
if
(
wb_stb_rd
=
'1'
and
not
(
s_WB_STB
=
'1'
and
s_WB_master_i
.
STALL
=
'1'
))
then
s_EB_RX_CUR_CYCLE
.
RD_CNT
<=
s_EB_RX_CUR_CYCLE
.
RD_CNT
-1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment