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
2
Merge Requests
2
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
ffc94a46
Commit
ffc94a46
authored
Oct 07, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tool: factorize code.
parent
fe2c8a33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
+9
-15
makefile.py
hdlmake/tools/makefile.py
+8
-10
makefilesyn.py
hdlmake/tools/makefilesyn.py
+1
-5
No files found.
hdlmake/tools/makefile.py
View file @
ffc94a46
...
...
@@ -73,17 +73,9 @@ class ToolMakefile(object):
if
filename
:
self
.
_filename
=
filename
def
_get_name_bin
(
self
):
"""Get the name and binary values"""
if
shell
.
check_windows_tools
():
bin_name
=
self
.
TOOL_INFO
[
'windows_bin'
]
else
:
bin_name
=
self
.
TOOL_INFO
[
'linux_bin'
]
return
bin_name
def
_get_path
(
self
):
"""Get the directory in which the tool binary is at Host"""
bin_name
=
self
.
_get_name
_bin
()
bin_name
=
self
.
get_tool
_bin
()
locations
=
shell
.
which
(
bin_name
)
if
len
(
locations
)
==
0
:
return
None
...
...
@@ -93,13 +85,19 @@ class ToolMakefile(object):
def
_is_in_path
(
self
,
path_key
):
"""Check if the directory is in the system path"""
path
=
self
.
manifest_dict
.
get
(
path_key
)
bin_name
=
self
.
_get_name
_bin
()
bin_name
=
self
.
get_tool
_bin
()
return
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
bin_name
))
def
_check_in_system_path
(
self
):
"""Check if if in the system path exists a file named (name)"""
return
self
.
_get_path
()
is
not
None
def
get_tool_bin
(
self
):
if
shell
.
check_windows_tools
():
return
self
.
TOOL_INFO
[
"windows_bin"
]
else
:
return
self
.
TOOL_INFO
[
"linux_bin"
]
def
makefile_check_tool
(
self
,
path_key
):
"""Check if the binary is available in the O.S. environment"""
name
=
self
.
TOOL_INFO
[
'name'
]
...
...
hdlmake/tools/makefilesyn.py
View file @
ffc94a46
...
...
@@ -48,10 +48,6 @@ class MakefileSyn(ToolMakefile):
def
_makefile_syn_top
(
self
):
"""Create the top part of the synthesis Makefile"""
if
shell
.
check_windows_tools
():
tcl_interpreter
=
self
.
TOOL_INFO
[
"windows_bin"
]
else
:
tcl_interpreter
=
self
.
TOOL_INFO
[
"linux_bin"
]
top_parameter
=
"""
\
TOP_MODULE := {top_module}
PROJECT := {project_name}
...
...
@@ -68,7 +64,7 @@ SYN_PACKAGE := {syn_package}
SYN_GRADE := {syn_grade}
"""
self
.
writeln
(
top_parameter
.
format
(
tcl_interpreter
=
tcl_interpreter
,
tcl_interpreter
=
self
.
get_tool_bin
()
,
project_name
=
os
.
path
.
splitext
(
self
.
manifest_dict
[
"syn_project"
])[
0
],
project_ext
=
self
.
TOOL_INFO
[
"project_ext"
],
...
...
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