Merge pull request #556 from antmicro/mglb/symbiflow-fixes

Symbiflow toolchain support: fix part name and clock frequency
This commit is contained in:
enjoy-digital 2020-06-02 16:33:40 +02:00 committed by GitHub
commit ecfa44e5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -72,6 +72,9 @@ class BaseSoC(SoCCore):
platform = arty.Platform(toolchain=toolchain) platform = arty.Platform(toolchain=toolchain)
# SoCCore ---------------------------------------------------------------------------------- # SoCCore ----------------------------------------------------------------------------------
if toolchain == "symbiflow":
sys_clk_freq=int(60e6)
SoCCore.__init__(self, platform, clk_freq=sys_clk_freq, **kwargs) SoCCore.__init__(self, platform, clk_freq=sys_clk_freq, **kwargs)
# CRG -------------------------------------------------------------------------------------- # CRG --------------------------------------------------------------------------------------

View File

@ -112,6 +112,7 @@ class SymbiflowToolchain:
self.false_paths = set() self.false_paths = set()
self.symbiflow_device = None self.symbiflow_device = None
self.bitstream_device = None self.bitstream_device = None
self._partname = None
def _check_properties(self, platform): def _check_properties(self, platform):
if not self.symbiflow_device: if not self.symbiflow_device:
@ -129,6 +130,10 @@ class SymbiflowToolchain:
}[platform.device[:4]] }[platform.device[:4]]
except KeyError: except KeyError:
raise ValueError(f"Unsupported device: {platform.device}") raise ValueError(f"Unsupported device: {platform.device}")
# FIXME: prjxray-db doesn't have xc7a35ticsg324-1L - use closest replacement
self._partname = {
"xc7a35ticsg324-1L" : "xc7a35tcsg324-1",
}.get(platform.device, platform.device)
def _generate_makefile(self, platform, build_name): def _generate_makefile(self, platform, build_name):
Var = _MakefileGenerator.Var Var = _MakefileGenerator.Var
@ -137,7 +142,7 @@ class SymbiflowToolchain:
makefile = _MakefileGenerator([ makefile = _MakefileGenerator([
"# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n", "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n",
Var("TOP", build_name), Var("TOP", build_name),
Var("PARTNAME", platform.device), Var("PARTNAME", self._partname),
Var("DEVICE", self.symbiflow_device), Var("DEVICE", self.symbiflow_device),
Var("BITSTREAM_DEVICE", self.bitstream_device), Var("BITSTREAM_DEVICE", self.bitstream_device),
"", "",