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
39c8a38a
Commit
39c8a38a
authored
Aug 05, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some code style change and minor issues solved
parent
cd97a8be
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
42 deletions
+21
-42
__init__.py
hdlmake/action/__init__.py
+2
-1
action.py
hdlmake/action/action.py
+0
-1
core.py
hdlmake/action/core.py
+3
-2
simulation.py
hdlmake/action/simulation.py
+3
-3
synthesis.py
hdlmake/action/synthesis.py
+3
-26
make_sim.py
hdlmake/tools/make_sim.py
+2
-2
make_syn.py
hdlmake/tools/make_syn.py
+2
-2
makefile.py
hdlmake/tools/makefile.py
+6
-5
No files found.
hdlmake/action/__init__.py
View file @
39c8a38a
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
"""The Action package provides the full set of provided user functionalities"""
"""The Action package provides the full set of provided user functionalities"""
from
.action
import
Action
from
.check
import
ActionCheck
from
.check
import
ActionCheck
from
.core
import
ActionCore
from
.core
import
ActionCore
from
.tree
import
ActionTree
from
.tree
import
ActionTree
...
@@ -30,4 +32,3 @@ from .synthesis import ActionSynthesis
...
@@ -30,4 +32,3 @@ from .synthesis import ActionSynthesis
from
.simulation
import
ActionSimulation
from
.simulation
import
ActionSimulation
from
.qsys_hw_tcl_update
import
QsysHwTclUpdate
from
.qsys_hw_tcl_update
import
QsysHwTclUpdate
from
.action
import
Action
hdlmake/action/action.py
View file @
39c8a38a
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
logging
import
logging
import
platform
from
subprocess
import
PIPE
,
Popen
from
subprocess
import
PIPE
,
Popen
import
sys
import
sys
...
...
hdlmake/action/core.py
View file @
39c8a38a
...
@@ -53,8 +53,9 @@ class ActionCore(Action):
...
@@ -53,8 +53,9 @@ class ActionCore(Action):
def
clean
(
self
):
def
clean
(
self
):
"""Delete the local copy of the fetched modules"""
"""Delete the local copy of the fetched modules"""
logging
.
info
(
"Removing fetched modules.."
)
logging
.
info
(
"Removing fetched modules.."
)
remove_list
=
[
mod_aux
for
mod_aux
in
self
if
remove_list
=
[
mod_aux
for
mod_aux
in
self
mod_aux
.
source
in
[
fetch
.
GIT
,
fetch
.
SVN
]
and
mod_aux
.
isfetched
]
if
mod_aux
.
source
in
[
fetch
.
GIT
,
fetch
.
SVN
]
and
mod_aux
.
isfetched
]
remove_list
.
reverse
()
# we will remove modules in backward order
remove_list
.
reverse
()
# we will remove modules in backward order
if
len
(
remove_list
):
if
len
(
remove_list
):
for
mod_aux
in
remove_list
:
for
mod_aux
in
remove_list
:
...
...
hdlmake/action/simulation.py
View file @
39c8a38a
...
@@ -33,9 +33,9 @@ from hdlmake.tools import (
...
@@ -33,9 +33,9 @@ from hdlmake.tools import (
ToolIVerilog
,
ToolISim
,
ToolModelsim
,
ToolIVerilog
,
ToolISim
,
ToolModelsim
,
ToolActiveHDL
,
ToolRiviera
,
ToolGHDL
)
ToolActiveHDL
,
ToolRiviera
,
ToolGHDL
)
from
.action
import
Action
class
ActionSimulation
(
ToolIVerilog
,
ToolISim
,
ToolModelsim
,
class
ActionSimulation
(
Action
):
ToolActiveHDL
,
ToolRiviera
,
ToolGHDL
):
"""This class contains the simulation specific methods"""
"""This class contains the simulation specific methods"""
...
...
hdlmake/action/synthesis.py
View file @
39c8a38a
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
from
__future__
import
print_function
from
__future__
import
print_function
import
logging
import
logging
import
sys
import
sys
import
os
from
hdlmake.srcfile
import
SourceFileFactory
from
hdlmake.srcfile
import
SourceFileFactory
from
hdlmake.util
import
path
from
hdlmake.util
import
path
...
@@ -34,9 +33,9 @@ from hdlmake.tools import (
...
@@ -34,9 +33,9 @@ from hdlmake.tools import (
ToolISE
,
ToolPlanAhead
,
ToolVivado
,
ToolISE
,
ToolPlanAhead
,
ToolVivado
,
ToolQuartus
,
ToolDiamond
,
ToolLibero
)
ToolQuartus
,
ToolDiamond
,
ToolLibero
)
from
.action
import
Action
class
ActionSynthesis
(
Action
):
class
ActionSynthesis
(
ToolISE
,
ToolPlanAhead
,
ToolVivado
,
ToolQuartus
,
ToolDiamond
,
ToolLibero
):
"""Class providing the public synthesis methods for the user"""
"""Class providing the public synthesis methods for the user"""
...
@@ -67,7 +66,6 @@ class ActionSynthesis(Action):
...
@@ -67,7 +66,6 @@ class ActionSynthesis(Action):
from
string
import
Template
from
string
import
Template
from
datetime
import
date
from
datetime
import
date
import
getpass
import
getpass
today
=
date
.
today
()
today
=
date
.
today
()
date_string
=
today
.
strftime
(
"
%
Y
%
m
%
d"
)
date_string
=
today
.
strftime
(
"
%
Y
%
m
%
d"
)
template
=
Template
(
"""library ieee;
template
=
Template
(
"""library ieee;
...
@@ -106,7 +104,6 @@ end sdb_meta_pkg;
...
@@ -106,7 +104,6 @@ end sdb_meta_pkg;
package body sdb_meta_pkg is
package body sdb_meta_pkg is
end sdb_meta_pkg;"""
)
end sdb_meta_pkg;"""
)
project_vhd
=
open
(
"project.vhd"
,
'w'
)
project_vhd
=
open
(
"project.vhd"
,
'w'
)
date_std_logic_vector
=
[]
date_std_logic_vector
=
[]
import
re
import
re
...
@@ -118,7 +115,6 @@ end sdb_meta_pkg;""")
...
@@ -118,7 +115,6 @@ end sdb_meta_pkg;""")
syn_tool_std_logic_vector
=
[]
syn_tool_std_logic_vector
=
[]
for
digit
in
syn_tool_version
:
for
digit
in
syn_tool_version
:
syn_tool_std_logic_vector
.
append
(
"{0:04b}"
.
format
(
int
(
digit
)))
syn_tool_std_logic_vector
.
append
(
"{0:04b}"
.
format
(
int
(
digit
)))
template
.
substitute
(
template
.
substitute
(
repo_url
=
self
.
top_module
.
url
,
repo_url
=
self
.
top_module
.
url
,
syn_module_name
=
self
.
top_module
.
manifest_dict
[
"syn_top"
],
syn_module_name
=
self
.
top_module
.
manifest_dict
[
"syn_top"
],
...
@@ -164,24 +160,18 @@ end sdb_meta_pkg;""")
...
@@ -164,24 +160,18 @@ end sdb_meta_pkg;""")
tool_object
=
self
.
_load_synthesis_tool
()
tool_object
=
self
.
_load_synthesis_tool
()
tool_info
=
tool_object
.
TOOL_INFO
tool_info
=
tool_object
.
TOOL_INFO
tool_ctrl
=
tool_object
.
TCL_CONTROLS
path_key
=
tool_info
[
'id'
]
+
'_path'
path_key
=
tool_info
[
'id'
]
+
'_path'
version_key
=
tool_info
[
'id'
]
+
'_version'
version_key
=
tool_info
[
'id'
]
+
'_version'
name
=
tool_info
[
'name'
]
name
=
tool_info
[
'name'
]
id_value
=
tool_info
[
'id'
]
id_value
=
tool_info
[
'id'
]
ext_value
=
tool_info
[
'project_ext'
]
env
=
self
.
env
env
=
self
.
env
env
.
check_general
()
env
.
check_general
()
env
.
check_tool
(
tool_object
)
env
.
check_tool
(
tool_object
)
top_module
=
self
.
get_top_module
()
top_module
=
self
.
get_top_module
()
if
env
[
path_key
]:
if
env
[
path_key
]:
tool_path
=
env
[
path_key
]
tool_path
=
env
[
path_key
]
else
:
else
:
tool_path
=
""
tool_path
=
""
if
not
self
.
env
.
options
.
force
:
if
not
self
.
env
.
options
.
force
:
if
self
.
env
[
path_key
]
is
None
:
if
self
.
env
[
path_key
]
is
None
:
logging
.
error
(
"Can't generate the "
+
name
+
" project. "
logging
.
error
(
"Can't generate the "
+
name
+
" project. "
...
@@ -194,19 +184,8 @@ end sdb_meta_pkg;""")
...
@@ -194,19 +184,8 @@ end sdb_meta_pkg;""")
sys
.
exit
(
"Exiting"
)
sys
.
exit
(
"Exiting"
)
logging
.
info
(
"Generating project for "
+
name
+
" v.
%
s"
,
logging
.
info
(
"Generating project for "
+
name
+
" v.
%
s"
,
env
[
version_key
])
env
[
version_key
])
if
(
os
.
path
.
exists
(
self
.
top_module
.
manifest_dict
[
"syn_project"
])
or
os
.
path
.
exists
(
self
.
top_module
.
manifest_dict
[
"syn_project"
]
+
"."
+
ext_value
)):
logging
.
info
(
"Existing project detected: updating..."
)
update
=
True
else
:
logging
.
info
(
"No previous project: creating a new one..."
)
update
=
False
top_mod
=
self
.
get_top_module
()
top_mod
=
self
.
get_top_module
()
fileset
=
self
.
build_file_set
(
top_mod
.
manifest_dict
[
"syn_top"
])
fileset
=
self
.
build_file_set
(
top_mod
.
manifest_dict
[
"syn_top"
])
sup_files
=
self
.
build_complete_file_set
()
sup_files
=
self
.
build_complete_file_set
()
privative_files
=
[]
privative_files
=
[]
for
file_aux
in
sup_files
:
for
file_aux
in
sup_files
:
...
@@ -217,14 +196,12 @@ end sdb_meta_pkg;""")
...
@@ -217,14 +196,12 @@ end sdb_meta_pkg;""")
logging
.
info
(
"Detected
%
d supported files that are not parseable"
,
logging
.
info
(
"Detected
%
d supported files that are not parseable"
,
len
(
privative_files
))
len
(
privative_files
))
fileset
.
add
(
privative_files
)
fileset
.
add
(
privative_files
)
sff
=
SourceFileFactory
()
sff
=
SourceFileFactory
()
if
self
.
env
.
options
.
generate_project_vhd
:
if
self
.
env
.
options
.
generate_project_vhd
:
self
.
_write_project_vhd
(
id_value
,
env
[
version_key
])
self
.
_write_project_vhd
(
id_value
,
env
[
version_key
])
fileset
.
add
([
sff
.
new
(
path
=
path
.
rel2abs
(
"project.vhd"
),
fileset
.
add
([
sff
.
new
(
path
=
path
.
rel2abs
(
"project.vhd"
),
module
=
self
.
get_module_by_path
(
"."
))])
module
=
self
.
get_module_by_path
(
"."
))])
tool_object
.
makefile_includes
(
top_module
)
tool_object
.
_print_incl_makefiles
(
top_module
)
tool_object
.
makefile_syn_top
(
top_module
,
tool_path
)
tool_object
.
makefile_syn_top
(
top_module
,
tool_path
)
tool_object
.
makefile_syn_tcl
(
top_module
)
tool_object
.
makefile_syn_tcl
(
top_module
)
tool_object
.
makefile_syn_files
(
fileset
)
tool_object
.
makefile_syn_files
(
fileset
)
...
...
hdlmake/tools/make_sim.py
View file @
39c8a38a
...
@@ -96,8 +96,8 @@ sim_post_cmd:
...
@@ -96,8 +96,8 @@ sim_post_cmd:
def
makefile_sim_clean
(
self
):
def
makefile_sim_clean
(
self
):
"""Generic method to write the simulation Makefile user clean target"""
"""Generic method to write the simulation Makefile user clean target"""
self
.
_print_tool
_clean
()
self
.
makefile
_clean
()
self
.
_print_tool
_mrproper
()
self
.
makefile
_mrproper
()
def
makefile_sim_phony
(
self
,
top_module
):
def
makefile_sim_phony
(
self
,
top_module
):
"""Print simulation PHONY target list to the Makefile"""
"""Print simulation PHONY target list to the Makefile"""
...
...
hdlmake/tools/make_syn.py
View file @
39c8a38a
...
@@ -213,12 +213,12 @@ syn_post_bitstream_cmd:
...
@@ -213,12 +213,12 @@ syn_post_bitstream_cmd:
def
makefile_syn_clean
(
self
):
def
makefile_syn_clean
(
self
):
"""Print the Makefile clean target for synthesis"""
"""Print the Makefile clean target for synthesis"""
self
.
_print_tool
_clean
()
self
.
makefile
_clean
()
self
.
writeln
(
"
\t\t
"
+
path_mod
.
del_command
()
+
self
.
writeln
(
"
\t\t
"
+
path_mod
.
del_command
()
+
" synthesize translate map par bitstream"
)
" synthesize translate map par bitstream"
)
self
.
writeln
(
"
\t\t
"
+
path_mod
.
del_command
()
+
self
.
writeln
(
"
\t\t
"
+
path_mod
.
del_command
()
+
" tcl_synthesize tcl_translate tcl_map tcl_par tcl_bitstream"
)
" tcl_synthesize tcl_translate tcl_map tcl_par tcl_bitstream"
)
self
.
_print_tool
_mrproper
()
self
.
makefile
_mrproper
()
def
makefile_syn_phony
(
self
):
def
makefile_syn_phony
(
self
):
"""Print synthesis PHONY target list to the Makefile"""
"""Print synthesis PHONY target list to the Makefile"""
...
...
hdlmake/tools/makefile.py
View file @
39c8a38a
...
@@ -26,13 +26,14 @@
...
@@ -26,13 +26,14 @@
import
os
import
os
from
hdlmake.util
import
path
as
path_mod
from
hdlmake.util
import
path
as
path_mod
from
hdlmake.action
import
Action
class
ToolMakefile
(
Action
):
class
ToolMakefile
(
object
):
"""Class that provides the Makefile writing methods and status"""
"""Class that provides the Makefile writing methods and status"""
def
__init__
(
self
,
filename
=
None
):
def
__init__
(
self
,
filename
=
None
):
super
(
ToolMakefile
,
self
)
.
__init__
()
self
.
_file
=
None
self
.
_file
=
None
self
.
_initialized
=
False
self
.
_initialized
=
False
self
.
_tool_info
=
{}
self
.
_tool_info
=
{}
...
@@ -49,13 +50,13 @@ class ToolMakefile(object):
...
@@ -49,13 +50,13 @@ class ToolMakefile(object):
if
self
.
_file
:
if
self
.
_file
:
self
.
_file
.
close
()
self
.
_file
.
close
()
def
_print_incl_makefil
es
(
self
,
top_module
):
def
makefile_includ
es
(
self
,
top_module
):
"""Add the included makefiles that need to be previously loaded"""
"""Add the included makefiles that need to be previously loaded"""
for
file_aux
in
top_module
.
incl_makefiles
:
for
file_aux
in
top_module
.
incl_makefiles
:
if
os
.
path
.
exists
(
file_aux
):
if
os
.
path
.
exists
(
file_aux
):
self
.
write
(
"include
%
s
\n
"
%
file_aux
)
self
.
write
(
"include
%
s
\n
"
%
file_aux
)
def
_print_tool
_clean
(
self
):
def
makefile
_clean
(
self
):
"""Print the Makefile target for cleaning intermediate files"""
"""Print the Makefile target for cleaning intermediate files"""
self
.
writeln
(
"#target for cleaning intermediate files"
)
self
.
writeln
(
"#target for cleaning intermediate files"
)
self
.
writeln
(
"clean:"
)
self
.
writeln
(
"clean:"
)
...
@@ -63,7 +64,7 @@ class ToolMakefile(object):
...
@@ -63,7 +64,7 @@ class ToolMakefile(object):
" $(LIBS) "
+
' '
.
join
(
self
.
_clean_targets
[
"clean"
])
" $(LIBS) "
+
' '
.
join
(
self
.
_clean_targets
[
"clean"
])
self
.
writeln
(
tmp
)
self
.
writeln
(
tmp
)
def
_print_tool
_mrproper
(
self
):
def
makefile
_mrproper
(
self
):
"""Print the Makefile target for cleaning final files"""
"""Print the Makefile target for cleaning final files"""
self
.
writeln
(
"#target for cleaning final files"
)
self
.
writeln
(
"#target for cleaning final files"
)
self
.
writeln
(
"mrproper: clean"
)
self
.
writeln
(
"mrproper: clean"
)
...
...
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