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
434c9f5e
Commit
434c9f5e
authored
Mar 12, 2017
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle hdl_files as a dictionay and test it on IceStorm
parent
414f5740
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
25 deletions
+28
-25
icestorm.py
hdlmake/tools/icestorm.py
+4
-21
make_syn.py
hdlmake/tools/make_syn.py
+22
-2
makefile.py
hdlmake/tools/makefile.py
+2
-2
No files found.
hdlmake/tools/icestorm.py
View file @
434c9f5e
...
...
@@ -43,9 +43,9 @@ class ToolIcestorm(ToolSyn):
STANDARD_LIBS
=
[]
SUPPORTED_FILES
=
[
PCFFile
]
SUPPORTED_FILES
=
{
PCFFile
:
None
}
HDL_FILES
=
[
VerilogFile
]
HDL_FILES
=
{
VerilogFile
:
'read_verilog $$filename'
}
CLEAN_TARGETS
=
{
'clean'
:
[
"$(PROJECT).asc"
,
"$(PROJECT).blif"
],
'mrproper'
:
[
"$(PROJECT).bin"
]}
...
...
@@ -53,10 +53,6 @@ class ToolIcestorm(ToolSyn):
TCL_CONTROLS
=
{
'synthesize'
:
'yosys -import
\n
'
+
'$(TCL_FILES)
\n
'
+
'foreach filename $$hdl_files {
\n
'
+
' read_verilog $$filename
\n
'
+
' puts "Adding file $$filename to the project."
\n
'
+
'}
\n
'
+
'synth_ice40 -top $(TOP_MODULE) -blif $(PROJECT).blif'
,
'par'
:
'catch {{exec arachne-pnr'
+
' -d {0}'
+
...
...
@@ -70,25 +66,12 @@ class ToolIcestorm(ToolSyn):
def
__init__
(
self
):
super
(
ToolIcestorm
,
self
)
.
__init__
()
self
.
_tool_info
.
update
(
ToolIcestorm
.
TOOL_INFO
)
self
.
_hdl_files
.
extend
(
ToolIcestorm
.
HDL_FILES
)
self
.
_supported_files
.
extend
(
ToolIcestorm
.
SUPPORTED_FILES
)
self
.
_hdl_files
.
update
(
ToolIcestorm
.
HDL_FILES
)
self
.
_supported_files
.
update
(
ToolIcestorm
.
SUPPORTED_FILES
)
self
.
_standard_libs
.
extend
(
ToolIcestorm
.
STANDARD_LIBS
)
self
.
_clean_targets
.
update
(
ToolIcestorm
.
CLEAN_TARGETS
)
self
.
_tcl_controls
.
update
(
ToolIcestorm
.
TCL_CONTROLS
)
def
makefile_syn_files
(
self
):
"""Write the files TCL section of the Makefile"""
ret
=
[]
ret
.
append
(
"define TCL_FILES"
)
ret
.
append
(
"set hdl_files {"
)
for
file_aux
in
self
.
fileset
:
if
isinstance
(
file_aux
,
VerilogFile
):
ret
.
append
(
" {0}"
.
format
(
file_aux
.
rel_path
()))
ret
.
append
(
"}"
)
ret
.
append
(
"endef"
)
ret
.
append
(
"export TCL_FILES"
)
self
.
writeln
(
'
\n
'
.
join
(
ret
))
def
makefile_syn_tcl
(
self
):
"""Create an IceStorm synthesis project by TCL"""
syn_device
=
self
.
manifest_dict
[
"syn_device"
]
...
...
hdlmake/tools/make_syn.py
View file @
434c9f5e
...
...
@@ -110,8 +110,28 @@ export TCL_{1}
"""
.
format
(
self
.
_tcl_controls
[
command
],
command
.
upper
()))
def
makefile_syn_files
(
self
):
"""End stub method to write the synthesis files section"""
pass
"""Write the files TCL section of the Makefile"""
ret
=
[]
ret
.
append
(
"define TCL_FILES"
)
for
hdl_filetype
in
self
.
_hdl_files
:
file_list
=
[]
for
file_aux
in
self
.
fileset
:
if
isinstance
(
file_aux
,
hdl_filetype
):
file_list
.
append
(
file_aux
.
rel_path
())
if
not
file_list
==
[]:
ret
.
append
(
'set {0} {{
\n
'
'{1}
\n
'
'}}
\n
'
'foreach filename $${0} {{
\n
'
' {2}
\n
'
' puts "Adding {0} file $$filename to the project."
\n
'
'}}'
.
format
(
hdl_filetype
.
__name__
,
'
\n
'
.
join
(
file_list
),
self
.
_hdl_files
[
hdl_filetype
]))
ret
.
append
(
"endef"
)
ret
.
append
(
"export TCL_FILES"
)
self
.
writeln
(
'
\n
'
.
join
(
ret
))
def
makefile_syn_local
(
self
):
"""Generic method to write the synthesis Makefile local target"""
...
...
hdlmake/tools/makefile.py
View file @
434c9f5e
...
...
@@ -42,8 +42,8 @@ class ToolMakefile(object):
self
.
_tool_info
=
{}
self
.
_clean_targets
=
{}
self
.
_tcl_controls
=
{}
self
.
_hdl_files
=
[]
self
.
_supported_files
=
[]
self
.
_hdl_files
=
{}
self
.
_supported_files
=
{}
self
.
_standard_libs
=
[]
self
.
fileset
=
None
self
.
manifest_dict
=
{}
...
...
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