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
634f0e99
Commit
634f0e99
authored
8 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added more checks in fft_r2_parameter_asserts().
parent
87708450
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/dsp/fft/src/vhdl/fft_pkg.vhd
+12
-2
12 additions, 2 deletions
libraries/dsp/fft/src/vhdl/fft_pkg.vhd
with
12 additions
and
2 deletions
libraries/dsp/fft/src/vhdl/fft_pkg.vhd
+
12
−
2
View file @
634f0e99
...
@@ -47,7 +47,7 @@ package fft_pkg is
...
@@ -47,7 +47,7 @@ package fft_pkg is
constant
c_fft
:
t_fft
:
=
(
true
,
false
,
true
,
0
,
4
,
0
,
1024
,
8
,
14
,
0
,
c_dsp_mult_w
,
2
,
true
,
56
,
2
);
constant
c_fft
:
t_fft
:
=
(
true
,
false
,
true
,
0
,
4
,
0
,
1024
,
8
,
14
,
0
,
c_dsp_mult_w
,
2
,
true
,
56
,
2
);
-- Check consistancy of the FFT parameters
-- Check consistancy of the FFT parameters
function
fft_r2_parameter_asserts
(
g_fft
:
t_fft
)
return
boolean
;
-- the return value is void
function
fft_r2_parameter_asserts
(
g_fft
:
t_fft
)
return
boolean
;
-- the return value is void
, because always true or abort due to failure
-- Definitions for fft slv array (an array can not have unconstraint elements, so choose sufficiently wide 32 bit slv elements)
-- Definitions for fft slv array (an array can not have unconstraint elements, so choose sufficiently wide 32 bit slv elements)
subtype
t_fft_slv_arr
is
t_slv_32_arr
;
-- use subtype to ease interfacing to existing types and to have central definition for rtwo components
subtype
t_fft_slv_arr
is
t_slv_32_arr
;
-- use subtype to ease interfacing to existing types and to have central definition for rtwo components
...
@@ -68,6 +68,16 @@ package body fft_pkg is
...
@@ -68,6 +68,16 @@ package body fft_pkg is
begin
begin
-- nof_points
-- nof_points
assert
g_fft
.
nof_points
=
2
**
ceil_log2
(
g_fft
.
nof_points
)
report
"fft_r2: nof_points must be a power of 2"
severity
failure
;
assert
g_fft
.
nof_points
=
2
**
ceil_log2
(
g_fft
.
nof_points
)
report
"fft_r2: nof_points must be a power of 2"
severity
failure
;
-- wb_factor
assert
g_fft
.
wb_factor
=
2
**
ceil_log2
(
g_fft
.
wb_factor
)
report
"fft_r2: wb_factor must be a power of 2"
severity
failure
;
-- nof_chan
if
g_fft
.
nof_chan
>
0
then
assert
g_fft
.
wb_factor
=
1
report
"fft_r2: nof_chan > 0 is only supported for wb_factor = 1"
severity
failure
;
end
if
;
-- use_fft_shift
if
g_fft
.
use_fft_shift
=
true
then
assert
g_fft
.
wb_factor
=
1
report
"fft_r2 : use_fft_shift for complex input is only supported for wb_factor=1"
severity
failure
;
end
if
;
-- use_reorder
-- use_reorder
if
g_fft
.
use_reorder
=
false
then
if
g_fft
.
use_reorder
=
false
then
assert
g_fft
.
use_separate
=
false
report
"fft_r2 : without use_reorder there cannot be use_separate for two real inputs"
severity
failure
;
assert
g_fft
.
use_separate
=
false
report
"fft_r2 : without use_reorder there cannot be use_separate for two real inputs"
severity
failure
;
...
@@ -75,7 +85,7 @@ package body fft_pkg is
...
@@ -75,7 +85,7 @@ package body fft_pkg is
end
if
;
end
if
;
-- use_separate
-- use_separate
if
g_fft
.
use_separate
=
true
then
if
g_fft
.
use_separate
=
true
then
assert
g_fft
.
use_fft_shift
=
false
report
"fft_r2 : with use_separate there cannot be use_fft_shift for real input"
severity
failure
;
assert
g_fft
.
use_fft_shift
=
false
report
"fft_r2 : with use_separate there cannot be use_fft_shift for
two
real input
s
"
severity
failure
;
end
if
;
end
if
;
return
true
;
return
true
;
end
;
end
;
...
...
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