Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
Wishbone slave generator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
24
Issues
24
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Wishbone slave generator
Commits
cea56bbe
Commit
cea56bbe
authored
Dec 04, 2013
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed zero-alignment bug 1st field in the register
parent
4aea82ba
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
323 additions
and
307 deletions
+323
-307
wbgen2
wbgen2
+312
-306
wbgen_common.lua
wbgen_common.lua
+11
-1
No files found.
wbgen2
View file @
cea56bbe
This diff is collapsed.
Click to expand it.
wbgen_common.lua
View file @
cea56bbe
...
...
@@ -192,8 +192,17 @@ function align(field, offset)
-- no alignment defined? just assume it's 1
if
(
field
.
align
==
nil
)
then
a
=
1
;
else
a
=
field
.
align
;
end
local
newofs
;
if
(
offset
==
0
and
field
.
align
~=
nil
)
then
newofs
=
field
.
align
;
else
newofs
=
a
*
math.floor
((
offset
+
a
-
1
)
/
a
);
end
-- calculate the aligned offset
local
newofs
=
a
*
math.floor
((
offset
+
a
-
1
)
/
a
);
print
(
"Align "
,
field
.
name
,
field
.
align
,
offset
,
newofs
);
return
newofs
;
end
...
...
@@ -205,6 +214,7 @@ function calc_field_offset(field, reg)
-- align the field offset next to the current offset in the reg
local
ofs
=
reg
.
current_offset
;
-- FIFOs can span multiple I/O registers.
if
(
reg
.
__type
==
TYPE_FIFO
)
then
...
...
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