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
3f16323a
Commit
3f16323a
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: Split special_overrides by toolchain.
parent
2e5bf6f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
migen/build/lattice/common.py
migen/build/lattice/common.py
+14
-9
migen/build/lattice/platform.py
migen/build/lattice/platform.py
+8
-4
No files found.
migen/build/lattice/common.py
View file @
3f16323a
...
...
@@ -4,7 +4,7 @@ from migen.genlib.io import *
from
migen.genlib.resetsync
import
AsyncResetSynchronizer
class
Lattice
AsyncResetSynchronizerImpl
(
Module
):
class
Diamond
AsyncResetSynchronizerImpl
(
Module
):
def
__init__
(
self
,
cd
,
async_reset
):
rst1
=
Signal
()
self
.
specials
+=
[
...
...
@@ -15,13 +15,13 @@ class LatticeAsyncResetSynchronizerImpl(Module):
]
class
Lattice
AsyncResetSynchronizer
:
class
Diamond
AsyncResetSynchronizer
:
@
staticmethod
def
lower
(
dr
):
return
Lattice
AsyncResetSynchronizerImpl
(
dr
.
cd
,
dr
.
async_reset
)
return
Diamond
AsyncResetSynchronizerImpl
(
dr
.
cd
,
dr
.
async_reset
)
class
Lattice
DDROutputImpl
(
Module
):
class
Diamond
DDROutputImpl
(
Module
):
def
__init__
(
self
,
i1
,
i2
,
o
,
clk
):
self
.
specials
+=
Instance
(
"ODDRXD1"
,
synthesis_directive
=
"ODDRAPPS=
\"
SCLK_ALIGNED
\"
"
,
...
...
@@ -30,12 +30,17 @@ class LatticeDDROutputImpl(Module):
)
class
Lattice
DDROutput
:
class
Diamond
DDROutput
:
@
staticmethod
def
lower
(
dr
):
return
LatticeDDROutputImpl
(
dr
.
i1
,
dr
.
i2
,
dr
.
o
,
dr
.
clk
)
return
DiamondDDROutputImpl
(
dr
.
i1
,
dr
.
i2
,
dr
.
o
,
dr
.
clk
)
diamond_special_overrides
=
{
AsyncResetSynchronizer
:
DiamondAsyncResetSynchronizer
,
DDROutput
:
DiamondDDROutput
}
icestorm_special_overrides
=
{
lattice_special_overrides
=
{
AsyncResetSynchronizer
:
LatticeAsyncResetSynchronizer
,
DDROutput
:
LatticeDDROutput
}
This diff is collapsed.
Click to expand it.
migen/build/lattice/platform.py
View file @
3f16323a
...
...
@@ -16,12 +16,16 @@ class LatticePlatform(GenericPlatform):
raise
ValueError
(
"Unknown toolchain"
)
def
get_verilog
(
self
,
*
args
,
special_overrides
=
dict
(),
**
kwargs
):
so
=
dict
(
common
.
lattice_special_overrides
)
so
.
update
(
special_overrides
)
if
isinstance
(
self
.
toolchain
,
diamond
.
LatticeDiamondToolchain
):
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
so
,
**
kwargs
)
diamond_so
=
dict
(
common
.
diamond_special_overrides
)
diamond_so
.
update
(
special_overrides
)
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
diamond_so
,
**
kwargs
)
elif
isinstance
(
self
.
toolchain
,
icestorm
.
LatticeIceStormToolchain
):
return
GenericPlatform
.
get_verilog
(
self
,
*
args
,
special_overrides
=
so
,
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
)
else
:
raise
ValueError
(
"Unknown toolchain"
)
...
...
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