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
8fbd2914
Commit
8fbd2914
authored
Jul 04, 2013
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
texinfo doc generator: don't produce empty field-description tables if no descriptions are provided
parent
b4edc693
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
266 additions
and
235 deletions
+266
-235
cgen_doc_texinfo.lua
cgen_doc_texinfo.lua
+23
-6
wbgen2
wbgen2
+243
-229
No files found.
cgen_doc_texinfo.lua
View file @
8fbd2914
...
...
@@ -89,8 +89,8 @@ function cgen_texinfo_reg(reg)
-- emit("Address: @code{"..string.format("0x%x", reg.base * (DATA_BUS_WIDTH/8)).."}");
if
(
reg
.
description
~=
nil
)
then
emit
(
reg
.
description
);
end
emit
(
format_tex_string
(
reg
.
description
)
);
end
emit
(
"@multitable @columnfractions .10 .10 .15 .10 .55"
)
emit
(
"@headitem Bits @tab Access @tab Prefix @tab Default @tab Name"
)
...
...
@@ -110,7 +110,14 @@ function cgen_texinfo_reg(reg)
emit
(
"@code{"
..
string.upper
(
field
.
c_prefix
)
..
"}"
);
end
emit
(
"@tab @code{X} @tab "
);
val
=
'X'
;
if
(
field
.
reset_value
~=
nil
)
then
val
=
field
.
reset_value
;
elseif
((
field
.
access_bus
==
READ_WRITE
and
field
.
access_dev
==
READ_ONLY
)
or
field
.
type
==
MONOSTABLE
or
field
.
access_bus
==
WRITE_ONLY
)
then
val
=
'0'
end
emit
(
"@tab @code{"
..
val
..
"} @tab "
);
emit
(
field
.
name
);
-- emit("@columnfractions 1")
...
...
@@ -122,15 +129,25 @@ function cgen_texinfo_reg(reg)
end
);
emit
(
"@end multitable"
);
emit
(
"@multitable @columnfractions 0.15 0.85"
)
emit
(
"@headitem Field @tab Description"
)
local
got_any_descriptions
=
false
foreach_subfield
(
reg
,
function
(
field
)
if
(
field
.
description
~=
nil
)
then
got_any_descriptions
=
true
end
end
);
if
(
got_any_descriptions
)
then
emit
(
"@multitable @columnfractions 0.15 0.85"
)
emit
(
"@headitem Field @tab Description"
)
foreach_subfield
(
reg
,
function
(
field
)
if
(
field
.
description
~=
nil
)
then
pfx
=
csel
(
field
.
c_prefix
==
nil
,
reg
.
c_prefix
,
field
.
c_prefix
)
emit
(
"@item @code{"
..
pfx
..
"} @tab "
..
format_tex_string
(
field
.
description
));
end
end
);
emit
(
"@end multitable"
);
emit
(
"@end multitable"
);
end
end
...
...
wbgen2
View file @
8fbd2914
This diff is collapsed.
Click to expand it.
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