Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
c5fb84fc
Commit
c5fb84fc
authored
9 years ago
by
Daniel van der Schuur
Browse files
Options
Downloads
Patches
Plain Diff
-Copied dp_stream_player.vhd to RadioHDL.
parent
e55fd465
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/base/dp/hdllib.cfg
+1
-1
1 addition, 1 deletion
libraries/base/dp/hdllib.cfg
libraries/base/dp/tb/vhdl/dp_stream_player.vhd
+100
-0
100 additions, 0 deletions
libraries/base/dp/tb/vhdl/dp_stream_player.vhd
with
101 additions
and
1 deletion
libraries/base/dp/hdllib.cfg
+
1
−
1
View file @
c5fb84fc
...
@@ -115,7 +115,7 @@ synth_files =
...
@@ -115,7 +115,7 @@ synth_files =
$UNB/Firmware/modules/dp/src/vhdl/dp_shiftram.vhd
$UNB/Firmware/modules/dp/src/vhdl/dp_shiftram.vhd
$UNB/Firmware/modules/dp/src/vhdl/dp_src_out_timer.vhd
$UNB/Firmware/modules/dp/src/vhdl/dp_src_out_timer.vhd
src/vhdl/dp_sync_checker.vhd
src/vhdl/dp_sync_checker.vhd
$UNB/Firmware/modules/dp/
tb/vhdl/dp_stream_player.vhd
tb/vhdl/dp_stream_player.vhd
$UNB/Firmware/modules/dp/tb/vhdl/dp_stream_recorder.vhd
$UNB/Firmware/modules/dp/tb/vhdl/dp_stream_recorder.vhd
$UNB/Firmware/modules/dp/tb/vhdl/dp_stream_rec_play.vhd
$UNB/Firmware/modules/dp/tb/vhdl/dp_stream_rec_play.vhd
...
...
This diff is collapsed.
Click to expand it.
libraries/base/dp/tb/vhdl/dp_stream_player.vhd
0 → 100644
+
100
−
0
View file @
c5fb84fc
-------------------------------------------------------------------------------
--
-- Copyright (C) 2014
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-------------------------------------------------------------------------------
LIBRARY
IEEE
,
common_lib
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
common_lib
.
common_pkg
.
ALL
;
USE
common_lib
.
tb_common_pkg
.
ALL
;
USE
work
.
dp_stream_pkg
.
ALL
;
USE
std
.
textio
.
ALL
;
USE
IEEE
.
std_logic_textio
.
ALL
;
USE
common_lib
.
common_str_pkg
.
ALL
;
-- Purpose:
-- . Play back a stream recorded by dp_stream_recorder.
-- Description:
-- . Playback starts as soon as the connected sink indicates to be ready by
-- asserting both XON and READY.
-- . See dp_stream_recorder.vhd
ENTITY
dp_stream_player
IS
GENERIC
(
g_playback_file
:
STRING
:
=
"dp_stream_recorder.rec"
);
PORT
(
dp_clk
:
IN
STD_LOGIC
;
src_out
:
OUT
t_dp_sosi
;
src_in
:
IN
t_dp_siso
);
END
dp_stream_player
;
ARCHITECTURE
beh
OF
dp_stream_player
IS
CONSTANT
c_nof_chars_per_line
:
NATURAL
:
=
144
;
SIGNAL
playback_start
:
BOOLEAN
:
=
FALSE
;
FILE
playback_file
:
TEXT
;
BEGIN
p_playback_start
:
PROCESS
(
src_in
.
xon
)
VARIABLE
v_open_status
:
file_open_status
;
BEGIN
IF
src_in
.
xon
=
'1'
AND
playback_start
=
FALSE
THEN
-- Open the playback file
file_open
(
v_open_status
,
playback_file
,
g_playback_file
,
read_mode
);
-- Start playing
playback_start
<=
TRUE
;
END
IF
;
END
PROCESS
;
p_playback
:
PROCESS
(
dp_clk
,
src_in
)
VARIABLE
v_line
:
LINE
;
VARIABLE
v_line_str
:
STRING
(
1
TO
c_nof_chars_per_line
);
BEGIN
IF
playback_start
=
TRUE
THEN
IF
rising_edge
(
dp_clk
)
THEN
IF
src_in
.
ready
=
'1'
THEN
IF
NOT
endfile
(
playback_file
)
THEN
-- Read line from file
readline
(
playback_file
,
v_line
);
read
(
v_line
,
v_line_str
);
-- Assign record fields
src_out
.
sync
<=
hex_to_slv
(
v_line_str
(
1
TO
1
))(
0
);
src_out
.
bsn
<=
hex_to_slv
(
v_line_str
(
3
TO
18
));
src_out
.
data
(
255
DOWNTO
0
)
<=
hex_to_slv
(
v_line_str
(
20
TO
83
));
--FIXME Should support full width of 768 (new in RadioHDL)
src_out
.
re
<=
hex_to_slv
(
v_line_str
(
85
TO
100
));
src_out
.
im
<=
hex_to_slv
(
v_line_str
(
102
TO
117
));
src_out
.
valid
<=
hex_to_slv
(
v_line_str
(
119
TO
119
))(
0
);
src_out
.
sop
<=
hex_to_slv
(
v_line_str
(
121
TO
121
))(
0
);
src_out
.
eop
<=
hex_to_slv
(
v_line_str
(
123
TO
123
))(
0
);
src_out
.
empty
(
7
DOWNTO
0
)
<=
hex_to_slv
(
v_line_str
(
125
TO
126
));
-- FIXME Should support full width also.
src_out
.
channel
<=
hex_to_slv
(
v_line_str
(
128
TO
135
));
src_out
.
err
<=
hex_to_slv
(
v_line_str
(
137
TO
144
));
END
IF
;
END
IF
;
END
IF
;
END
IF
;
END
PROCESS
;
END
beh
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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