Refactor build script toolchain lookups.

Now environment variable overrides no longer infect the build scripts.

_toolchain.overrides is dropped as probably misguided in the first place.

Fixes #251.
This commit is contained in:
Emily 2019-10-13 14:53:24 +01:00 committed by whitequark
parent 29253295ee
commit a783e4645d
9 changed files with 71 additions and 50 deletions

View file

@ -103,22 +103,22 @@ class IntelPlatform(TemplatedPlatform):
}
command_templates = [
r"""
{{get_tool("quartus_map")}}
{{invoke_tool("quartus_map")}}
{{get_override("quartus_map_opts")|options}}
--rev={{name}} {{name}}
""",
r"""
{{get_tool("quartus_fit")}}
{{invoke_tool("quartus_fit")}}
{{get_override("quartus_fit_opts")|options}}
--rev={{name}} {{name}}
""",
r"""
{{get_tool("quartus_asm")}}
{{invoke_tool("quartus_asm")}}
{{get_override("quartus_asm_opts")|options}}
--rev={{name}} {{name}}
""",
r"""
{{get_tool("quartus_sta")}}
{{invoke_tool("quartus_sta")}}
{{get_override("quartus_sta_opts")|options}}
--rev={{name}} {{name}}
""",

View file

@ -136,14 +136,14 @@ class LatticeECP5Platform(TemplatedPlatform):
}
_trellis_command_templates = [
r"""
{{get_tool("yosys")}}
{{invoke_tool("yosys")}}
{{quiet("-q")}}
{{get_override("yosys_opts")|options}}
-l {{name}}.rpt
{{name}}.ys
""",
r"""
{{get_tool("nextpnr-ecp5")}}
{{invoke_tool("nextpnr-ecp5")}}
{{quiet("--quiet")}}
{{get_override("nextpnr_opts")|options}}
--log {{name}}.tim
@ -155,7 +155,7 @@ class LatticeECP5Platform(TemplatedPlatform):
--textcfg {{name}}.config
""",
r"""
{{get_tool("ecppack")}}
{{invoke_tool("ecppack")}}
{{verbose("--verbose")}}
{{get_override("ecppack_opts")|options}}
--input {{name}}.config
@ -235,16 +235,16 @@ class LatticeECP5Platform(TemplatedPlatform):
_diamond_command_templates = [
# These don't have any usable command-line option overrides.
r"""
{{get_tool("pnmainc")}}
{{invoke_tool("pnmainc")}}
{{name}}.tcl
""",
r"""
{{get_tool("ddtcmd")}}
{{invoke_tool("ddtcmd")}}
-oft -bit
-if {{name}}_impl/{{name}}_impl.bit -of {{name}}.bit
""",
r"""
{{get_tool("ddtcmd")}}
{{invoke_tool("ddtcmd")}}
-oft -svfsingle -revd -op "Fast Program"
-if {{name}}_impl/{{name}}_impl.bit -of {{name}}.svf
""",

View file

@ -140,14 +140,14 @@ class LatticeICE40Platform(TemplatedPlatform):
}
_icestorm_command_templates = [
r"""
{{get_tool("yosys")}}
{{invoke_tool("yosys")}}
{{quiet("-q")}}
{{get_override("yosys_opts")|options}}
-l {{name}}.rpt
{{name}}.ys
""",
r"""
{{get_tool("nextpnr-ice40")}}
{{invoke_tool("nextpnr-ice40")}}
{{quiet("--quiet")}}
{{get_override("nextpnr_opts")|options}}
--log {{name}}.tim
@ -160,7 +160,7 @@ class LatticeICE40Platform(TemplatedPlatform):
--asc {{name}}.asc
""",
r"""
{{get_tool("icepack")}}
{{invoke_tool("icepack")}}
{{verbose("-v")}}
{{name}}.asc
{{name}}.bin

View file

@ -106,17 +106,17 @@ class LatticeMachXO2Platform(TemplatedPlatform):
command_templates = [
# These don't have any usable command-line option overrides.
r"""
{{get_tool("pnmainc")}}
{{invoke_tool("pnmainc")}}
{{name}}.tcl
""",
r"""
{{get_tool("ddtcmd")}}
{{invoke_tool("ddtcmd")}}
-oft -jed
-dev {{platform.device}}-{{platform.speed}}{{platform.package}}{{platform.grade}}
-if {{name}}_impl/{{name}}_impl.jed -of {{name}}.jed
""",
r"""
{{get_tool("ddtcmd")}}
{{invoke_tool("ddtcmd")}}
-oft -svfsingle -revd -op "FLASH Erase,Program,Verify"
-if {{name}}_impl/{{name}}_impl.jed -of {{name}}.svf
""",

View file

@ -139,7 +139,7 @@ class Xilinx7SeriesPlatform(TemplatedPlatform):
}
command_templates = [
r"""
{{get_tool("vivado")}}
{{invoke_tool("vivado")}}
{{verbose("-verbose")}}
{{get_override("vivado_opts")|options}}
-mode batch

View file

@ -141,12 +141,12 @@ class XilinxSpartan3Or6Platform(TemplatedPlatform):
}
command_templates = [
r"""
{{get_tool("xst")}}
{{invoke_tool("xst")}}
{{get_override("xst_opts")|options}}
-ifn {{name}}.xst
""",
r"""
{{get_tool("ngdbuild")}}
{{invoke_tool("ngdbuild")}}
{{quiet("-quiet")}}
{{verbose("-verbose")}}
{{get_override("ngdbuild_opts")|options}}
@ -154,7 +154,7 @@ class XilinxSpartan3Or6Platform(TemplatedPlatform):
{{name}}.ngc
""",
r"""
{{get_tool("map")}}
{{invoke_tool("map")}}
{{verbose("-detail")}}
{{get_override("map_opts")|default([])|options}}
-w
@ -163,7 +163,7 @@ class XilinxSpartan3Or6Platform(TemplatedPlatform):
{{name}}.pcf
""",
r"""
{{get_tool("par")}}
{{invoke_tool("par")}}
{{get_override("par_opts")|default([])|options}}
-w
{{name}}_map.ncd
@ -171,7 +171,7 @@ class XilinxSpartan3Or6Platform(TemplatedPlatform):
{{name}}.pcf
""",
r"""
{{get_tool("bitgen")}}
{{invoke_tool("bitgen")}}
{{get_override("bitgen_opts")|default(["-g Compress"])|options}}
-w
-g Binary:Yes

View file

@ -139,7 +139,7 @@ class XilinxUltraScalePlatform(TemplatedPlatform):
}
command_templates = [
r"""
{{get_tool("vivado")}}
{{invoke_tool("vivado")}}
{{verbose("-verbose")}}
{{get_override("vivado_opts")|options}}
-mode batch