Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
Hdlmake
Commits
22856d26
Commit
22856d26
authored
Jul 31, 2013
by
Pawel Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manifest: add top manifest variables to all descendants
parent
e425bcc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
module.py
src/module.py
+0
-7
configparser.py
src/util/configparser.py
+7
-4
No files found.
src/module.py
View file @
22856d26
...
...
@@ -175,13 +175,6 @@ class Module(object):
manifest_parser
=
ManifestParser
()
# For non-top modules
if
self
.
parent
is
not
None
:
manifest_parser
.
add_arbitrary_code
(
"target=
\"
"
+
str
(
global_mod
.
top_module
.
target
)
+
"
\"
"
)
manifest_parser
.
add_arbitrary_code
(
"action=
\"
"
+
str
(
global_mod
.
top_module
.
action
)
+
"
\"
"
)
manifest_parser
.
add_arbitrary_code
(
"syn_device=
\"
"
+
str
(
global_mod
.
top_module
.
syn_device
)
+
"
\"
"
)
manifest_parser
.
add_arbitrary_code
(
"sim_tool=
\"
"
+
str
(
global_mod
.
top_module
.
sim_tool
)
+
"
\"
"
)
manifest_parser
.
add_arbitrary_code
(
"__manifest=
\"
"
+
self
.
path
+
"
\"
"
)
manifest_parser
.
add_arbitrary_code
(
global_mod
.
options
.
arbitrary_code
)
...
...
src/util/configparser.py
View file @
22856d26
...
...
@@ -233,7 +233,8 @@ class ConfigParser(object):
def
__names
(
self
):
return
[
o
.
name
for
o
in
self
.
options
if
o
is
not
None
]
def
parse
(
self
):
def
parse
(
self
,
allow_unknown
=
False
,
verbose
=
False
,
extra_context
=
None
):
assert
isinstance
(
extra_context
,
dict
)
or
extra_context
is
None
options
=
{}
ret
=
{}
...
...
@@ -255,7 +256,7 @@ class ConfigParser(object):
import
sys
try
:
with
stdoutIO
()
as
s
:
exec
(
self
.
arbitrary_code
,
arbitrary_options
)
exec
(
self
.
arbitrary_code
,
extra_context
,
arbitrary_options
)
printed
=
s
.
getvalue
()
if
printed
:
print
(
printed
)
...
...
@@ -269,7 +270,7 @@ class ConfigParser(object):
try
:
with
stdoutIO
()
as
s
:
exec
(
content
,
options
)
exec
(
content
,
extra_context
,
options
)
printed
=
s
.
getvalue
()
if
len
(
printed
)
>
0
:
logging
.
info
(
"The manifest inside "
+
self
.
config_file
+
" tried to print something:"
)
...
...
@@ -290,7 +291,9 @@ class ConfigParser(object):
continue
if
opt_name
not
in
self
.
__names
():
if
opt_name
in
arbitrary_options
:
continue
continue
# finish processing of this variable here
elif
allow_unknown
is
True
:
ret
[
opt_name
]
=
val
else
:
#if opt_name.startswith("global_"):
# continue
...
...
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