# {{autogenerated}}
set -e{{verbose("x")}}
[ -n "${{platform._toolchain_env_var}}" ] && . "${{platform._toolchain_env_var}}"
- {{emit_prelude("sh")}}
{{emit_commands("sh")}}
""",
"build_{{name}}.bat": """
@rem {{autogenerated}}
{{quiet("@echo off")}}
if defined {{platform._toolchain_env_var}} call %{{platform._toolchain_env_var}}%
- {{emit_prelude("bat")}}
{{emit_commands("bat")}}
""",
}
return verilog._convert_rtlil_text(rtlil_text,
strip_internal_attrs=False, write_verilog_opts=opts)
- def emit_prelude(syntax):
+ def emit_commands(syntax):
commands = []
+
for name in self.required_tools:
env_var = tool_env_var(name)
if syntax == "sh":
else:
assert False
commands.append(template.format(env_var=env_var, name=name))
- return "\n".join(commands)
- def emit_commands(syntax):
- commands = []
for index, command_tpl in enumerate(self.command_templates):
command = render(command_tpl, origin="<command#{}>".format(index + 1),
syntax=syntax)
commands.append(command + " || exit /b")
else:
assert False
+
return "\n".join(commands)
def get_override(var):
"emit_rtlil": emit_rtlil,
"emit_verilog": emit_verilog,
"emit_debug_verilog": emit_debug_verilog,
- "emit_prelude": emit_prelude,
"emit_commands": emit_commands,
"syntax": syntax,
"invoke_tool": invoke_tool,