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
24b0d92c
Commit
24b0d92c
authored
Jun 11, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify top_module (could be top_entity or top_manifest).
parent
afc58c0b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
17 deletions
+16
-17
__main__.py
hdlmake/__main__.py
+1
-1
action.py
hdlmake/action/action.py
+10
-12
content.py
hdlmake/module/content.py
+2
-1
core.py
hdlmake/module/core.py
+2
-2
module.py
hdlmake/module/module.py
+1
-1
No files found.
hdlmake/__main__.py
View file @
24b0d92c
...
@@ -52,7 +52,7 @@ def hdlmake(args):
...
@@ -52,7 +52,7 @@ def hdlmake(args):
# Create a ModulePool object, this will become our workspace
# Create a ModulePool object, this will become our workspace
action
=
ActionCore
(
options
)
action
=
ActionCore
(
options
)
action
.
load_top_m
odule
()
action
.
load_top_m
anifest
()
action
.
run
()
action
.
run
()
# Execute the appropriated action for the freshly created modules pool
# Execute the appropriated action for the freshly created modules pool
...
...
hdlmake/action/action.py
View file @
24b0d92c
...
@@ -40,20 +40,20 @@ class Action(list):
...
@@ -40,20 +40,20 @@ class Action(list):
def
__init__
(
self
,
options
):
def
__init__
(
self
,
options
):
super
(
Action
,
self
)
.
__init__
()
super
(
Action
,
self
)
.
__init__
()
self
.
top_m
odule
=
None
self
.
top_m
anifest
=
None
self
.
parseable_fileset
=
SourceFileSet
()
self
.
parseable_fileset
=
SourceFileSet
()
self
.
privative_fileset
=
SourceFileSet
()
self
.
privative_fileset
=
SourceFileSet
()
self
.
_deps_solved
=
False
self
.
_deps_solved
=
False
self
.
options
=
options
self
.
options
=
options
def
load_top_m
odule
(
self
):
def
load_top_m
anifest
(
self
):
# Top level module.
# Top level module.
assert
self
.
top_m
odule
is
None
assert
self
.
top_m
anifest
is
None
self
.
top_m
odule
=
self
.
new_module
(
parent
=
None
,
self
.
top_m
anifest
=
self
.
new_module
(
parent
=
None
,
url
=
os
.
getcwd
(),
url
=
os
.
getcwd
(),
source
=
None
,
source
=
None
,
fetchto
=
"."
)
fetchto
=
"."
)
self
.
top_m
odule
.
parse_manifest
()
self
.
top_m
anifest
.
parse_manifest
()
self
.
config
=
self
.
_get_config_dict
()
self
.
config
=
self
.
_get_config_dict
()
def
run
(
self
):
def
run
(
self
):
...
@@ -85,8 +85,6 @@ class Action(list):
...
@@ -85,8 +85,6 @@ class Action(list):
This is the only way to add new modules to the pool
This is the only way to add new modules to the pool
Thanks to it the pool can easily control its content
Thanks to it the pool can easily control its content
NOTE: the first module added to the pool will become the top_module!.
"""
"""
self
.
_deps_solved
=
False
self
.
_deps_solved
=
False
new_module_args
=
ModuleArgs
()
new_module_args
=
ModuleArgs
()
...
@@ -149,9 +147,9 @@ class Action(list):
...
@@ -149,9 +147,9 @@ class Action(list):
logging
.
info
(
"Detected
%
d supported files that can be parsed"
,
logging
.
info
(
"Detected
%
d supported files that can be parsed"
,
len
(
self
.
parseable_fileset
))
len
(
self
.
parseable_fileset
))
def
get_top_m
odule
(
self
):
def
get_top_m
anifest
(
self
):
"""Get the Top module from the pool"""
"""Get the Top module from the pool"""
return
self
.
top_m
odule
return
self
.
top_m
anifest
def
_get_config_dict
(
self
):
def
_get_config_dict
(
self
):
"""Get the combined hierarchical Manifest dictionary from the pool"""
"""Get the combined hierarchical Manifest dictionary from the pool"""
...
...
hdlmake/module/content.py
View file @
24b0d92c
...
@@ -137,7 +137,8 @@ class ModuleContent(ModuleCore):
...
@@ -137,7 +137,8 @@ class ModuleContent(ModuleCore):
if
self
.
parent
is
None
:
if
self
.
parent
is
None
:
include_dirs
=
self
.
manifest_dict
.
get
(
'include_dirs'
,
[])
include_dirs
=
self
.
manifest_dict
.
get
(
'include_dirs'
,
[])
else
:
else
:
include_dirs
=
self
.
top_module
.
manifest_dict
.
get
(
'include_dirs'
,
[])
include_dirs
=
self
.
top_manifest
.
manifest_dict
.
get
(
'include_dirs'
,
[])
for
path_aux
in
paths
:
for
path_aux
in
paths
:
if
os
.
path
.
isdir
(
path_aux
):
if
os
.
path
.
isdir
(
path_aux
):
dir_
=
os
.
listdir
(
path_aux
)
dir_
=
os
.
listdir
(
path_aux
)
...
...
hdlmake/module/core.py
View file @
24b0d92c
...
@@ -118,14 +118,14 @@ class ModuleCore(ModuleConfig):
...
@@ -118,14 +118,14 @@ class ModuleCore(ModuleConfig):
self
.
library
=
"work"
self
.
library
=
"work"
self
.
action
=
None
self
.
action
=
None
self
.
pool
=
None
self
.
pool
=
None
self
.
top_m
odule
=
None
self
.
top_m
anifest
=
None
self
.
manifest_dict
=
None
self
.
manifest_dict
=
None
super
(
ModuleCore
,
self
)
.
__init__
()
super
(
ModuleCore
,
self
)
.
__init__
()
def
set_pool
(
self
,
pool
):
def
set_pool
(
self
,
pool
):
"""Set the associated pool for the module instance"""
"""Set the associated pool for the module instance"""
self
.
pool
=
pool
self
.
pool
=
pool
self
.
top_m
odule
=
pool
.
get_top_module
()
self
.
top_m
anifest
=
pool
.
get_top_manifest
()
def
process_manifest
(
self
):
def
process_manifest
(
self
):
"""Method that process the core manifest section"""
"""Method that process the core manifest section"""
...
...
hdlmake/module/module.py
View file @
24b0d92c
...
@@ -118,7 +118,7 @@ PARSE START: %s
...
@@ -118,7 +118,7 @@ PARSE START: %s
if
self
.
parent
is
None
:
if
self
.
parent
is
None
:
extra_context
=
{}
extra_context
=
{}
else
:
else
:
extra_context
=
dict
(
self
.
top_m
odule
.
manifest_dict
)
extra_context
=
dict
(
self
.
top_m
anifest
.
manifest_dict
)
extra_context
[
"__manifest"
]
=
self
.
path
extra_context
[
"__manifest"
]
=
self
.
path
# The parse method is where most of the parser action takes place!
# The parse method is where most of the parser action takes place!
...
...
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