mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
commit
e3c33191b0
5 changed files with 45 additions and 5 deletions
|
@ -122,7 +122,7 @@ class GenericToolchain:
|
|||
from edalize import get_edatool
|
||||
|
||||
# Get tool name and options
|
||||
(tool, tool_options)= self.get_tool_options()
|
||||
(tool, tool_options) = self.get_tool_options()
|
||||
|
||||
# Files list
|
||||
files = []
|
||||
|
@ -144,7 +144,7 @@ class GenericToolchain:
|
|||
edam = {
|
||||
'name' : self._build_name,
|
||||
'files' : files,
|
||||
'tool_options' : {tool: tool_options},
|
||||
**tool_options,
|
||||
'toplevel' : self._build_name,
|
||||
}
|
||||
|
||||
|
|
|
@ -100,9 +100,9 @@ class LatticeIceStormToolchain(YosysNextPNRToolchain):
|
|||
tool_options = {
|
||||
"icepack_options": ["-s"],
|
||||
"yosys_synth_options": self._synth_opts.split(' '),
|
||||
"nextpnr_options": self._pnr_opts.split(' '),
|
||||
"nextpnr_options": self.pnr_opts.split(' '),
|
||||
}
|
||||
return ("icestorm", tool_options)
|
||||
return ("icestorm", {"tool_options": {"icestorm": tool_options}})
|
||||
|
||||
|
||||
def icestorm_args(parser):
|
||||
|
|
|
@ -62,6 +62,15 @@ class NextPNRWrapper():
|
|||
if value != "":
|
||||
self._pnr_opts += f"--{key} {value} "
|
||||
|
||||
@property
|
||||
def pnr_opts(self):
|
||||
"""return PNR configuration options
|
||||
Returns
|
||||
=======
|
||||
str containing configuration options passed to nextpnr-xxx
|
||||
"""
|
||||
return self._pnr_opts
|
||||
|
||||
def get_call(self, target="script"):
|
||||
"""built a script command or a Makefile rule + command
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ class F4PGAToolchain(GenericToolchain):
|
|||
"ars_ff2": ("ars_ff2", "true"), # user-defined attribute
|
||||
"no_shreg_extract": None
|
||||
}
|
||||
supported_build_backend = ["litex", "edalize"]
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
@ -64,7 +65,7 @@ class F4PGAToolchain(GenericToolchain):
|
|||
def build_io_constraints(self):
|
||||
# Generate design constraints
|
||||
tools.write_to_file(self._build_name + ".xdc", _build_xdc(self.named_sc, self.named_pc))
|
||||
return (self._build_name + ".xdc", "XDC")
|
||||
return (self._build_name + ".xdc", "xdc")
|
||||
|
||||
def build_timing_constraints(self, vns):
|
||||
self.platform.add_platform_command(_xdc_separator("Clock constraints"))
|
||||
|
@ -130,3 +131,20 @@ class F4PGAToolchain(GenericToolchain):
|
|||
def add_false_path_constraint(self, platform, from_, to):
|
||||
# FIXME: false path constraints are currently not supported by the F4PGA toolchain
|
||||
return
|
||||
|
||||
# Edalize tool name and tool options -----------------------------------------------------------
|
||||
def get_tool_options(self):
|
||||
device_name = {
|
||||
"xc7a10": "xc7a100t_test",
|
||||
"xc7a20": "xc7a200t_test",
|
||||
"xc7z01": "xc7z010_test",
|
||||
"xc7z02": "xc7z020_test",
|
||||
}.get(self.platform.device[0:6], "xc7a50t_test")
|
||||
|
||||
tool_options = {
|
||||
"arch" : "xilinx",
|
||||
"chip" : device_name,
|
||||
"device" : "artix7" if self.platform.device.startswith("xc7a") else "zynq",
|
||||
"part" : self._partname,
|
||||
}
|
||||
return ("f4pga", {"flow_options": tool_options})
|
||||
|
|
|
@ -157,6 +157,19 @@ class YosysNextPNRToolchain(GenericToolchain):
|
|||
seed = self.seed
|
||||
)
|
||||
|
||||
@property
|
||||
def pnr_opts(self):
|
||||
"""return PNR configuration options
|
||||
Returns
|
||||
=======
|
||||
str containing configuration options passed to nextpnr-xxx or None if
|
||||
_nextpnr is not already instanciated
|
||||
"""
|
||||
if self._nextpnr is None:
|
||||
return None
|
||||
else:
|
||||
return self._nextpnr.pnr_opts
|
||||
|
||||
def build_project(self):
|
||||
""" create project files (mainly Yosys ys file)
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue