Skip to content
GitLab
Explore
Sign in
Register
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
dc9ca678
Commit
dc9ca678
authored
Jul 17, 2024
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Add to_sl(), to_int(), c_tree_delay_len.
parent
bdcc3563
No related branches found
No related tags found
1 merge request
!415
Resolve L2SDP-1005
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/src/vhdl/common_pkg.vhd
+22
-1
22 additions, 1 deletion
libraries/base/common/src/vhdl/common_pkg.vhd
with
22 additions
and
1 deletion
libraries/base/common/src/vhdl/common_pkg.vhd
+
22
−
1
View file @
dc9ca678
...
@@ -86,6 +86,7 @@ package common_pkg is
...
@@ -86,6 +86,7 @@ package common_pkg is
constant
c_eps
:
real
:
=
1
.
0
e
-20
;
-- add small epsilon value to avoid 1/0 and log(0), 1e-20 < 1/2**64
constant
c_eps
:
real
:
=
1
.
0
e
-20
;
-- add small epsilon value to avoid 1/0 and log(0), 1e-20 < 1/2**64
-- FF, block RAM, FIFO
-- FF, block RAM, FIFO
constant
c_tree_delay_len
:
natural
:
=
10
;
-- reset clock tree pipelining to facilitate FF duplication by synthesis tool
constant
c_meta_delay_len
:
natural
:
=
3
;
-- default nof flipflops (FF) in meta stability recovery delay line (e.g. for clock domain crossing)
constant
c_meta_delay_len
:
natural
:
=
3
;
-- default nof flipflops (FF) in meta stability recovery delay line (e.g. for clock domain crossing)
constant
c_meta_fifo_depth
:
natural
:
=
16
;
-- default use 16 word deep FIFO to cross clock domain, typically > 2*c_meta_delay_len or >~ 8 is enough
constant
c_meta_fifo_depth
:
natural
:
=
16
;
-- default use 16 word deep FIFO to cross clock domain, typically > 2*c_meta_delay_len or >~ 8 is enough
...
@@ -215,6 +216,8 @@ package common_pkg is
...
@@ -215,6 +216,8 @@ package common_pkg is
function
sl
(
n
:
in
std_logic_vector
)
return
std_logic
;
-- 1 element standard logic vector to standard logic
function
sl
(
n
:
in
std_logic_vector
)
return
std_logic
;
-- 1 element standard logic vector to standard logic
function
to_sl
(
n
:
in
boolean
)
return
std_logic
;
-- if TRUE then return '1' else '0'
function
to_sl
(
n
:
in
boolean
)
return
std_logic
;
-- if TRUE then return '1' else '0'
function
to_sl
(
n
:
in
integer
)
return
std_logic
;
-- if 0 then return '0' else '1'
function
to_int
(
n
:
in
std_logic
)
return
integer
;
-- if '1' or 'H' then return '1' else '0'
function
to_bool
(
n
:
in
std_logic
)
return
boolean
;
-- if '1' or 'H' then return TRUE else FALSE
function
to_bool
(
n
:
in
std_logic
)
return
boolean
;
-- if '1' or 'H' then return TRUE else FALSE
function
to_bool
(
n
:
in
integer
)
return
boolean
;
-- if 0 then return FALSE else TRUE
function
to_bool
(
n
:
in
integer
)
return
boolean
;
-- if 0 then return FALSE else TRUE
...
@@ -777,6 +780,24 @@ package body common_pkg is
...
@@ -777,6 +780,24 @@ package body common_pkg is
end
if
;
end
if
;
end
;
end
;
function
to_sl
(
n
:
in
integer
)
return
std_logic
is
begin
if
n
=
0
then
return
'0'
;
else
return
'1'
;
end
if
;
end
;
function
to_int
(
n
:
in
std_logic
)
return
integer
is
begin
if
n
=
'1'
or
n
=
'H'
then
return
1
;
else
return
0
;
end
if
;
end
;
function
to_bool
(
n
:
in
std_logic
)
return
boolean
is
function
to_bool
(
n
:
in
std_logic
)
return
boolean
is
begin
begin
return
n
=
'1'
or
n
=
'H'
;
return
n
=
'1'
or
n
=
'H'
;
...
...
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