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
ca8d681b
Commit
ca8d681b
authored
7 years ago
by
William D. Jones
Committed by
Sébastien Bourdeauducq
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
lattice/platform: Refactor common code out of get_verilog().
parent
7c95ac34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
migen/build/lattice/diamond.py
migen/build/lattice/diamond.py
+3
-0
migen/build/lattice/platform.py
migen/build/lattice/platform.py
+6
-11
No files found.
migen/build/lattice/diamond.py
View file @
ca8d681b
...
...
@@ -7,6 +7,7 @@ import subprocess
import
shutil
from
migen.fhdl.structure
import
_Fragment
from
migen.fhdl.verilog
import
DummyAttrTranslate
from
migen.build.generic_platform
import
*
from
migen.build
import
tools
...
...
@@ -77,6 +78,8 @@ def _run_diamond(build_name, source, ver=None):
class
LatticeDiamondToolchain
:
attr_translate
=
DummyAttrTranslate
()
def
build
(
self
,
platform
,
fragment
,
build_dir
=
"build"
,
build_name
=
"top"
,
toolchain_path
=
"/opt/Diamond"
,
run
=
True
):
os
.
makedirs
(
build_dir
,
exist_ok
=
True
)
...
...
This diff is collapsed.
Click to expand it.
migen/build/lattice/platform.py
View file @
ca8d681b
...
...
@@ -16,21 +16,16 @@ class LatticePlatform(GenericPlatform):
raise
ValueError
(
"Unknown toolchain"
)
def
get_verilog
(
self
,
*
args
,
special_overrides
=
dict
(),
**
kwargs
):
so
=
dict
()
# No common overrides between ECP and ice40.
if
isinstance
(
self
.
toolchain
,
diamond
.
LatticeDiamondToolchain
):
diamond_so
=
dict
(
common
.
diamond_special_overrides
)
diamond_so
.
update
(
special_overrides
)
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
diamond_so
,
**
kwargs
)
so
.
update
(
common
.
diamond_special_overrides
)
elif
isinstance
(
self
.
toolchain
,
icestorm
.
LatticeIceStormToolchain
):
icestorm_so
=
dict
(
common
.
icestorm_special_overrides
)
icestorm_so
.
update
(
special_overrides
)
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
icestorm_so
,
attr_translate
=
self
.
toolchain
.
attr_translate
,
**
kwargs
)
so
.
update
(
common
.
icestorm_special_overrides
)
else
:
raise
ValueError
(
"Unknown toolchain"
)
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
so
,
attr_translate
=
self
.
toolchain
.
attr_translate
,
**
kwargs
)
def
build
(
self
,
*
args
,
**
kwargs
):
return
self
.
toolchain
.
build
(
self
,
*
args
,
**
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