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
6f8cfef7
Commit
6f8cfef7
authored
3 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added tb_common_log.vhd to print pow and log functions from common_pkg.vhd for range of values.
parent
026be57c
Branches
Branches containing commit
No related tags found
1 merge request
!254
Corrected c_block_size_w, by using +1 to ensure that g_block_size that is...
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/base/common/hdllib.cfg
+1
-0
1 addition, 0 deletions
libraries/base/common/hdllib.cfg
libraries/base/common/tb/vhdl/tb_common_log.vhd
+69
-0
69 additions, 0 deletions
libraries/base/common/tb/vhdl/tb_common_log.vhd
with
70 additions
and
0 deletions
libraries/base/common/hdllib.cfg
+
1
−
0
View file @
6f8cfef7
...
...
@@ -148,6 +148,7 @@ synth_files =
tb/vhdl/tb_common_mem_pkg.vhd
test_bench_files
=
tb/vhdl/tb_common_log.vhd
tb/vhdl/tb_common_acapture.vhd
tb/vhdl/tb_common_add_sub.vhd
tb/vhdl/tb_common_adder_tree.vhd
...
...
This diff is collapsed.
Click to expand it.
libraries/base/common/tb/vhdl/tb_common_log.vhd
0 → 100644
+
69
−
0
View file @
6f8cfef7
-- --------------------------------------------------------------------------
-- Copyright 2021
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- --------------------------------------------------------------------------
--
-- Author: E. Kooistra, 11 May 2022
-- Purpose: Show pow and log functions from common_pkg.vhd
-- Description:
-- Usage:
-- > run -all
LIBRARY
IEEE
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
work
.
common_pkg
.
ALL
;
USE
work
.
common_str_pkg
.
ALL
;
ENTITY
tb_common_log
IS
END
tb_common_log
;
ARCHITECTURE
tb
OF
tb_common_log
IS
BEGIN
p_log
:
PROCESS
CONSTANT
c_range
:
t_integer_arr
:
=
(
99
,
100
,
101
,
127
,
128
,
129
);
VARIABLE
vI
:
NATURAL
;
BEGIN
print_str
(
"I: pow2, ceil_pow2"
);
FOR
I
IN
1
TO
20
LOOP
print_str
(
int_to_str
(
I
)
&
": "
&
int_to_str
(
pow2
(
I
))
&
", "
&
int_to_str
(
ceil_pow2
(
I
)));
END
LOOP
;
print_str
(
""
);
print_str
(
"I: ceil_log2, true_log2, true_log_pow2, is_pow2, floor_log10"
);
FOR
I
IN
1
TO
20
LOOP
print_str
(
int_to_str
(
I
)
&
": "
&
int_to_str
(
ceil_log2
(
I
))
&
", "
&
int_to_str
(
true_log2
(
I
))
&
", "
&
int_to_str
(
true_log_pow2
(
I
))
&
", "
&
bool_to_str
(
is_pow2
(
I
))
&
", "
&
int_to_str
(
floor_log10
(
I
)));
END
LOOP
;
print_str
(
""
);
print_str
(
"I: ceil_log2, true_log2, true_log_pow2, is_pow2, floor_log10"
);
FOR
I
IN
c_range
'RANGE
LOOP
vI
:
=
c_range
(
I
);
print_str
(
int_to_str
(
vI
)
&
": "
&
int_to_str
(
ceil_log2
(
vI
))
&
", "
&
int_to_str
(
true_log2
(
vI
))
&
", "
&
int_to_str
(
true_log_pow2
(
vI
))
&
", "
&
bool_to_str
(
is_pow2
(
vI
))
&
", "
&
int_to_str
(
floor_log10
(
vI
)));
END
LOOP
;
WAIT
;
END
PROCESS
;
END
tb
;
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