mibuild/xilinx: make par and map options configurable

This commit is contained in:
Robert Jordens 2014-04-03 22:19:28 -06:00 committed by Sebastien Bourdeauducq
parent ac1363565d
commit 9ff6cc8403

View file

@ -125,7 +125,7 @@ def _is_valid_version(path, v):
return False
def _run_ise(build_name, ise_path, source, mode, ngdbuild_opt,
bitgen_opt, ise_commands):
bitgen_opt, ise_commands, map_opt, par_opt):
if sys.platform == "win32" or sys.platform == "cygwin":
source = False
build_script_contents = "# Autogenerated by mibuild\nset -e\n"
@ -148,12 +148,13 @@ xst -ifn {build_name}.xst"""
build_script_contents += """
ngdbuild {ngdbuild_opt} -uc {build_name}.ucf {build_name}.{ext} {build_name}.ngd
map -ol high -w -o {build_name}_map.ncd {build_name}.ngd {build_name}.pcf
par -ol high -w {build_name}_map.ncd {build_name}.ncd {build_name}.pcf
map {map_opt} -w -o {build_name}_map.ncd {build_name}.ngd {build_name}.pcf
par {par_opt} -w {build_name}_map.ncd {build_name}.ncd {build_name}.pcf
bitgen {bitgen_opt} -w {build_name}.ncd {build_name}.bit
"""
build_script_contents = build_script_contents.format(build_name=build_name,
ngdbuild_opt=ngdbuild_opt, bitgen_opt=bitgen_opt, ext=ext)
ngdbuild_opt=ngdbuild_opt, bitgen_opt=bitgen_opt, ext=ext,
par_opt=par_opt, map_opt=map_opt)
build_script_contents += ise_commands.format(build_name=build_name)
build_script_file = "build_" + build_name + ".sh"
tools.write_to_file(build_script_file, build_script_contents)
@ -187,6 +188,8 @@ class XilinxISEPlatform(GenericPlatform):
-opt_mode SPEED
-reduce_control_sets auto
-register_balancing yes"""
map_opt = "-ol high"
par_opt = "-ol high"
ngdbuild_opt = ""
bitgen_opt = "-g LCK_cycle:6 -g Binary:Yes"
ise_commands = ""
@ -238,6 +241,7 @@ class XilinxISEPlatform(GenericPlatform):
tools.write_to_file(build_name + ".ucf", _build_ucf(named_sc, named_pc))
if run:
_run_ise(build_name, ise_path, source, isemode,
ngdbuild_opt, self.bitgen_opt, self.ise_commands)
ngdbuild_opt, self.bitgen_opt, self.ise_commands,
self.map_opt, self.par_opt)
os.chdir("..")