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
eeaca46d
Commit
eeaca46d
authored
May 24, 2017
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor the checking for remote modules fetch status
parent
125dbf7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
24 deletions
+19
-24
action.py
hdlmake/action/action.py
+7
-21
core.py
hdlmake/action/core.py
+12
-1
make_sim.py
hdlmake/tools/make_sim.py
+0
-1
make_syn.py
hdlmake/tools/make_syn.py
+0
-1
No files found.
hdlmake/action/action.py
View file @
eeaca46d
...
...
@@ -83,11 +83,9 @@ class Action(list):
"""
from
hdlmake.module
import
Module
,
ModuleArgs
self
.
_deps_solved
=
False
new_module_args
=
ModuleArgs
()
new_module_args
.
set_args
(
parent
,
url
,
source
,
fetchto
)
new_module
=
Module
(
new_module_args
,
self
)
if
not
self
.
__contains
(
new_module
):
self
.
_add
(
new_module
)
if
not
self
.
top_module
:
...
...
@@ -96,21 +94,8 @@ class Action(list):
url
=
self
.
_guess_origin
(
self
.
top_module
.
path
)
if
url
:
self
.
top_module
.
url
=
url
return
new_module
def
check_all_fetched_or_quit
(
self
):
"""Check if every module in the pool is fetched"""
if
not
len
([
m
for
m
in
self
if
not
m
.
isfetched
])
==
0
:
logging
.
error
(
"Fetching must be done before continuing.
\n
"
"The following modules remains unfetched:
\n
"
"
%
s"
,
"
\n
"
.
join
([
str
(
m
)
for
m
in
self
if
not
m
.
isfetched
])
)
quit
()
def
_check_manifest_variable_is_set
(
self
,
name
):
"""Method to check if a specific manifest variable is set"""
if
getattr
(
self
.
top_module
,
name
)
is
None
:
...
...
@@ -165,12 +150,13 @@ class Action(list):
config_dict
=
{}
for
mod
in
self
:
manifest_dict_tmp
=
mod
.
manifest_dict
if
'fetchto'
in
manifest_dict_tmp
:
manifest_dict_tmp
[
'fetchto'
]
=
os
.
path
.
relpath
(
os
.
path
.
join
(
mod
.
path
,
mod
.
manifest_dict
[
'fetchto'
]))
manifest_dict_tmp
.
update
(
config_dict
)
config_dict
=
manifest_dict_tmp
if
not
manifest_dict_tmp
==
None
:
if
'fetchto'
in
manifest_dict_tmp
:
manifest_dict_tmp
[
'fetchto'
]
=
os
.
path
.
relpath
(
os
.
path
.
join
(
mod
.
path
,
mod
.
manifest_dict
[
'fetchto'
]))
manifest_dict_tmp
.
update
(
config_dict
)
config_dict
=
manifest_dict_tmp
return
config_dict
def
_add
(
self
,
new_module
):
...
...
hdlmake/action/core.py
View file @
eeaca46d
...
...
@@ -47,10 +47,21 @@ class ActionCore(Action):
self
.
svn_backend
=
Svn
()
self
.
local_backend
=
Local
()
def
_check_all_fetched_or_quit
(
self
):
"""Check if every module in the pool is fetched"""
if
not
len
([
m
for
m
in
self
if
not
m
.
isfetched
])
==
0
:
logging
.
error
(
"Fetching must be done before continuing.
\n
"
"The following modules remains unfetched:
\n
"
"
%
s"
,
"
\n
"
.
join
([
str
(
m
)
for
m
in
self
if
not
m
.
isfetched
])
)
quit
()
def
makefile
(
self
):
"""Write the Makefile for the current design"""
self
.
check_all_fetched_or_quit
()
self
.
_
check_all_fetched_or_quit
()
write_makefile
(
self
)
...
...
hdlmake/tools/make_sim.py
View file @
eeaca46d
...
...
@@ -32,7 +32,6 @@ class ToolSim(ToolMakefile):
def
simulation_makefile
(
self
,
pool
):
"""Execute the simulation action"""
pool
.
check_all_fetched_or_quit
()
_check_simulation_manifest
(
pool
.
config
)
fset
=
pool
.
build_file_set
(
pool
.
config
.
get
(
"sim_top"
),
...
...
hdlmake/tools/make_syn.py
View file @
eeaca46d
...
...
@@ -41,7 +41,6 @@ class ToolSyn(ToolMakefile):
def
synthesis_makefile
(
self
,
pool
):
"""Generate a Makefile for the specific synthesis tool"""
pool
.
check_all_fetched_or_quit
()
_check_synthesis_manifest
(
pool
.
config
)
fileset
=
pool
.
build_file_set
(
pool
.
config
[
"syn_top"
],
...
...
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