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
aad15572
Commit
aad15572
authored
Jul 31, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Action class: options property can be obtained from env property
parent
efd645af
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
31 deletions
+31
-31
action.py
hdlmake/action/action.py
+0
-1
check_condition.py
hdlmake/action/check_condition.py
+7
-7
check_manifest.py
hdlmake/action/check_manifest.py
+1
-1
list_files.py
hdlmake/action/list_files.py
+2
-2
list_modules.py
hdlmake/action/list_modules.py
+11
-10
merge_cores.py
hdlmake/action/merge_cores.py
+2
-2
simulation.py
hdlmake/action/simulation.py
+1
-1
synthesis_project.py
hdlmake/action/synthesis_project.py
+2
-2
tree.py
hdlmake/action/tree.py
+5
-5
No files found.
hdlmake/action/action.py
View file @
aad15572
...
...
@@ -26,7 +26,6 @@ import importlib
class
Action
(
object
):
def
__init__
(
self
,
modules_pool
):
self
.
modules_pool
=
modules_pool
self
.
options
=
modules_pool
.
env
.
options
self
.
env
=
modules_pool
.
env
if
modules_pool
.
get_top_module
()
.
manifest_dict
[
"action"
]
is
"synthesis"
:
...
...
hdlmake/action/check_condition.py
View file @
aad15572
...
...
@@ -43,41 +43,41 @@ class CheckCondition(Action):
sys
.
exit
(
1
)
def
run
(
self
):
tool
=
self
.
options
.
tool
tool
=
self
.
env
.
options
.
tool
if
tool
==
"ise"
:
ver
=
self
.
env
[
"ise_version"
]
if
not
ver
:
sys
.
exit
(
1
)
ref
=
self
.
options
.
reference
ref
=
self
.
env
.
options
.
reference
ver
=
float
(
ver
)
ref
=
float
(
ref
)
elif
tool
==
"quartus"
:
ver
=
self
.
env
[
"quartus_version"
]
if
not
ver
:
sys
.
exit
(
1
)
ref
=
self
.
options
.
reference
ref
=
self
.
env
.
options
.
reference
elif
tool
==
"modelsim"
:
ver
=
self
.
env
[
"modelsim_version"
]
if
not
ver
:
sys
.
exit
(
1
)
ref
=
self
.
options
.
reference
ref
=
self
.
env
.
options
.
reference
elif
tool
==
"iverilog"
:
ver
=
self
.
env
[
"iverilog_version"
]
if
not
ver
:
sys
.
exit
(
1
)
ref
=
self
.
options
.
reference
ref
=
self
.
env
.
options
.
reference
ver
=
int
(
ver
.
replace
(
'.'
,
''
))
ref
=
int
(
ref
.
replace
(
'.'
,
''
))
elif
tool
==
"isim"
:
ver
=
self
.
env
[
"ise_version"
]
if
not
ver
:
sys
.
exit
(
1
)
ref
=
self
.
options
.
reference
ref
=
self
.
env
.
options
.
reference
ver
=
re
.
sub
(
"[a-zA-Z]"
,
''
,
ver
)
ref
=
re
.
sub
(
"[a-zA-Z]"
,
''
,
ref
)
else
:
logging
.
error
(
"Unknown tool:
%
s"
%
tool
)
sys
.
exit
(
"
\n
Exiting"
)
comparison
=
self
.
_compare
(
ver
,
ref
,
self
.
options
.
condition
)
comparison
=
self
.
_compare
(
ver
,
ref
,
self
.
env
.
options
.
condition
)
sys
.
exit
(
int
(
not
comparison
))
hdlmake/action/check_manifest.py
View file @
aad15572
...
...
@@ -26,7 +26,7 @@ from .action import Action
class
CheckManifest
(
Action
):
def
_check_options
(
self
):
if
not
self
.
options
.
top
:
if
not
self
.
env
.
options
.
top
:
logging
.
info
(
"--top is not specified. Current manifest will be treated as the top manifest"
)
def
run
(
self
):
...
...
hdlmake/action/list_files.py
View file @
aad15572
...
...
@@ -31,8 +31,8 @@ class ListFiles(Action):
file_set
=
self
.
modules_pool
.
build_file_set
()
file_list
=
dep_solver
.
make_dependency_sorted_list
(
file_set
)
files_str
=
[
f
.
path
for
f
in
file_list
]
if
self
.
options
.
delimiter
==
None
:
if
self
.
env
.
options
.
delimiter
==
None
:
delimiter
=
"
\n
"
else
:
delimiter
=
self
.
options
.
delimiter
delimiter
=
self
.
env
.
options
.
delimiter
print
(
delimiter
.
join
(
files_str
))
hdlmake/action/list_modules.py
View file @
aad15572
...
...
@@ -42,27 +42,28 @@ def _convert_to_source_name(source_code):
class
ListModules
(
Action
):
def
run
(
self
):
terse
=
self
.
env
.
options
.
terse
for
m
in
self
.
modules_pool
:
if
not
m
.
isfetched
:
logging
.
warning
(
"Module not fetched:
%
s"
%
m
.
url
)
if
not
self
.
options
.
terse
:
print
(
"# MODULE UNFETCHED! ->
%
s"
%
m
.
url
)
if
not
terse
:
print
(
"# MODULE UNFETCHED! ->
%
s"
%
m
.
url
)
else
:
if
not
self
.
options
.
terse
:
print
(
"# MODULE START ->
%
s"
%
m
.
url
)
if
not
terse
:
print
(
"# MODULE START ->
%
s"
%
m
.
url
)
if
m
.
source
in
[
fetch
.
SVN
,
fetch
.
GIT
]:
if
not
self
.
options
.
terse
:
print
(
"# * URL: "
+
m
.
url
)
if
not
terse
:
print
(
"# * URL: "
+
m
.
url
)
elif
m
.
source
==
fetch
.
GITSUBMODULE
:
if
not
self
.
options
.
terse
:
print
(
"# * This is a submodule of:
%
s"
%
m
.
parent
.
url
)
if
not
terse
:
print
(
"# * This is a submodule of:
%
s"
%
m
.
parent
.
url
)
if
m
.
source
in
[
fetch
.
SVN
,
fetch
.
GIT
,
fetch
.
LOCAL
]
and
m
.
parent
:
if
not
self
.
options
.
terse
:
print
(
"# * The parent for this module is:
%
s"
%
m
.
parent
.
url
)
if
not
terse
:
print
(
"# * The parent for this module is:
%
s"
%
m
.
parent
.
url
)
else
:
if
not
self
.
options
.
terse
:
print
(
"# * This is the root module"
)
if
not
terse
:
print
(
"# * This is the root module"
)
print
(
"
%
s
\t
%
s"
%
(
path
.
relpath
(
m
.
path
),
_convert_to_source_name
(
m
.
source
)))
if
self
.
options
.
withfiles
:
if
self
.
env
.
options
.
withfiles
:
if
not
len
(
m
.
files
):
if
not
self
.
options
.
terse
:
print
(
"# * This module has no files"
)
if
not
terse
:
print
(
"# * This module has no files"
)
else
:
for
f
in
m
.
files
:
print
(
"
%
s
\t
%
s"
%
(
path
.
relpath
(
f
.
path
),
"file"
))
if
not
self
.
options
.
terse
:
print
(
"# MODULE END ->
%
s"
%
m
.
url
)
if
not
self
.
options
.
terse
:
print
(
""
)
if
not
terse
:
print
(
"# MODULE END ->
%
s"
%
m
.
url
)
if
not
terse
:
print
(
""
)
hdlmake/action/merge_cores.py
View file @
aad15572
...
...
@@ -37,7 +37,7 @@ class MergeCores(Action):
self
.
_check_manifest_variable_is_equal_to
(
"action"
,
"synthesis"
)
def
_check_options
(
self
):
if
not
self
.
options
.
dest
:
if
not
self
.
env
.
options
.
dest
:
logging
.
error
(
"--dest must be given for merge-cores"
)
sys
.
exit
(
"Exiting"
)
...
...
@@ -47,7 +47,7 @@ class MergeCores(Action):
logging
.
info
(
"Merging all cores into one source file per language."
)
flist
=
pool
.
build_file_set
()
base
=
self
.
options
.
dest
base
=
self
.
env
.
options
.
dest
f_out
=
open
(
base
+
".vhd"
,
"w"
)
f_out
.
write
(
"
\n\n\n\n
"
)
...
...
hdlmake/action/simulation.py
View file @
aad15572
...
...
@@ -66,7 +66,7 @@ class GenerateSimulationMakefile(Action):
self
.
env
.
check_general
()
if
self
.
env
[
path_key
]
is
None
and
self
.
options
.
force
is
not
True
:
if
self
.
env
[
path_key
]
is
None
and
self
.
env
.
options
.
force
is
not
True
:
logging
.
error
(
"Can't generate a "
+
name
+
" makefile. "
+
bin_name
+
" not found."
)
sys
.
exit
(
"Exiting"
)
...
...
hdlmake/action/synthesis_project.py
View file @
aad15572
...
...
@@ -143,7 +143,7 @@ end sdb_meta_pkg;""")
env
.
check_general
()
env
.
check_tool
(
tool_object
)
if
not
self
.
options
.
force
:
if
not
self
.
env
.
options
.
force
:
if
self
.
env
[
path_key
]
is
None
:
logging
.
error
(
"Can't generate the "
+
name
+
" project. "
+
name
+
" not found."
)
quit
()
...
...
@@ -170,7 +170,7 @@ end sdb_meta_pkg;""")
fileset
.
add
(
privative_files
)
sff
=
SourceFileFactory
()
if
self
.
options
.
generate_project_vhd
:
if
self
.
env
.
options
.
generate_project_vhd
:
self
.
_write_project_vhd
(
id_value
,
env
[
version_key
])
fileset
.
add
([
sff
.
new
(
path
=
path
.
rel2abs
(
"project.vhd"
),
module
=
self
.
modules_pool
.
get_module_by_path
(
"."
))])
\
...
...
hdlmake/action/tree.py
View file @
aad15572
...
...
@@ -36,7 +36,7 @@ class Tree(Action):
hierarchy
=
nx
.
DiGraph
()
color_index
=
0
if
self
.
options
.
solved
:
if
self
.
env
.
options
.
solved
:
logging
.
warning
(
"This is the solved tree"
)
else
:
for
m
in
self
.
modules_pool
:
...
...
@@ -49,7 +49,7 @@ class Tree(Action):
else
:
hierarchy
.
add_node
(
path
.
relpath
(
m
.
path
))
top_id
=
path
.
relpath
(
m
.
path
)
if
self
.
options
.
withfiles
:
if
self
.
env
.
options
.
withfiles
:
if
len
(
m
.
files
):
for
f
in
m
.
files
:
hierarchy
.
add_edge
(
path
.
relpath
(
m
.
path
),
path
.
relpath
(
f
.
path
))
...
...
@@ -61,13 +61,13 @@ class Tree(Action):
# Program should be one of:
# twopi, gvcolor, wc, ccomps, tred, sccmap, fdp,
# circo, neato, acyclic, nop, gvpr, dot, sfdp.
if
self
.
options
.
graphviz
:
if
self
.
env
.
options
.
graphviz
:
try
:
import
matplotlib.pyplot
as
plt
except
Exception
as
e
:
logging
.
error
(
e
)
quit
()
pos
=
nx
.
graphviz_layout
(
hierarchy
,
prog
=
self
.
options
.
graphviz
,
root
=
top_id
)
pos
=
nx
.
graphviz_layout
(
hierarchy
,
prog
=
self
.
env
.
options
.
graphviz
,
root
=
top_id
)
nx
.
draw
(
hierarchy
,
pos
,
with_labels
=
True
,
alpha
=
0.5
,
...
...
@@ -76,7 +76,7 @@ class Tree(Action):
plt
.
show
()
if
self
.
options
.
web
:
if
self
.
env
.
options
.
web
:
try
:
import
json
from
networkx.readwrite
import
json_graph
...
...
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