build/lattice/icestorm: move parse_device and pnr_opts to finalize method

This commit is contained in:
Gwenhael Goavec-Merou 2022-06-26 09:05:22 +02:00
parent 418d0f3c0d
commit b75a6ba636
1 changed files with 5 additions and 5 deletions

View File

@ -44,22 +44,23 @@ class LatticeIceStormToolchain(GenericToolchain):
self.timingstrict = timingstrict self.timingstrict = timingstrict
self.ignoreloops = ignoreloops self.ignoreloops = ignoreloops
self.seed = seed self.seed = seed
return self._build(platform, fragment, **kwargs)
def finalize(self):
# Translate device to Nextpnr architecture/package # Translate device to Nextpnr architecture/package
self.platform = platform # GGM: FIXME
(_, self.architecture, self.package) = self.parse_device() (_, self.architecture, self.package) = self.parse_device()
# NextPnr options # NextPnr options
self._pnr_opts += " --pre-pack {build_name}_pre_pack.py \ self._pnr_opts += " --pre-pack {build_name}_pre_pack.py \
--{architecture} --package {package} {timefailarg} {ignoreloops} --seed {seed}".format( --{architecture} --package {package} {timefailarg} {ignoreloops} --seed {seed}".format(
build_name = kwargs["build_name"] if "build_name" in kwargs else "top", # FIXME build_name = self._build_name,
architecture = self.architecture, architecture = self.architecture,
package = self.package, package = self.package,
timefailarg = "--timing-allow-fail " if not self.timingstrict else "", timefailarg = "--timing-allow-fail " if not self.timingstrict else "",
ignoreloops = "--ignore-loops " if self.ignoreloops else "", ignoreloops = "--ignore-loops " if self.ignoreloops else "",
seed = self.seed) seed = self.seed)
return self._build(platform, fragment, **kwargs)
# IO Constraints (.pcf) ------------------------------------------------------------------------ # IO Constraints (.pcf) ------------------------------------------------------------------------
def build_io_constraints(self): def build_io_constraints(self):
@ -195,7 +196,6 @@ class LatticeIceStormToolchain(GenericToolchain):
"yosys_synth_options": self._synth_opts.split(' '), "yosys_synth_options": self._synth_opts.split(' '),
"nextpnr_options": self._pnr_opts.split(' '), "nextpnr_options": self._pnr_opts.split(' '),
} }
print(tool_options)
return ("icestorm", tool_options) return ("icestorm", tool_options)