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
4f884cdc
Commit
4f884cdc
authored
Jun 15, 2017
by
Dimitris Lampridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sv: add constant definition for version in SV as well. Fix C header to use c_prefix
parent
1fb6c1d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
cgen_c_headers.lua
cgen_c_headers.lua
+1
-1
cgen_common.lua
cgen_common.lua
+4
-0
wbgen2
wbgen2
+4
-1
No files found.
cgen_c_headers.lua
View file @
4f884cdc
...
...
@@ -122,7 +122,7 @@ function cgen_c_fileheader()
emit
(
""
);
if
(
periph
.
version
~=
nil
)
then
emit
(
"/* version definition */"
);
emit
(
"#define WBGEN2_"
..
string.upper
(
periph
.
prefix
)
..
"_VERSION "
..
string.format
(
'0x%08X'
,
periph
.
version
));
emit
(
"#define WBGEN2_"
..
string.upper
(
periph
.
c_
prefix
)
..
"_VERSION "
..
string.format
(
'0x%08X'
,
periph
.
version
));
emit
(
""
);
end
end
...
...
cgen_common.lua
View file @
4f884cdc
...
...
@@ -403,6 +403,10 @@ function cgen_gen_vlog_constants(filename)
if
(
file
==
nil
)
then
die
(
"can't open "
..
filename
..
" for writing."
);
end
if
(
periph
.
version
~=
nil
)
then
file
.
write
(
file
,
string.format
(
"`define WBGEN2_%s_VERSION 32'h%08x\n"
,
string.upper
(
periph
.
c_prefix
),
periph
.
version
));
end
foreach_reg
({
TYPE_REG
},
function
(
reg
)
file
.
write
(
file
,
string.format
(
"`define %-30s %d'h%x\n"
,
"ADDR_"
..
string.upper
(
periph
.
c_prefix
..
"_"
..
reg
.
c_prefix
),
address_bus_width
+
2
,
(
DATA_BUS_WIDTH
/
8
)
*
reg
.
base
));
...
...
wbgen2
View file @
4f884cdc
...
...
@@ -804,6 +804,9 @@ local e=io.open(t,"w");
if
(
e
==
nil
)
then
die
(
"can't open "
..
t
..
" for writing."
);
end
if
(
periph
.
version
~=
nil
)
then
e
.
write
(
e
,
string.format
(
"`define WBGEN2_%s_VERSION 32'h%08x\n"
,
string.upper
(
periph
.
c_prefix
),
periph
.
version
));
end
foreach_reg
({
TYPE_REG
},
function
(
a
)
e
.
write
(
e
,
string.format
(
"`define %-30s %d'h%x\n"
,
"ADDR_"
..
string.upper
(
periph
.
c_prefix
..
"_"
..
a
.
c_prefix
),
address_bus_width
+
2
,(
DATA_BUS_WIDTH
/
8
)
*
a
.
base
));
foreach_subfield
(
a
,
function
(
t
)
...
...
@@ -1894,7 +1897,7 @@ emit("#endif");
emit
(
""
);
if
(
periph
.
version
~=
nil
)
then
emit
(
"/* version definition */"
);
emit
(
"#define WBGEN2_"
..
string.upper
(
periph
.
prefix
)
..
"_VERSION "
..
string.format
(
'0x%08X'
,
periph
.
version
));
emit
(
"#define WBGEN2_"
..
string.upper
(
periph
.
c_
prefix
)
..
"_VERSION "
..
string.format
(
'0x%08X'
,
periph
.
version
));
emit
(
""
);
end
end
...
...
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