Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit core collection
Manage
Activity
Members
Labels
Plan
Issues
33
Issue boards
Milestones
Wiki
Code
Merge requests
3
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
White Rabbit core collection
Commits
72796f34
Commit
72796f34
authored
1 year ago
by
Tristan Gingold
Browse files
Options
Downloads
Patches
Plain Diff
wrc_dac_dithering: avoid bias
parent
51bb4579
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
modules/wr_dacs/wrc_dac_dithering.vhd
+8
-11
8 additions, 11 deletions
modules/wr_dacs/wrc_dac_dithering.vhd
with
8 additions
and
11 deletions
modules/wr_dacs/wrc_dac_dithering.vhd
+
8
−
11
View file @
72796f34
...
...
@@ -84,13 +84,11 @@ architecture rtl of wrc_dac_dithering is
signal
sr_div_p
:
std_logic
;
signal
rnd_state
:
std_logic_vector
(
31
downto
0
);
signal
x_latched
:
signed
(
24
downto
0
);
signal
y_dithered
:
signed
(
24
downto
0
);
signal
dither
:
signed
(
g_dither_amplitude_log2
+
1
downto
0
);
signal
x_latched
:
signed
(
23
downto
0
);
signal
dither
:
signed
(
g_dither_amplitude_log2
-1
downto
0
);
begin
dither
<=
signed
(
"00"
&
rnd_state
(
g_dither_amplitude_log2
-1
downto
0
));
dither
<=
signed
(
rnd_state
(
g_dither_amplitude_log2
-1
downto
0
));
p_clock_div
:
process
(
clk_sys_i
)
begin
...
...
@@ -109,19 +107,22 @@ begin
end
process
;
p_dither
:
process
(
clk_sys_i
)
variable
y_dithered
:
signed
(
23
downto
0
);
begin
if
rising_edge
(
clk_sys_i
)
then
if
rst_sys_n_i
=
'0'
then
rnd_state
<=
g_dither_init_value
;
y_valid_o
<=
'0'
;
x_latched
<=
x"000100"
;
else
if
x_valid_i
=
'1'
then
x_latched
<=
signed
(
'0'
&
x_i
);
x_latched
<=
signed
(
x_i
);
end
if
;
if
sr_div_p
=
'1'
then
rnd_state
<=
f_xorshift32_next
(
rnd_state
);
y_dithered
<=
x_latched
+
dither
;
y_dithered
:
=
x_latched
+
dither
;
y_o
<=
std_logic_vector
(
y_dithered
(
23
downto
8
));
y_valid_o
<=
'1'
;
else
...
...
@@ -130,8 +131,4 @@ begin
end
if
;
end
if
;
end
process
;
end
rtl
;
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