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
0a176158
Commit
0a176158
authored
Jul 28, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring milestone: the full module package is ranked 10.0/10.0 by Pylint
parent
87521299
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
87 additions
and
94 deletions
+87
-94
remote_synthesis.py
hdlmake/action/remote_synthesis.py
+1
-1
synthesis_project.py
hdlmake/action/synthesis_project.py
+3
-3
manifest_parser.py
hdlmake/manifest_parser.py
+0
-1
__init__.py
hdlmake/module/__init__.py
+2
-0
synthesis.py
hdlmake/module/synthesis.py
+20
-34
diamond.py
hdlmake/tools/diamond/diamond.py
+8
-7
ise.py
hdlmake/tools/ise/ise.py
+19
-19
libero.py
hdlmake/tools/libero/libero.py
+9
-7
planahead.py
hdlmake/tools/planahead/planahead.py
+8
-7
quartus.py
hdlmake/tools/quartus/quartus.py
+9
-8
vivado.py
hdlmake/tools/vivado/vivado.py
+8
-7
No files found.
hdlmake/action/remote_synthesis.py
View file @
0a176158
...
...
@@ -69,7 +69,7 @@ class GenerateRemoteSynthesisMakefile(Action):
sff
=
SourceFileFactory
()
files
.
add
(
sff
.
new
(
top_mod
.
syn_project
,
module
=
self
.
top_module
))
tool_object
.
generate_remote_synthesis_makefile
(
files
=
files
,
name
=
top_mod
.
syn_
name
,
tool_object
.
generate_remote_synthesis_makefile
(
files
=
files
,
name
=
top_mod
.
syn_
project
[:
-
5
]
,
cwd
=
top_mod
.
url
,
user
=
self
.
env
[
"rsynth_user"
],
server
=
self
.
env
[
"rsynth_server"
])
logging
.
info
(
"Remote synthesis makefile generated."
)
...
...
hdlmake/action/synthesis_project.py
View file @
0a176158
...
...
@@ -37,13 +37,13 @@ class GenerateSynthesisProject(Action):
if
not
self
.
modules_pool
.
get_top_module
()
.
syn_tool
:
logging
.
error
(
"syn_tool variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
self
.
modules_pool
.
get_top_module
()
.
syn_device
:
if
not
self
.
modules_pool
.
get_top_module
()
.
manifest_dict
[
"syn_device"
]
:
logging
.
error
(
"syn_device variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
self
.
modules_pool
.
get_top_module
()
.
syn_grade
:
if
not
self
.
modules_pool
.
get_top_module
()
.
manifest_dict
[
"syn_grade"
]
:
logging
.
error
(
"syn_grade variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
self
.
modules_pool
.
get_top_module
()
.
syn_package
:
if
not
self
.
modules_pool
.
get_top_module
()
.
manifest_dict
[
"syn_package"
]
:
logging
.
error
(
"syn_package variable must be set in the top manifest."
)
sys
.
exit
(
"Exiting"
)
if
not
self
.
modules_pool
.
get_top_module
()
.
syn_top
:
...
...
hdlmake/manifest_parser.py
View file @
0a176158
...
...
@@ -55,7 +55,6 @@ class ManifestParser(ConfigParser):
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
=
''
)
self
.
add_option
(
'syn_tool'
,
default
=
None
,
help
=
"Tool to be used in the synthesis"
,
type
=
''
)
self
.
add_option
(
'syn_device'
,
default
=
None
,
help
=
"Target FPGA device"
,
type
=
''
)
self
.
add_option
(
'syn_family'
,
default
=
None
,
help
=
"Target FPGA family"
,
type
=
''
)
...
...
hdlmake/module/__init__.py
View file @
0a176158
"""Package providing the Module functionality to HDLMake"""
from
.core
import
ModuleCore
from
.synthesis
import
ModuleSynthesis
from
.simulation
import
ModuleSimulation
...
...
hdlmake/module/synthesis.py
View file @
0a176158
"""This Python module is where the synthesis stuff is processed and stored"""
from
.core
import
ModuleCore
class
ModuleSynthesis
(
ModuleCore
):
"""This class provides the container for the synthesis sub-module"""
def
__init__
(
self
):
# Manifest Synthesis Properties
self
.
syn_device
=
None
self
.
syn_family
=
None
self
.
syn_grade
=
None
self
.
syn_package
=
None
# Device constructor
self
.
syn_project
=
None
self
.
syn_top
=
None
self
.
syn_tool
=
None
self
.
syn_ise_version
=
None
self
.
syn_pre_script
=
None
self
.
syn_post_script
=
None
# Manifest Included Makefiles
self
.
incl_makefiles
=
[]
super
(
ModuleSynthesis
,
self
)
.
__init__
()
def
process_manifest
(
self
):
"""Process the synthesis section of the manifest dict"""
self
.
_process_manifest_synthesis
()
self
.
_process_
manifest_
included_makefiles
()
self
.
_process_included_makefiles
()
super
(
ModuleSynthesis
,
self
)
.
process_manifest
()
def
_process_manifest_synthesis
(
self
):
# Synthesis properties
self
.
syn_pre_cmd
=
self
.
manifest_dict
[
"syn_pre_cmd"
]
self
.
syn_pre_synthesize_cmd
=
self
.
manifest_dict
[
"syn_pre_synthesize_cmd"
]
self
.
syn_post_synthesize_cmd
=
self
.
manifest_dict
[
"syn_post_synthesize_cmd"
]
self
.
syn_pre_translate_cmd
=
self
.
manifest_dict
[
"syn_pre_translate_cmd"
]
self
.
syn_post_translate_cmd
=
self
.
manifest_dict
[
"syn_post_translate_cmd"
]
self
.
syn_pre_map_cmd
=
self
.
manifest_dict
[
"syn_pre_map_cmd"
]
self
.
syn_post_map_cmd
=
self
.
manifest_dict
[
"syn_post_map_cmd"
]
self
.
syn_pre_par_cmd
=
self
.
manifest_dict
[
"syn_pre_par_cmd"
]
self
.
syn_post_par_cmd
=
self
.
manifest_dict
[
"syn_post_par_cmd"
]
self
.
syn_pre_bitstream_cmd
=
self
.
manifest_dict
[
"syn_pre_bitstream_cmd"
]
self
.
syn_post_bitstream_cmd
=
self
.
manifest_dict
[
"syn_post_bitstream_cmd"
]
self
.
syn_post_cmd
=
self
.
manifest_dict
[
"syn_post_cmd"
]
if
self
.
manifest_dict
[
"syn_name"
]
is
None
and
self
.
manifest_dict
[
"syn_project"
]
is
not
None
:
self
.
syn_name
=
self
.
manifest_dict
[
"syn_project"
][:
-
5
]
# cut out .xise from the end
else
:
self
.
syn_name
=
self
.
manifest_dict
[
"syn_name"
]
"""Init generic synthesis properties"""
# Synthesis tool
self
.
syn_tool
=
self
.
manifest_dict
[
"syn_tool"
]
self
.
syn_device
=
self
.
manifest_dict
[
"syn_device"
]
self
.
syn_family
=
self
.
manifest_dict
[
"syn_family"
]
self
.
syn_grade
=
self
.
manifest_dict
[
"syn_grade"
]
self
.
syn_package
=
self
.
manifest_dict
[
"syn_package"
]
# Project parameters
self
.
syn_project
=
self
.
manifest_dict
[
"syn_project"
]
self
.
syn_top
=
self
.
manifest_dict
[
"syn_top"
]
# This is a Xilinx ISE specific value
if
self
.
manifest_dict
[
"syn_ise_version"
]
is
not
None
:
version
=
self
.
manifest_dict
[
"syn_ise_version"
]
self
.
syn_ise_version
=
str
(
version
)
def
_process_manifest_included_makefiles
(
self
):
def
_process_included_makefiles
(
self
):
"""Get the extra makefiles defined in the HDLMake module"""
# Included Makefiles
mkFileList
=
[]
included_makefiles_aux
=
[]
if
isinstance
(
self
.
manifest_dict
[
"incl_makefiles"
],
basestring
):
mkFileList
.
append
(
self
.
manifest_dict
[
"incl_makefiles"
])
included_makefiles_aux
.
append
(
self
.
manifest_dict
[
"incl_makefiles"
])
else
:
# list
mkFileList
=
self
.
manifest_dict
[
"incl_makefiles"
][:]
included_makefiles_aux
=
self
.
manifest_dict
[
"incl_makefiles"
][:]
makefiles_paths
=
self
.
_make_list_of_paths
(
mkFileList
)
makefiles_paths
=
self
.
_make_list_of_paths
(
included_makefiles_aux
)
self
.
incl_makefiles
.
extend
(
makefiles_paths
)
hdlmake/tools/diamond/diamond.py
View file @
0a176158
...
...
@@ -88,16 +88,17 @@ mrproper:
.PHONY: mrproper clean syn_pre_cmd syn_post_cmd synthesis local check_tool
"""
)
if
top_mod
.
syn_pre_cmd
:
syn_pre_cmd
=
top_mod
.
syn_pre_cmd
if
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
:
syn_pre_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
else
:
syn_pre_cmd
=
''
if
top_mod
.
syn_post_cmd
:
syn_post_cmd
=
top_mod
.
syn_post_cmd
if
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
:
syn_post_cmd
=
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
else
:
syn_post_cmd
=
''
if
top_mod
.
force_tool
:
ft
=
top_mod
.
force_tool
check_tool
=
"""python $(HDLMAKE_HDLMAKE_PATH)/hdlmake _conditioncheck --tool {tool} --reference {reference} --condition "{condition}"
\\
...
...
@@ -137,9 +138,9 @@ mrproper:
if
update
is
True
:
self
.
update_project
()
else
:
self
.
create_project
(
top_mod
.
syn_device
,
top_mod
.
syn_grade
,
top_mod
.
syn_package
,
self
.
create_project
(
top_mod
.
manifest_dict
[
"syn_device"
]
,
top_mod
.
manifest_dict
[
"syn_grade"
]
,
top_mod
.
manifest_dict
[
"syn_package"
]
,
top_mod
.
syn_top
)
self
.
add_files
(
fileset
)
self
.
emit
(
update
=
update
)
...
...
hdlmake/tools/ise/ise.py
View file @
0a176158
...
...
@@ -350,18 +350,18 @@ mrproper:
project_name
=
top_mod
.
syn_project
,
ise_path
=
tool_path
,
check_tool
=
check_tool
,
syn_pre_cmd
=
top_mod
.
syn_pre_cmd
,
syn_p
re_synthesize_cmd
=
top_mod
.
syn_pre_synthesize_cmd
,
syn_p
ost_synthesize_cmd
=
top_mod
.
syn_post_synthesize_cmd
,
syn_p
re_translate_cmd
=
top_mod
.
syn_pre_translate_cmd
,
syn_p
ost_translate_cmd
=
top_mod
.
syn_post_translate_cmd
,
syn_p
re_map_cmd
=
top_mod
.
syn_pre_map_cmd
,
syn_p
ost_map_cmd
=
top_mod
.
syn_post_map_cmd
,
syn_p
re_par_cmd
=
top_mod
.
syn_pre_par_cmd
,
syn_p
ost_par_cmd
=
top_mod
.
syn_post_par_cmd
,
syn_p
re_bitstream_cmd
=
top_mod
.
syn_pre_bitstream_cmd
,
syn_p
ost_bitstream_cmd
=
top_mod
.
syn_post_bitstream_cmd
,
syn_post_
cmd
=
top_mod
.
syn_post_cmd
,
syn_pre_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
,
syn_p
ost_cmd
=
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
,
syn_p
re_synthesize_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_synthesize_cmd"
]
,
syn_p
ost_synthesize_cmd
=
top_mod
.
manifest_dict
[
"syn_post_synthesize_cmd"
]
,
syn_p
re_translate_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_translate_cmd"
]
,
syn_p
ost_translate_cmd
=
top_mod
.
manifest_dict
[
"syn_post_translate_cmd"
]
,
syn_p
re_map_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_map_cmd"
]
,
syn_p
ost_map_cmd
=
top_mod
.
manifest_dict
[
"syn_post_map_cmd"
]
,
syn_p
re_par_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_par_cmd"
]
,
syn_p
ost_par_cmd
=
top_mod
.
manifest_dict
[
"syn_post_par_cmd"
]
,
syn_p
re_bitstream_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_bitstream_cmd"
]
,
syn_post_
bitstream_cmd
=
top_mod
.
manifest_dict
[
"syn_post_bitstream_cmd"
]
,
xtclsh_path
=
os
.
path
.
join
(
tool_path
,
"xtclsh"
))
self
.
write
(
makefile_text
)
for
f
in
top_mod
.
incl_makefiles
:
...
...
@@ -452,15 +452,15 @@ mrproper:
def
_set_values_from_manifest
(
self
):
tm
=
self
.
top_mod
if
tm
.
syn_family
==
None
:
tm
.
syn_family
=
FAMILY_NAMES
.
get
(
tm
.
syn_device
[
0
:
4
]
.
upper
())
if
tm
.
syn_family
==
None
:
if
tm
.
manifest_dict
[
"syn_family"
]
==
None
:
tm
.
manifest_dict
[
"syn_family"
]
=
FAMILY_NAMES
.
get
(
tm
.
manifest_dict
[
"syn_device"
]
[
0
:
4
]
.
upper
())
if
tm
.
manifest_dict
[
"syn_family"
]
==
None
:
logging
.
error
(
"syn_family is not definied in Manifest.py and can not be guessed!"
)
quit
(
-
1
)
self
.
add_property
(
"Device"
,
tm
.
syn_device
)
self
.
add_property
(
"Device Family"
,
tm
.
syn_family
)
self
.
add_property
(
"Speed Grade"
,
tm
.
syn_grade
)
self
.
add_property
(
"Package"
,
tm
.
syn_package
)
self
.
add_property
(
"Device"
,
tm
.
manifest_dict
[
"syn_device"
]
)
self
.
add_property
(
"Device Family"
,
tm
.
manifest_dict
[
"syn_family"
]
)
self
.
add_property
(
"Speed Grade"
,
tm
.
manifest_dict
[
"syn_grade"
]
)
self
.
add_property
(
"Package"
,
tm
.
manifest_dict
[
"syn_package"
]
)
self
.
add_property
(
"Implementation Top"
,
"Architecture|"
+
tm
.
syn_top
)
self
.
add_property
(
"Implementation Top Instance Path"
,
"/"
+
tm
.
syn_top
)
...
...
hdlmake/tools/libero/libero.py
View file @
0a176158
...
...
@@ -90,16 +90,18 @@ mrproper:
.PHONY: mrproper clean syn_pre_cmd syn_post_cmd synthesis local check_tool
"""
)
if
top_mod
.
syn_pre_cmd
:
syn_pre_cmd
=
top_mod
.
syn_pre_cmd
if
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]:
syn_pre_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
else
:
syn_pre_cmd
=
''
if
top_mod
.
syn_post_cmd
:
syn_post_cmd
=
top_mod
.
syn_post_cmd
if
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
:
syn_post_cmd
=
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
else
:
syn_post_cmd
=
''
if
top_mod
.
force_tool
:
ft
=
top_mod
.
force_tool
check_tool
=
"""python $(HDLMAKE_HDLMAKE_PATH)/hdlmake _conditioncheck --tool {tool} --reference {reference} --condition "{condition}"
\\
...
...
@@ -130,9 +132,9 @@ mrproper:
def
generate_synthesis_project
(
self
,
update
=
False
,
tool_version
=
''
,
top_mod
=
None
,
fileset
=
None
):
self
.
files
=
[]
self
.
filename
=
top_mod
.
syn_project
self
.
syn_device
=
top_mod
.
syn_device
self
.
syn_grade
=
top_mod
.
syn_grade
self
.
syn_package
=
top_mod
.
syn_package
self
.
syn_device
=
top_mod
.
manifest_dict
[
"syn_device"
]
self
.
syn_grade
=
top_mod
.
manifest_dict
[
"syn_grade"
]
self
.
syn_package
=
top_mod
.
manifest_dict
[
"syn_package"
]
self
.
syn_top
=
top_mod
.
syn_top
self
.
header
=
None
self
.
tclname
=
'temporal.tcl'
...
...
hdlmake/tools/planahead/planahead.py
View file @
0a176158
...
...
@@ -99,13 +99,14 @@ mrproper:
.PHONY: mrproper clean syn_pre_cmd syn_post_cmd synthesis local check_tool
"""
)
if
top_mod
.
syn_pre_cmd
:
syn_pre_cmd
=
top_mod
.
syn_pre_cmd
if
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]:
syn_pre_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
else
:
syn_pre_cmd
=
''
if
top_mod
.
syn_post_cmd
:
syn_post_cmd
=
top_mod
.
syn_post_cmd
if
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
:
syn_post_cmd
=
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
else
:
syn_post_cmd
=
''
...
...
@@ -148,9 +149,9 @@ mrproper:
else
:
logging
.
info
(
"No previous project: creating a new one..."
)
self
.
create_project
()
self
.
add_initial_properties
(
top_mod
.
syn_device
,
top_mod
.
syn_grade
,
top_mod
.
syn_package
,
self
.
add_initial_properties
(
top_mod
.
manifest_dict
[
"syn_device"
]
,
top_mod
.
manifest_dict
[
"syn_grade"
]
,
top_mod
.
manifest_dict
[
"syn_package"
]
,
top_mod
.
syn_top
)
self
.
add_files
(
fileset
)
self
.
emit
()
...
...
hdlmake/tools/quartus/quartus.py
View file @
0a176158
...
...
@@ -102,13 +102,14 @@ mrproper:
.PHONY: mrproper clean syn_pre_cmd syn_post_cmd synthesis local check_tool
"""
)
if
top_mod
.
syn_pre_cmd
:
syn_pre_cmd
=
top_mod
.
syn_pre_cmd
if
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]:
syn_pre_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
else
:
syn_pre_cmd
=
''
if
top_mod
.
syn_post_cmd
:
syn_post_cmd
=
top_mod
.
syn_post_cmd
if
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
:
syn_post_cmd
=
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
else
:
syn_post_cmd
=
''
...
...
@@ -151,10 +152,10 @@ mrproper:
if
update
is
True
:
self
.
read
()
else
:
self
.
add_initial_properties
(
top_mod
.
syn_device
,
top_mod
.
syn_family
,
top_mod
.
syn_grade
,
top_mod
.
syn_package
,
self
.
add_initial_properties
(
top_mod
.
manifest_dict
[
"syn_device"
]
,
top_mod
.
manifest_dict
[
"syn_family"
]
,
top_mod
.
manifest_dict
[
"syn_grade"
]
,
top_mod
.
manifest_dict
[
"syn_package"
]
,
top_mod
.
syn_top
)
self
.
add_files
(
fileset
)
self
.
emit
()
...
...
hdlmake/tools/vivado/vivado.py
View file @
0a176158
...
...
@@ -96,13 +96,14 @@ mrproper:
.PHONY: mrproper clean syn_pre_cmd syn_post_cmd synthesis local check_tool
"""
)
if
top_mod
.
syn_pre_cmd
:
syn_pre_cmd
=
top_mod
.
syn_pre_cmd
if
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]:
syn_pre_cmd
=
top_mod
.
manifest_dict
[
"syn_pre_cmd"
]
else
:
syn_pre_cmd
=
''
if
top_mod
.
syn_post_cmd
:
syn_post_cmd
=
top_mod
.
syn_post_cmd
if
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
:
syn_post_cmd
=
top_mod
.
manifest_dict
[
"syn_post_cmd"
]
else
:
syn_post_cmd
=
''
...
...
@@ -145,9 +146,9 @@ mrproper:
else
:
logging
.
info
(
"No previous project: creating a new one..."
)
self
.
create_project
()
self
.
add_initial_properties
(
top_mod
.
syn_device
,
top_mod
.
syn_grade
,
top_mod
.
syn_package
,
self
.
add_initial_properties
(
top_mod
.
manifest_dict
[
"syn_device"
]
,
top_mod
.
manifest_dict
[
"syn_grade"
]
,
top_mod
.
manifest_dict
[
"syn_package"
]
,
top_mod
.
syn_top
)
self
.
add_files
(
fileset
)
self
.
emit
()
...
...
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