mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Add optional 'ignore-loops' flag to nextpnr
This commit is contained in:
parent
f70dd48279
commit
d24a4b5428
1 changed files with 8 additions and 3 deletions
|
@ -113,11 +113,11 @@ nextpnr_ecp5_architectures = {
|
||||||
_build_template = [
|
_build_template = [
|
||||||
"yosys -q -l {build_name}.rpt {build_name}.ys",
|
"yosys -q -l {build_name}.rpt {build_name}.ys",
|
||||||
"nextpnr-ecp5 --json {build_name}.json --lpf {build_name}.lpf --textcfg {build_name}.config \
|
"nextpnr-ecp5 --json {build_name}.json --lpf {build_name}.lpf --textcfg {build_name}.config \
|
||||||
--{architecture} --package {package} --speed {speed_grade} {timefailarg}",
|
--{architecture} --package {package} --speed {speed_grade} {timefailarg} {ignoreloops}",
|
||||||
"ecppack {build_name}.config --svf {build_name}.svf --bit {build_name}.bit"
|
"ecppack {build_name}.config --svf {build_name}.svf --bit {build_name}.bit"
|
||||||
]
|
]
|
||||||
|
|
||||||
def _build_script(source, build_template, build_name, architecture, package, speed_grade, timingstrict):
|
def _build_script(source, build_template, build_name, architecture, package, speed_grade, timingstrict, ignoreloops):
|
||||||
if sys.platform in ("win32", "cygwin"):
|
if sys.platform in ("win32", "cygwin"):
|
||||||
script_ext = ".bat"
|
script_ext = ".bat"
|
||||||
script_contents = "@echo off\nrem Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n\n"
|
script_contents = "@echo off\nrem Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n\n"
|
||||||
|
@ -135,6 +135,7 @@ def _build_script(source, build_template, build_name, architecture, package, spe
|
||||||
package = package,
|
package = package,
|
||||||
speed_grade = speed_grade,
|
speed_grade = speed_grade,
|
||||||
timefailarg = "--timing-allow-fail" if not timingstrict else "",
|
timefailarg = "--timing-allow-fail" if not timingstrict else "",
|
||||||
|
ignoreloops = "--ignore-loops" if ignoreloops else "",
|
||||||
fail_stmt = fail_stmt)
|
fail_stmt = fail_stmt)
|
||||||
|
|
||||||
script_file = "build_" + build_name + script_ext
|
script_file = "build_" + build_name + script_ext
|
||||||
|
@ -180,6 +181,7 @@ class LatticeTrellisToolchain:
|
||||||
run = True,
|
run = True,
|
||||||
nowidelut = False,
|
nowidelut = False,
|
||||||
timingstrict = False,
|
timingstrict = False,
|
||||||
|
ignoreloops = False,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
|
|
||||||
# Get default toolchain path (if not specified)
|
# Get default toolchain path (if not specified)
|
||||||
|
@ -215,7 +217,7 @@ class LatticeTrellisToolchain:
|
||||||
|
|
||||||
# Generate build script
|
# Generate build script
|
||||||
script = _build_script(False, self.build_template, build_name, architecture, package,
|
script = _build_script(False, self.build_template, build_name, architecture, package,
|
||||||
speed_grade, timingstrict)
|
speed_grade, timingstrict, ignoreloops)
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
if run:
|
if run:
|
||||||
|
@ -234,9 +236,12 @@ def trellis_args(parser):
|
||||||
help="pass '-nowidelut' to yosys synth_ecp5")
|
help="pass '-nowidelut' to yosys synth_ecp5")
|
||||||
parser.add_argument("--nextpnr-timingstrict", action="store_true",
|
parser.add_argument("--nextpnr-timingstrict", action="store_true",
|
||||||
help="fail if timing not met, i.e., do NOT pass '--timing-allow-fail' to nextpnr")
|
help="fail if timing not met, i.e., do NOT pass '--timing-allow-fail' to nextpnr")
|
||||||
|
parser.add_argument("--nextpnr-ignoreloops", action="store_true",
|
||||||
|
help="ignore combinational loops in timing analysis, i.e. pass '--ignore-loops' to nextpnr")
|
||||||
|
|
||||||
def trellis_argdict(args):
|
def trellis_argdict(args):
|
||||||
return {
|
return {
|
||||||
"nowidelut": args.yosys_nowidelut,
|
"nowidelut": args.yosys_nowidelut,
|
||||||
"timingstrict": args.nextpnr_timingstrict,
|
"timingstrict": args.nextpnr_timingstrict,
|
||||||
|
"ignoreloops": args.nextpnr_ignoreloops,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue