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
6bc78ff2
Commit
6bc78ff2
authored
5 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added array_init() for boolean array.
parent
bba69ae6
Branches
Branches containing commit
No related tags found
2 merge requests
!28
Master
,
!15
Resolve L2SDP-27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/src/vhdl/common_pkg.vhd
+10
-0
10 additions, 0 deletions
libraries/base/common/src/vhdl/common_pkg.vhd
with
10 additions
and
0 deletions
libraries/base/common/src/vhdl/common_pkg.vhd
+
10
−
0
View file @
6bc78ff2
...
@@ -299,6 +299,7 @@ PACKAGE common_pkg IS
...
@@ -299,6 +299,7 @@ PACKAGE common_pkg IS
FUNCTION
sel_n
(
sel
:
NATURAL
;
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
:
STRING
)
RETURN
STRING
;
-- 10
FUNCTION
sel_n
(
sel
:
NATURAL
;
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
:
STRING
)
RETURN
STRING
;
-- 10
FUNCTION
array_init
(
init
:
STD_LOGIC
;
nof
:
NATURAL
)
RETURN
STD_LOGIC_VECTOR
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
:
STD_LOGIC
;
nof
:
NATURAL
)
RETURN
STD_LOGIC_VECTOR
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
:
BOOLEAN
;
nof
:
NATURAL
)
RETURN
t_nat_boolean_arr
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
,
nof
:
NATURAL
)
RETURN
t_natural_arr
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
,
nof
:
NATURAL
)
RETURN
t_natural_arr
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
,
nof
:
NATURAL
)
RETURN
t_nat_natural_arr
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
,
nof
:
NATURAL
)
RETURN
t_nat_natural_arr
;
-- useful to init a unconstrained array of size 1
FUNCTION
array_init
(
init
,
nof
,
incr
:
NATURAL
)
RETURN
t_natural_arr
;
-- useful to init an array with incrementing numbers
FUNCTION
array_init
(
init
,
nof
,
incr
:
NATURAL
)
RETURN
t_natural_arr
;
-- useful to init an array with incrementing numbers
...
@@ -1342,6 +1343,15 @@ PACKAGE BODY common_pkg IS
...
@@ -1342,6 +1343,15 @@ PACKAGE BODY common_pkg IS
RETURN
v_arr
;
RETURN
v_arr
;
END
;
END
;
FUNCTION
array_init
(
init
:
BOOLEAN
;
nof
:
NATURAL
)
RETURN
t_nat_boolean_arr
IS
VARIABLE
v_arr
:
t_nat_boolean_arr
(
0
TO
nof
-1
);
BEGIN
FOR
I
IN
v_arr
'RANGE
LOOP
v_arr
(
I
)
:
=
init
;
END
LOOP
;
RETURN
v_arr
;
END
;
FUNCTION
array_init
(
init
,
nof
:
NATURAL
)
RETURN
t_natural_arr
IS
FUNCTION
array_init
(
init
,
nof
:
NATURAL
)
RETURN
t_natural_arr
IS
VARIABLE
v_arr
:
t_natural_arr
(
0
TO
nof
-1
);
VARIABLE
v_arr
:
t_natural_arr
(
0
TO
nof
-1
);
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