Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gennum GN4124 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
Gennum GN4124 core
Commits
300080f9
Commit
300080f9
authored
4 years ago
by
Tristan Gingold
Browse files
Options
Downloads
Patches
Plain Diff
p2l_dma_master: refactoring.
Remove unused signals, renaming.
parent
833551b7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hdl/rtl/p2l_dma_master.vhd
+19
-42
19 additions, 42 deletions
hdl/rtl/p2l_dma_master.vhd
with
19 additions
and
42 deletions
hdl/rtl/p2l_dma_master.vhd
+
19
−
42
View file @
300080f9
...
...
@@ -172,13 +172,8 @@ architecture arch of p2l_dma_master is
-- wishbone
signal
wb_ack_cnt
:
unsigned
(
15
downto
0
);
signal
p2l_dma_cyc_t
:
std_logic
;
signal
p2l_dma_stb_t
:
std_logic
;
signal
p2l_dma_tfr
:
boolean
;
signal
p2l_dma_stall_d
:
std_logic_vector
(
1
downto
0
)
:
=
(
others
=>
'0'
);
signal
p2l_dma_sel_t
:
std_logic_vector
(
3
downto
0
)
:
=
(
others
=>
'0'
);
signal
p2l_dma_adr_t
:
std_logic_vector
(
31
downto
0
)
:
=
(
others
=>
'0'
);
signal
p2l_dma_dat_t
:
std_logic_vector
(
31
downto
0
)
:
=
(
others
=>
'0'
);
signal
wb_dma_out_stb
:
std_logic
;
signal
wb_dma_tfr
:
boolean
;
-- P2L DMA read request FSM
type
p2l_dma_state_type
is
(
P2L_IDLE
,
P2L_HEADER
,
P2L_ADDR_H
,
P2L_ADDR_L
,
P2L_WAIT_READ_COMPLETION
);
...
...
@@ -197,8 +192,6 @@ architecture arch of p2l_dma_master is
signal
to_wb_fifo_full_next
:
std_logic
;
begin
-- Errors to DMA controller
dma_ctrl_error_o
<=
dma_busy_error
or
completion_error
;
...
...
@@ -400,16 +393,6 @@ begin
end
if
;
end
process
p_ctrl_pipe
;
-- NOTE: this pipeline was here before the reset and resync rehaul,
-- however it was clocked by the wrong clock (clk_i).
p_dma_stall_d2
:
process
(
wb_dma_clk_i
)
begin
if
rising_edge
(
wb_dma_clk_i
)
then
p2l_dma_stall_d
(
0
)
<=
wb_dma_i
.
stall
;
p2l_dma_stall_d
(
1
)
<=
p2l_dma_stall_d
(
0
);
end
if
;
end
process
p_dma_stall_d2
;
------------------------------------------------------------------------------
-- Received data counter
------------------------------------------------------------------------------
...
...
@@ -577,65 +560,59 @@ begin
-- write only
wb_dma_o
.
we
<=
'1'
;
p2l_dma_sel_t
<=
(
others
=>
'1'
);
wb_dma_o
.
sel
<=
(
others
=>
'1'
);
wb_dma_o
.
stb
<=
wb_dma_out_stb
;
-- Set when a wishbone transfer occurred.
p2l
_dma_tfr
<=
p2l
_dma_stb
_t
=
'1'
and
wb_dma_i
.
stall
=
'0'
;
wb
_dma_tfr
<=
wb
_dma_
out_
stb
=
'1'
and
wb_dma_i
.
stall
=
'0'
;
-- Read from fifo.
-- Only when the fifo is not empty
-- and either no previous data or previous data read.
--
p2l
_dma_stb
_t
= '1' when there are previous data.
to_wb_fifo_rd
<=
'1'
when
to_wb_fifo_empty
=
'0'
and
(
p2l
_dma_tfr
or
p2l
_dma_stb
_t
=
'0'
)
else
'0'
;
--
wb
_dma_
out_
stb = '1' when there are previous data.
to_wb_fifo_rd
<=
'1'
when
to_wb_fifo_empty
=
'0'
and
(
wb
_dma_tfr
or
wb
_dma_
out_
stb
=
'0'
)
else
'0'
;
-- Wishbone master process
p_wb_master
:
process
(
wb_dma_clk_i
)
begin
if
rising_edge
(
wb_dma_clk_i
)
then
if
wb_fifo_rst_n
=
'0'
then
p2l
_dma_cyc
_t
<=
'0'
;
p2l
_dma_stb
_t
<=
'0'
;
wb
_dma_
o
.
cyc
<=
'0'
;
wb
_dma_
out_
stb
<=
'0'
;
wb_ack_cnt
<=
(
others
=>
'0'
);
else
if
to_wb_fifo_rd
=
'1'
then
-- Data available, read them from the fifo.
p2l
_dma_adr
_t
(
31
downto
30
)
<=
"00"
;
p2l
_dma_adr
_t
(
29
downto
0
)
<=
to_wb_fifo_dout
(
61
downto
32
);
p2l
_dma_da
t_
t
<=
to_wb_fifo_dout
(
31
downto
0
);
wb
_dma_
o
.
adr
(
31
downto
30
)
<=
"00"
;
wb
_dma_
o
.
adr
(
29
downto
0
)
<=
to_wb_fifo_dout
(
61
downto
32
);
wb
_dma_
o
.
dat
<=
to_wb_fifo_dout
(
31
downto
0
);
-- Data/addresses are valid when fifo was just read.
p2l
_dma_stb
_t
<=
'1'
;
p2l
_dma_cyc
_t
<=
'1'
;
wb
_dma_
out_
stb
<=
'1'
;
wb
_dma_
o
.
cyc
<=
'1'
;
else
-- No read.
if
p2l
_dma_stb
_t
=
'1'
and
wb_dma_i
.
stall
=
'1'
then
if
wb
_dma_
out_
stb
=
'1'
and
wb_dma_i
.
stall
=
'1'
then
-- Data were not read, just wait.
null
;
elsif
to_wb_fifo_empty
=
'1'
then
-- No more data to produce.
p2l
_dma_stb
_t
<=
'0'
;
wb
_dma_
out_
stb
<=
'0'
;
if
wb_ack_cnt
=
0
then
-- End of the burst
p2l
_dma_cyc
_t
<=
'0'
;
wb
_dma_
o
.
cyc
<=
'0'
;
end
if
;
end
if
;
end
if
;
-- Track number of expected ack.
if
p2l
_dma_tfr
and
wb_dma_i
.
ack
=
'0'
then
if
wb
_dma_tfr
and
wb_dma_i
.
ack
=
'0'
then
wb_ack_cnt
<=
wb_ack_cnt
+
1
;
elsif
not
p2l
_dma_tfr
and
wb_dma_i
.
ack
=
'1'
then
elsif
not
wb
_dma_tfr
and
wb_dma_i
.
ack
=
'1'
then
wb_ack_cnt
<=
wb_ack_cnt
-
1
;
end
if
;
end
if
;
end
if
;
end
process
p_wb_master
;
-- for read back
wb_dma_o
.
cyc
<=
p2l_dma_cyc_t
;
wb_dma_o
.
stb
<=
p2l_dma_stb_t
;
wb_dma_o
.
sel
<=
p2l_dma_sel_t
;
wb_dma_o
.
adr
<=
p2l_dma_adr_t
;
wb_dma_o
.
dat
<=
p2l_dma_dat_t
;
end
architecture
arch
;
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