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
8c6a146b
Commit
8c6a146b
authored
Aug 01, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move some methods from ModulePool to Action
parent
fefa6e77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
34 deletions
+38
-34
action.py
hdlmake/action/action.py
+38
-0
module_pool.py
hdlmake/module_pool.py
+0
-34
No files found.
hdlmake/action/action.py
View file @
8c6a146b
...
...
@@ -24,6 +24,8 @@
import
sys
import
logging
from
hdlmake
import
new_dep_solver
as
dep_solver
class
Action
(
object
):
"""This is the base class providing the common Action methods"""
...
...
@@ -65,3 +67,39 @@ class Action(object):
"Variable
%
s must be set in the manifest and equal to '
%
s'."
,
name
,
value
)
sys
.
exit
(
"Exiting"
)
def
build_complete_file_set
(
self
):
"""Build file set with all the files listed in the complete pool"""
logging
.
debug
(
"Begin build complete file set"
)
from
hdlmake.srcfile
import
SourceFileSet
all_manifested_files
=
SourceFileSet
()
for
module
in
self
:
all_manifested_files
.
add
(
module
.
files
)
logging
.
debug
(
"End build complete file set"
)
return
all_manifested_files
def
build_file_set
(
self
,
top_entity
=
None
):
"""Build file set with only those files required by the top entity"""
logging
.
debug
(
"Begin build file set for
%
s"
,
top_entity
)
all_files
=
self
.
build_complete_file_set
()
if
not
self
.
_deps_solved
:
dep_solver
.
solve
(
all_files
)
self
.
_deps_solved
=
True
from
hdlmake.srcfile
import
SourceFileSet
source_files
=
SourceFileSet
()
source_files
.
add
(
dep_solver
.
make_dependency_set
(
all_files
,
top_entity
))
logging
.
debug
(
"End build file set"
)
return
source_files
def
get_top_module
(
self
):
"""Get the Top module from the pool"""
return
self
.
top_module
def
is_everything_fetched
(
self
):
"""Check if every module is already fetched"""
if
len
([
m
for
m
in
self
if
not
m
.
isfetched
])
==
0
:
return
True
else
:
return
False
hdlmake/module_pool.py
View file @
8c6a146b
...
...
@@ -30,7 +30,6 @@ import platform
from
subprocess
import
PIPE
,
Popen
import
sys
from
.
import
new_dep_solver
as
dep_solver
from
.util
import
path
as
path_mod
from
.
import
fetch
from
.env
import
Env
...
...
@@ -190,36 +189,3 @@ class ModulePool(list, ActionCheck, ActionCore,
logging
.
debug
(
"NOT appended to fetch queue: "
+
str
(
mod
.
url
))
def
build_complete_file_set
(
self
):
"""Build file set with all the files listed in the complete pool"""
logging
.
debug
(
"Begin build complete file set"
)
from
.srcfile
import
SourceFileSet
all_manifested_files
=
SourceFileSet
()
for
module
in
self
:
all_manifested_files
.
add
(
module
.
files
)
logging
.
debug
(
"End build complete file set"
)
return
all_manifested_files
def
build_file_set
(
self
,
top_entity
=
None
):
"""Build file set with only those files required by the top entity"""
logging
.
debug
(
"Begin build file set for
%
s"
,
top_entity
)
all_files
=
self
.
build_complete_file_set
()
if
not
self
.
_deps_solved
:
dep_solver
.
solve
(
all_files
)
self
.
_deps_solved
=
True
from
hdlmake.srcfile
import
SourceFileSet
source_files
=
SourceFileSet
()
source_files
.
add
(
dep_solver
.
make_dependency_set
(
all_files
,
top_entity
))
logging
.
debug
(
"End build file set"
)
return
source_files
def
get_top_module
(
self
):
"""Get the Top module from the pool"""
return
self
.
top_module
def
is_everything_fetched
(
self
):
"""Check if every module is already fetched"""
if
len
([
m
for
m
in
self
if
not
m
.
isfetched
])
==
0
:
return
True
else
:
return
False
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