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
35be740e
Commit
35be740e
authored
Jun 7, 2018
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added real_to_str().
parent
023789e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/src/vhdl/common_str_pkg.vhd
+11
-0
11 additions, 0 deletions
libraries/base/common/src/vhdl/common_str_pkg.vhd
with
11 additions
and
0 deletions
libraries/base/common/src/vhdl/common_str_pkg.vhd
+
11
−
0
View file @
35be740e
...
@@ -43,6 +43,7 @@ PACKAGE common_str_pkg IS
...
@@ -43,6 +43,7 @@ PACKAGE common_str_pkg IS
Function
hex_nibble_to_slv
(
c
:
character
)
return
std_logic_vector
;
Function
hex_nibble_to_slv
(
c
:
character
)
return
std_logic_vector
;
FUNCTION
int_to_str
(
int
:
INTEGER
)
RETURN
STRING
;
FUNCTION
int_to_str
(
int
:
INTEGER
)
RETURN
STRING
;
FUNCTION
real_to_str
(
re
:
REAL
;
width
:
INTEGER
;
digits
:
INTEGER
)
RETURN
STRING
;
PROCEDURE
print_str
(
str
:
STRING
);
PROCEDURE
print_str
(
str
:
STRING
);
...
@@ -212,6 +213,16 @@ PACKAGE BODY common_str_pkg IS
...
@@ -212,6 +213,16 @@ PACKAGE BODY common_str_pkg IS
RETURN
v_str
;
RETURN
v_str
;
END
;
END
;
FUNCTION
real_to_str
(
re
:
REAL
;
width
:
INTEGER
;
digits
:
INTEGER
)
RETURN
STRING
IS
VARIABLE
v_line
:
LINE
;
VARIABLE
v_str
:
STRING
(
1
TO
width
):
=
(
OTHERS
=>
' '
);
BEGIN
STD
.
TEXTIO
.
WRITE
(
v_line
,
re
,
right
,
width
,
digits
);
v_str
(
v_line
.
ALL
'RANGE
)
:
=
v_line
.
ALL
;
deallocate
(
v_line
);
RETURN
v_str
;
END
;
PROCEDURE
print_str
(
str
:
STRING
)
IS
PROCEDURE
print_str
(
str
:
STRING
)
IS
VARIABLE
v_line
:
LINE
;
VARIABLE
v_line
:
LINE
;
BEGIN
BEGIN
...
...
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