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
bb17aeac
Commit
bb17aeac
authored
Aug 06, 2016
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a smarter interface between Action and Tool
parent
f5a6d101
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
20 deletions
+56
-20
simulation.py
hdlmake/action/simulation.py
+9
-10
synthesis.py
hdlmake/action/synthesis.py
+9
-10
__init__.py
hdlmake/tools/__init__.py
+2
-0
writer.py
hdlmake/tools/writer.py
+36
-0
No files found.
hdlmake/action/simulation.py
View file @
bb17aeac
...
...
@@ -29,9 +29,7 @@ import sys
from
hdlmake.dep_file
import
DepFile
# import hdlmake.new_dep_solver as dep_solver
from
hdlmake.tools
import
(
ToolIVerilog
,
ToolISim
,
ToolModelsim
,
ToolActiveHDL
,
ToolRiviera
,
ToolGHDL
)
from
hdlmake.tools
import
WriterSim
from
.action
import
Action
...
...
@@ -40,6 +38,7 @@ class ActionSimulation(Action):
"""This class contains the simulation specific methods"""
def
__init__
(
self
,
*
args
):
self
.
sim_writer
=
WriterSim
()
super
(
ActionSimulation
,
self
)
.
__init__
(
*
args
)
def
_check_simulation_makefile
(
self
):
...
...
@@ -56,16 +55,16 @@ class ActionSimulation(Action):
self
.
_check_all_fetched_or_quit
()
self
.
_check_simulation_makefile
()
tool_name
=
self
.
get_top_module
()
.
manifest_dict
[
"sim_tool"
]
tool_dict
=
{
"iverilog"
:
ToolIV
erilog
,
"isim"
:
ToolIS
im
,
"modelsim"
:
ToolM
odelsim
,
"active-hdl"
:
ToolActiveHDL
,
"riviera"
:
ToolR
iviera
,
"ghdl"
:
ToolGHDL
}
tool_dict
=
{
"iverilog"
:
self
.
sim_writer
.
iv
erilog
,
"isim"
:
self
.
sim_writer
.
is
im
,
"modelsim"
:
self
.
sim_writer
.
m
odelsim
,
"active-hdl"
:
self
.
sim_writer
.
active_hdl
,
"riviera"
:
self
.
sim_writer
.
r
iviera
,
"ghdl"
:
self
.
sim_writer
.
ghdl
}
if
not
tool_name
in
tool_dict
:
logging
.
error
(
"Unknown sim_tool:
%
s"
,
tool_name
)
sys
.
exit
(
"Exiting"
)
tool_object
=
tool_dict
[
tool_name
]
()
tool_object
=
tool_dict
[
tool_name
]
tool_info
=
tool_object
.
TOOL_INFO
if
sys
.
platform
==
'cygwin'
:
bin_name
=
tool_info
[
'windows_bin'
]
...
...
hdlmake/action/synthesis.py
View file @
bb17aeac
...
...
@@ -26,9 +26,7 @@ from __future__ import print_function
import
logging
import
sys
from
hdlmake.tools
import
(
ToolISE
,
ToolPlanAhead
,
ToolVivado
,
ToolQuartus
,
ToolDiamond
,
ToolLibero
)
from
hdlmake.tools
import
WriterSyn
from
.action
import
Action
...
...
@@ -38,21 +36,22 @@ class ActionSynthesis(Action):
"""Class providing the public synthesis methods for the user"""
def
__init__
(
self
,
*
args
):
self
.
syn_writer
=
WriterSyn
()
super
(
ActionSynthesis
,
self
)
.
__init__
(
*
args
)
def
_load_synthesis_tool
(
self
):
"""Returns a tool_object that provides the synthesis tool interface"""
tool_name
=
self
.
get_top_module
()
.
manifest_dict
[
"syn_tool"
]
tool_dict
=
{
"ise"
:
ToolISE
,
"planahead"
:
ToolPlanA
head
,
"vivado"
:
ToolV
ivado
,
"quartus"
:
ToolQ
uartus
,
"diamond"
:
ToolD
iamond
,
"libero"
:
ToolL
ibero
}
tool_dict
=
{
"ise"
:
self
.
syn_writer
.
ise
,
"planahead"
:
self
.
syn_writer
.
plana
head
,
"vivado"
:
self
.
syn_writer
.
v
ivado
,
"quartus"
:
self
.
syn_writer
.
q
uartus
,
"diamond"
:
self
.
syn_writer
.
d
iamond
,
"libero"
:
self
.
syn_writer
.
l
ibero
}
if
not
tool_name
in
tool_dict
:
logging
.
error
(
"Synthesis tool not recognized:
%
s"
,
tool_name
)
quit
()
return
tool_dict
[
tool_name
]
()
return
tool_dict
[
tool_name
]
def
_check_synthesis_project
(
self
):
"""Check the manifest contains all the keys for a synthesis project"""
...
...
hdlmake/tools/__init__.py
View file @
bb17aeac
...
...
@@ -19,3 +19,5 @@ from .vivado import ToolVivado
from
.quartus
import
ToolQuartus
from
.diamond
import
ToolDiamond
from
.libero
import
ToolLibero
from
.writer
import
WriterSim
,
WriterSyn
hdlmake/tools/writer.py
0 → 100644
View file @
bb17aeac
"""Package containing the classes required to print a Makefile"""
from
hdlmake.tools
import
(
ToolIVerilog
,
ToolISim
,
ToolModelsim
,
ToolActiveHDL
,
ToolRiviera
,
ToolGHDL
)
from
hdlmake.tools
import
(
ToolISE
,
ToolPlanAhead
,
ToolVivado
,
ToolQuartus
,
ToolDiamond
,
ToolLibero
)
class
WriterSim
(
object
):
"""Class that is in charge of writing simulation Makefiles"""
def
__init__
(
self
):
self
.
iverilog
=
ToolIVerilog
()
self
.
isim
=
ToolISim
()
self
.
modelsim
=
ToolModelsim
()
self
.
active_hdl
=
ToolActiveHDL
()
self
.
riviera
=
ToolRiviera
()
self
.
ghdl
=
ToolGHDL
()
class
WriterSyn
(
object
):
"""Class that is in charge of writing synthesis Makefiles"""
def
__init__
(
self
):
self
.
ise
=
ToolISE
()
self
.
planahead
=
ToolPlanAhead
()
self
.
vivado
=
ToolVivado
()
self
.
quartus
=
ToolQuartus
()
self
.
diamond
=
ToolDiamond
()
self
.
libero
=
ToolLibero
()
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