Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Simple VME FMC Carrier SVEC
Commits
5128aee2
Commit
5128aee2
authored
Apr 09, 2020
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svec golden: add code to test DMA.
parent
f2f9dc31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
1 deletion
+60
-1
svec_golden.vhd
hdl/top/golden/svec_golden.vhd
+60
-1
No files found.
hdl/top/golden/svec_golden.vhd
View file @
5128aee2
...
...
@@ -296,5 +296,64 @@ begin
app_wb_o
=>
app_wb_out
,
app_wb_i
=>
app_wb_in
);
app_wb_in
<=
(
ack
=>
'1'
,
err
|
rty
|
stall
=>
'0'
,
dat
=>
(
others
=>
'0'
));
app_wb_in
.
err
<=
'0'
;
app_wb_in
.
rty
<=
'0'
;
app_wb_in
.
stall
<=
'0'
;
-- Add a small RAM
-- Memory map:
-- 0x0000 .. : base
-- 0x2000 : indirect address
-- 0x2004 : indirect data
-- 0x4000 .. : RAM (8KB)
process
(
clk_sys_62m5
)
is
type
t_mem32
is
array
(
natural
range
<>
)
of
std_logic_vector
(
31
downto
0
);
constant
c_memsz
:
natural
:
=
13
;
variable
mem
:
t_mem32
(
2
**
(
c_memsz
-2
)
-
1
downto
0
);
subtype
t_mem_rng
is
natural
range
c_memsz
-
1
downto
2
;
variable
addr
:
natural
;
variable
fifo_idx
:
std_logic_vector
(
t_mem_rng
);
variable
mem_acc
:
boolean
;
begin
if
rising_edge
(
clk_sys_62m5
)
then
if
rst_n_i
=
'0'
then
fifo_idx
:
=
(
others
=>
'0'
);
elsif
app_wb_out
.
cyc
=
'1'
and
app_wb_out
.
stb
=
'1'
then
-- Note: address is passed unmodified, but cyc/stb is never present
-- between 0x0000-0x1fff.
mem_acc
:
=
True
;
if
app_wb_out
.
adr
(
c_memsz
)
=
'0'
then
-- Direct RAM area
addr
:
=
to_integer
(
unsigned
(
app_wb_out
.
adr
(
t_mem_rng
)));
elsif
app_wb_out
.
adr
(
t_mem_rng
)
=
(
t_mem_rng
=>
'0'
)
then
-- FIFO addr register
mem_acc
:
=
False
;
if
app_wb_out
.
we
=
'1'
then
fifo_idx
:
=
app_wb_out
.
dat
(
t_mem_rng
);
else
app_wb_in
.
dat
<=
(
others
=>
'0'
);
app_wb_in
.
dat
(
t_mem_rng
)
<=
fifo_idx
;
end
if
;
else
-- FIFO data register
addr
:
=
to_integer
(
unsigned
(
fifo_idx
));
fifo_idx
:
=
std_logic_vector
(
unsigned
(
fifo_idx
)
+
1
);
end
if
;
if
mem_acc
then
if
app_wb_out
.
we
=
'1'
then
for
i
in
3
downto
0
loop
if
app_wb_out
.
sel
(
i
)
=
'1'
then
mem
(
addr
)(
8
*
i
+
7
downto
8
*
i
)
:
=
app_wb_out
.
dat
(
8
*
i
+
7
downto
8
*
i
);
end
if
;
end
loop
;
else
app_wb_in
.
dat
<=
mem
(
addr
);
end
if
;
end
if
;
app_wb_in
.
ack
<=
'1'
;
else
app_wb_in
.
ack
<=
'0'
;
end
if
;
end
if
;
end
process
;
end
architecture
top
;
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