-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2097 from trabucayre/build_diamond_addition
Build diamond addition
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
# Copyright (c) 2017 William D. Jones <[email protected]> | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
|
||
import os | ||
|
||
from litex.build.generic_platform import GenericPlatform | ||
from litex.build.lattice import common, diamond, icestorm, trellis, radiant, oxide | ||
|
||
|
@@ -21,6 +23,8 @@ class LatticePlatform(GenericPlatform): | |
|
||
def __init__(self, *args, toolchain="diamond", **kwargs): | ||
GenericPlatform.__init__(self, *args, **kwargs) | ||
self.ips = set() | ||
self.strategy = set() | ||
if toolchain == "diamond": | ||
self.toolchain = diamond.LatticeDiamondToolchain() | ||
elif toolchain == "trellis": | ||
|
@@ -35,6 +39,12 @@ def __init__(self, *args, toolchain="diamond", **kwargs): | |
else: | ||
raise ValueError(f"Unknown toolchain {toolchain}") | ||
|
||
def add_ip(self, filename): | ||
self.ips.add((os.path.abspath(filename))) | ||
|
||
def add_strategy(self, filename, strategy_name): | ||
self.strategy.add((os.path.abspath(filename), strategy_name)) | ||
|
||
def get_verilog(self, *args, special_overrides=dict(), **kwargs): | ||
so = dict() # No common overrides between ECP5 and iCE40. | ||
so.update(self.toolchain.special_overrides) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters