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
2476a8d6
Commit
2476a8d6
authored
Jun 26, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbgen_common.lua: more checks
parent
369a3a29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
wbgen_common.lua
wbgen_common.lua
+14
-2
No files found.
wbgen_common.lua
View file @
2476a8d6
...
...
@@ -116,9 +116,10 @@ end
-- function checks and calculates size of field "field" in register "reg"
function
calc_size
(
field
,
reg
)
-- monostable or bit-field? default size to 1 if not specified
if
(
field
.
type
==
MONOSTABLE
or
field
.
type
==
BIT
)
then
field
.
size
=
1
;
elseif
(
field
.
type
==
SLV
)
then
elseif
(
field
.
type
==
SLV
or
field
.
type
==
PASS_THROUGH
)
then
-- SLV fields must have defined size
if
(
field
.
size
==
nil
)
then
die
(
"no size declared for SLV-type field '"
..
field
.
name
..
"'"
);
...
...
@@ -277,6 +278,17 @@ function csel(cond, tr, fl)
end
end
function
check_field_types
(
field
)
if
(
field
.
type
==
nil
)
then
die
(
"no type declared for field: "
..
field
.
name
);
end
end
function
check_obj_names_prefixes
(
obj
)
if
(
obj
.
name
==
nil
)
then
die
(
"no name declared for object: "
..
obj
.
size
);
end
end
function
fix_prefix
(
obj
)
if
(
obj
.
c_prefix
==
nil
or
obj
.
hdl_prefix
==
nil
)
then
...
...
@@ -336,7 +348,7 @@ end
function
check_max_size
(
reg
)
if
(
reg
.
total_size
>
DATA_BUS_WIDTH
and
reg
.
__type
==
TYPE_REG
)
then
die
(
"register "
,
reg
.
name
,
" size exceeds data bus witdh ("
,
DATA_BUS_WIDTH
,
" bits)"
);
die
(
"register "
..
reg
.
name
..
" size exceeds data bus witdh ("
..
DATA_BUS_WIDTH
..
" bits)"
);
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