Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
cd3445d2
Commit
cd3445d2
authored
Jul 15, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f_string2svl: accept any bound for string parameter.
parent
a0a709f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
wishbone_pkg.vhd
modules/wishbone/wishbone_pkg.vhd
+3
-2
No files found.
modules/wishbone/wishbone_pkg.vhd
View file @
cd3445d2
...
...
@@ -2148,11 +2148,12 @@ package body wishbone_pkg is
-- Converts string to ascii (std_logic_vector)
function
f_string2svl
(
s
:
string
)
return
std_logic_vector
is
constant
len
:
natural
:
=
s
'length
;
variable
slv
:
std_logic_vector
((
s
'length
*
8
)
-
1
downto
0
);
alias
as
:
string
(
1
to
len
)
is
s
;
variable
slv
:
std_logic_vector
((
len
*
8
)
-
1
downto
0
);
begin
for
i
in
0
to
len
-1
loop
slv
(
slv
'high
-
i
*
8
downto
(
slv
'high
-7
)
-
i
*
8
)
:
=
std_logic_vector
(
to_unsigned
(
character
'pos
(
s
(
i
+
1
)),
8
));
std_logic_vector
(
to_unsigned
(
character
'pos
(
a
s
(
i
+
1
)),
8
));
end
loop
;
return
slv
;
end
f_string2svl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment