Merge pull request #2113 from trabucayre/toolchain_diamond_sdc
litex/build/lattice/diamond, platform: allows users to add custom sdc files
This commit is contained in:
commit
3f3249cdf0
|
@ -121,6 +121,10 @@ class LatticeDiamondToolchain(GenericToolchain):
|
||||||
for filename in self.platform.ips:
|
for filename in self.platform.ips:
|
||||||
tcl.append("prj_src add \"{}\" -work {}".format(tcl_path(filename), library))
|
tcl.append("prj_src add \"{}\" -work {}".format(tcl_path(filename), library))
|
||||||
|
|
||||||
|
# Add SDCs
|
||||||
|
for filename in self.platform.sdcs:
|
||||||
|
tcl.append("prj_src add \"{}\" -format SDC".format(tcl_path(filename)))
|
||||||
|
|
||||||
# Add Strategy
|
# Add Strategy
|
||||||
for filename, strategy_name in self.platform.strategy:
|
for filename, strategy_name in self.platform.strategy:
|
||||||
tcl.append("prj_strgy import -name {} -file {}".format(strategy_name, tcl_path(filename)))
|
tcl.append("prj_strgy import -name {} -file {}".format(strategy_name, tcl_path(filename)))
|
||||||
|
|
|
@ -24,6 +24,7 @@ class LatticePlatform(GenericPlatform):
|
||||||
def __init__(self, *args, toolchain="diamond", **kwargs):
|
def __init__(self, *args, toolchain="diamond", **kwargs):
|
||||||
GenericPlatform.__init__(self, *args, **kwargs)
|
GenericPlatform.__init__(self, *args, **kwargs)
|
||||||
self.ips = set()
|
self.ips = set()
|
||||||
|
self.sdcs = set()
|
||||||
self.strategy = set()
|
self.strategy = set()
|
||||||
if toolchain == "diamond":
|
if toolchain == "diamond":
|
||||||
self.toolchain = diamond.LatticeDiamondToolchain()
|
self.toolchain = diamond.LatticeDiamondToolchain()
|
||||||
|
@ -42,6 +43,9 @@ class LatticePlatform(GenericPlatform):
|
||||||
def add_ip(self, filename):
|
def add_ip(self, filename):
|
||||||
self.ips.add((os.path.abspath(filename)))
|
self.ips.add((os.path.abspath(filename)))
|
||||||
|
|
||||||
|
def add_sdc(self, filename):
|
||||||
|
self.sdcs.add((os.path.abspath(filename)))
|
||||||
|
|
||||||
def add_strategy(self, filename, strategy_name):
|
def add_strategy(self, filename, strategy_name):
|
||||||
self.strategy.add((os.path.abspath(filename), strategy_name))
|
self.strategy.add((os.path.abspath(filename), strategy_name))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue