mibuild/xilinx: make par and map options configurable
authorRobert Jordens <jordens@gmail.com>
Fri, 4 Apr 2014 04:19:28 +0000 (22:19 -0600)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Sat, 5 Apr 2014 10:15:14 +0000 (12:15 +0200)
mibuild/xilinx_ise.py

index 4bfca827bcffc55851cb5073ddb2c90e3c7e66b7..30dd4d11adacff3efdedfcfd15939e6a700a54e3 100644 (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("..")