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
73e3959c
Commit
73e3959c
authored
May 31, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preliminary work on Feature 1326
parent
30143252
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
4 deletions
+35
-4
__main__.py
hdlmake/__main__.py
+5
-1
fetch.py
hdlmake/action/fetch.py
+5
-1
fetch_makefile.py
hdlmake/action/fetch_makefile.py
+13
-0
makefile_writer.py
hdlmake/makefile_writer.py
+7
-1
manifest_parser.py
hdlmake/manifest_parser.py
+2
-1
module.py
hdlmake/module.py
+3
-0
No files found.
hdlmake/__main__.py
View file @
73e3959c
...
...
@@ -163,7 +163,10 @@ def main():
logging
.
error
(
"`sim_tool' manifest variable has to be specified. "
"Otherwise hdlmake doesn't know how to simulate the project."
)
quit
()
action
=
[
GenerateSimulationMakefile
]
action
=
[
GenerateSimulationMakefile
,
GenerateFetchMakefile
]
elif
top_mod
.
action
==
"synthesis"
:
if
not
top_mod
.
syn_tool
:
logging
.
error
(
"`syn_tool' manifest variable has to be specified. "
...
...
@@ -171,6 +174,7 @@ def main():
quit
()
action
=
[
GenerateSynthesisProject
,
#GenerateFetchMakefile,
GenerateSynthesisMakefile
,
GenerateRemoteSynthesisMakefile
]
...
...
hdlmake/action/fetch.py
View file @
73e3959c
...
...
@@ -21,6 +21,7 @@
import
logging
import
sys
import
os
from
.action
import
Action
...
...
@@ -33,7 +34,10 @@ class FetchModules(Action):
sys
.
exit
(
"
\n
Exiting"
)
def
run
(
self
):
top_module
=
self
.
modules_pool
.
get_top_module
()
logging
.
info
(
"Fetching needed modules."
)
os
.
system
(
top_module
.
fetch_pre_cmd
)
self
.
modules_pool
.
fetch_all
(
unfetched_only
=
not
self
.
options
.
update
,
flatten
=
self
.
options
.
flatten
)
logging
.
debug
(
str
(
self
.
modules_pool
))
logging
.
info
(
"All modules fetched."
)
\ No newline at end of file
os
.
system
(
top_module
.
fetch_post_cmd
)
logging
.
info
(
"All modules fetched."
)
hdlmake/action/fetch_makefile.py
View file @
73e3959c
...
...
@@ -26,6 +26,17 @@ from hdlmake.makefile_writer import MakefileWriter
from
.action
import
Action
class
GenerateFetchMakefile
(
Action
):
def
_check_manifest
(
self
):
if
not
self
.
top_module
.
action
==
"synthesis"
:
logging
.
error
(
"action must be equal to
\"
synthesis
\"
"
)
sys
.
exit
(
"Exiting"
)
if
not
self
.
top_module
.
syn_project
:
logging
.
error
(
"syn_project must be set in the manifest."
)
sys
.
exit
(
"Exiting"
)
def
run
(
self
):
pool
=
self
.
modules_pool
logging
.
info
(
"Generating makefile for fetching modules."
)
...
...
@@ -35,6 +46,8 @@ class GenerateFetchMakefile(Action):
quit
()
self
.
_check_all_fetched_or_quit
()
self
.
_check_manifest
()
makefile_writer
=
MakefileWriter
()
makefile_writer
.
generate_fetch_makefile
(
pool
)
del
makefile_writer
logging
.
info
(
"Makefile for fetching modules generated."
)
hdlmake/makefile_writer.py
View file @
73e3959c
...
...
@@ -81,10 +81,16 @@ class MakefileWriter(object):
def
generate_fetch_makefile
(
self
,
modules_pool
):
rp
=
os
.
path
.
relpath
top_module
=
modules_pool
.
get_top_module
()
self
.
write
(
"#target for fetching all modules stored in repositories
\n
"
)
self
.
write
(
"fetch: "
)
self
.
write
(
"fetch: __fetch_pre_cmd __run_fetch __fetch_post_cmd
\n\n
"
)
self
.
write
(
"__run_fetch:
\\\n
"
)
self
.
write
(
'
\\\n
'
.
join
([
"__"
+
m
.
basename
+
"_fetch"
for
m
in
modules_pool
if
m
.
source
in
(
fetch
.
SVN
,
fetch
.
GIT
)]))
self
.
write
(
"
\n\n
"
)
self
.
write
(
"__fetch_pre_cmd:
\n
"
)
self
.
write
(
"
\t\t
%
s
\n\n
"
%
top_module
.
fetch_pre_cmd
)
self
.
write
(
"__fetch_post_cmd:
\n
"
)
self
.
write
(
"
\t\t
%
s
\n\n
"
%
top_module
.
fetch_post_cmd
)
for
module
in
modules_pool
:
basename
=
module
.
basename
...
...
hdlmake/manifest_parser.py
View file @
73e3959c
...
...
@@ -50,7 +50,8 @@ class ManifestParser(ConfigParser):
def
__init__
(
self
):
ConfigParser
.
__init__
(
self
,
description
=
"Configuration options description"
)
self
.
add_option
(
'fetchto'
,
default
=
None
,
help
=
"Destination for fetched modules"
,
type
=
''
)
#self.add_option('root_module', default=None, help="Path to root module for currently parsed", type='')
self
.
add_option
(
'fetch_pre_cmd'
,
default
=
''
,
help
=
"Command to be executed before fetch"
,
type
=
''
)
self
.
add_option
(
'fetch_post_cmd'
,
default
=
''
,
help
=
"Command to be executed after fetch"
,
type
=
''
)
self
.
add_delimiter
()
self
.
add_option
(
'syn_name'
,
default
=
None
,
help
=
"Name of the folder at remote synthesis machine"
,
type
=
''
)
...
...
hdlmake/module.py
View file @
73e3959c
...
...
@@ -238,11 +238,14 @@ class Module(object):
if
self
.
manifest_dict
[
"syn_ise_version"
]
is
not
None
:
version
=
self
.
manifest_dict
[
"syn_ise_version"
]
self
.
syn_ise_version
=
str
(
version
)
if
self
.
manifest_dict
[
"fetchto"
]
is
not
None
:
fetchto
=
path_mod
.
rel2abs
(
self
.
manifest_dict
[
"fetchto"
],
self
.
path
)
self
.
fetchto
=
fetchto
else
:
fetchto
=
self
.
fetchto
self
.
fetch_pre_cmd
=
self
.
manifest_dict
[
"fetch_pre_cmd"
]
self
.
fetch_post_cmd
=
self
.
manifest_dict
[
"fetch_post_cmd"
]
if
"local"
in
self
.
manifest_dict
[
"modules"
]:
local_paths
=
self
.
_flatten_list
(
self
.
manifest_dict
[
"modules"
][
"local"
])
...
...
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