Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
ed934f27
Commit
ed934f27
authored
7 years ago
by
William D. Jones
Committed by
Sébastien Bourdeauducq
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
build/lattice: Refactor special_overrides as toolchain attributes.
parent
ca8d681b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
migen/build/lattice/diamond.py
migen/build/lattice/diamond.py
+2
-0
migen/build/lattice/icestorm.py
migen/build/lattice/icestorm.py
+3
-0
migen/build/lattice/platform.py
migen/build/lattice/platform.py
+2
-6
No files found.
migen/build/lattice/diamond.py
View file @
ed934f27
...
@@ -80,6 +80,8 @@ def _run_diamond(build_name, source, ver=None):
...
@@ -80,6 +80,8 @@ def _run_diamond(build_name, source, ver=None):
class
LatticeDiamondToolchain
:
class
LatticeDiamondToolchain
:
attr_translate
=
DummyAttrTranslate
()
attr_translate
=
DummyAttrTranslate
()
special_overrides
=
common
.
diamond_special_overrides
def
build
(
self
,
platform
,
fragment
,
build_dir
=
"build"
,
build_name
=
"top"
,
def
build
(
self
,
platform
,
fragment
,
build_dir
=
"build"
,
build_name
=
"top"
,
toolchain_path
=
"/opt/Diamond"
,
run
=
True
):
toolchain_path
=
"/opt/Diamond"
,
run
=
True
):
os
.
makedirs
(
build_dir
,
exist_ok
=
True
)
os
.
makedirs
(
build_dir
,
exist_ok
=
True
)
...
...
This diff is collapsed.
Click to expand it.
migen/build/lattice/icestorm.py
View file @
ed934f27
...
@@ -9,6 +9,7 @@ from migen.fhdl.structure import _Fragment
...
@@ -9,6 +9,7 @@ from migen.fhdl.structure import _Fragment
from
migen.build.generic_platform
import
*
from
migen.build.generic_platform
import
*
from
migen.build
import
tools
from
migen.build
import
tools
from
migen.build.lattice
import
common
def
_format_constraint
(
c
):
def
_format_constraint
(
c
):
...
@@ -124,6 +125,8 @@ class LatticeIceStormToolchain:
...
@@ -124,6 +125,8 @@ class LatticeIceStormToolchain:
"no_shreg_extract"
:
None
"no_shreg_extract"
:
None
}
}
special_overrides
=
common
.
icestorm_special_overrides
def
__init__
(
self
):
def
__init__
(
self
):
self
.
yosys_opt
=
"-q"
self
.
yosys_opt
=
"-q"
self
.
pre_synthesis_commands
=
list
()
self
.
pre_synthesis_commands
=
list
()
...
...
This diff is collapsed.
Click to expand it.
migen/build/lattice/platform.py
View file @
ed934f27
...
@@ -17,12 +17,8 @@ class LatticePlatform(GenericPlatform):
...
@@ -17,12 +17,8 @@ class LatticePlatform(GenericPlatform):
def
get_verilog
(
self
,
*
args
,
special_overrides
=
dict
(),
**
kwargs
):
def
get_verilog
(
self
,
*
args
,
special_overrides
=
dict
(),
**
kwargs
):
so
=
dict
()
# No common overrides between ECP and ice40.
so
=
dict
()
# No common overrides between ECP and ice40.
if
isinstance
(
self
.
toolchain
,
diamond
.
LatticeDiamondToolchain
):
so
.
update
(
self
.
toolchain
.
special_overrides
)
so
.
update
(
common
.
diamond_special_overrides
)
so
.
update
(
special_overrides
)
elif
isinstance
(
self
.
toolchain
,
icestorm
.
LatticeIceStormToolchain
):
so
.
update
(
common
.
icestorm_special_overrides
)
else
:
raise
ValueError
(
"Unknown toolchain"
)
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
so
,
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
so
,
attr_translate
=
self
.
toolchain
.
attr_translate
,
attr_translate
=
self
.
toolchain
.
attr_translate
,
**
kwargs
)
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
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