commit
7d79da8eda
|
@ -118,10 +118,10 @@ _build_template = [
|
||||||
"yosys -l {build_name}.rpt {build_name}.ys",
|
"yosys -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} {ignoreloops} --seed {seed}",
|
--{architecture} --package {package} --speed {speed_grade} {timefailarg} {ignoreloops} --seed {seed}",
|
||||||
"ecppack {build_name}.config --svf {build_name}.svf --bit {build_name}.bit"
|
"ecppack {build_name}.config --svf {build_name}.svf --bit {build_name}.bit --bootaddr {bootaddr}"
|
||||||
]
|
]
|
||||||
|
|
||||||
def _build_script(source, build_template, build_name, architecture, package, speed_grade, timingstrict, ignoreloops, seed):
|
def _build_script(source, build_template, build_name, architecture, package, speed_grade, timingstrict, ignoreloops, bootaddr, seed):
|
||||||
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"
|
||||||
|
@ -140,6 +140,7 @@ def _build_script(source, build_template, build_name, architecture, package, spe
|
||||||
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 "",
|
ignoreloops = "--ignore-loops" if ignoreloops else "",
|
||||||
|
bootaddr = bootaddr,
|
||||||
fail_stmt = fail_stmt,
|
fail_stmt = fail_stmt,
|
||||||
seed = seed)
|
seed = seed)
|
||||||
|
|
||||||
|
@ -187,6 +188,7 @@ class LatticeTrellisToolchain:
|
||||||
nowidelut = False,
|
nowidelut = False,
|
||||||
timingstrict = False,
|
timingstrict = False,
|
||||||
ignoreloops = False,
|
ignoreloops = False,
|
||||||
|
bootaddr = 0,
|
||||||
seed = 1,
|
seed = 1,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
|
|
||||||
|
@ -219,8 +221,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, ignoreloops, seed)
|
speed_grade, timingstrict, ignoreloops, bootaddr, seed)
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
if run:
|
if run:
|
||||||
_run_script(script)
|
_run_script(script)
|
||||||
|
@ -246,6 +247,8 @@ def trellis_args(parser):
|
||||||
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",
|
parser.add_argument("--nextpnr-ignoreloops", action="store_true",
|
||||||
help="ignore combinational loops in timing analysis, i.e. pass '--ignore-loops' to nextpnr")
|
help="ignore combinational loops in timing analysis, i.e. pass '--ignore-loops' to nextpnr")
|
||||||
|
parser.add_argument("--ecppack-bootaddr", default=0,
|
||||||
|
help="Set boot address for next image, i.e. pass '--bootaddr xxx' to ecppack")
|
||||||
parser.add_argument("--nextpnr-seed", default=1, type=int,
|
parser.add_argument("--nextpnr-seed", default=1, type=int,
|
||||||
help="seed to pass to nextpnr")
|
help="seed to pass to nextpnr")
|
||||||
|
|
||||||
|
@ -254,5 +257,6 @@ def trellis_argdict(args):
|
||||||
"nowidelut": args.yosys_nowidelut,
|
"nowidelut": args.yosys_nowidelut,
|
||||||
"timingstrict": args.nextpnr_timingstrict,
|
"timingstrict": args.nextpnr_timingstrict,
|
||||||
"ignoreloops": args.nextpnr_ignoreloops,
|
"ignoreloops": args.nextpnr_ignoreloops,
|
||||||
|
"bootaddr": args.ecppack_bootaddr,
|
||||||
"seed": args.nextpnr_seed,
|
"seed": args.nextpnr_seed,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue