Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
30
Issues
30
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit core collection
Commits
aa1c2f68
Commit
aa1c2f68
authored
Oct 25, 2011
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simulation models: SimUtils: pack function added
parent
f85e5df6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
simdrv_defs.svh
sim/simdrv_defs.svh
+25
-2
No files found.
sim/simdrv_defs.svh
View file @
aa1c2f68
...
...
@@ -67,9 +67,32 @@ class CSimUtils;
tmp
[
i
]
=
d
;
end
return
tmp
;
endfunction
// pack
endfunction
// pack
static
function
automatic
byte_array_t
unpack
(
u64_array_t
x
,
int
entry_size
,
int
size
,
int
big_endian
=
1
)
;
byte_array_t
tmp
;
int
i
,
n
;
tmp
=
new
[
size
]
;
n
=
0
;
i
=
0
;
while
(
n
<
size
)
begin
tmp
[
n
]
=
x
[
i
]
>>
(
8
*
(
entry_size
-
1
-
(
n
%
entry_size
)))
;
n
++;
if
(
n
%
entry_size
==
0
)
i
++;
end
return
tmp
;
endfunction
// unpack
endclass
// CSimUtils
...
...
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