make: add option to include memtest cores
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 11 Jul 2013 16:32:05 +0000 (18:32 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 11 Jul 2013 16:32:05 +0000 (18:32 +0200)
make.py

diff --git a/make.py b/make.py
index 040499b68892a8712848b46dcad959e2e0723203..c5cce7ebbd308a4e4f30eec1cfaf969b23292f8e 100755 (executable)
--- a/make.py
+++ b/make.py
@@ -7,10 +7,10 @@ from mibuild.tools import write_to_file
 from milkymist import cif
 import top, jtag
 
-def build(platform_name, build_bitstream, build_header):
+def build(platform_name, build_bitstream, build_header, *soc_args, **soc_kwargs):
        platform_module = importlib.import_module("mibuild.platforms."+platform_name)
        platform = platform_module.Platform()
-       soc = top.SoC(platform, platform_name)
+       soc = top.SoC(platform, platform_name, *soc_args, **soc_kwargs)
        
        platform.add_platform_command("""
 INST "mxcrg/wr_bufpll" LOC = "BUFPLL_X0Y2";
@@ -56,12 +56,13 @@ def main():
        parser = argparse.ArgumentParser(description="milkymist-ng - a high performance SoC built on Migen technology.")
        parser.add_argument("-p", "--platform", default="mixxeo", help="platform to build for")
        parser.add_argument("-B", "--no-bitstream", default=False, action="store_true", help="do not build bitstream file")
-       parser.add_argument("-H", "--no-header", default=False, action="store_true", help="do not build C header file with CSR/IRQ/SDRAM_PHY defs")
+       parser.add_argument("-H", "--no-header", default=False, action="store_true", help="do not build C header files with CSR/IRQ/SDRAM_PHY defs")
        parser.add_argument("-l", "--load", default=False, action="store_true", help="load bitstream to SRAM")
        parser.add_argument("-f", "--flash", default=False, action="store_true", help="load bitstream to flash")
+       parser.add_argument("-m", "--with-memtest", default=False, action="store_true", help="include memtest cores")
        args = parser.parse_args()
 
-       build(args.platform, not args.no_bitstream, not args.no_header)
+       build(args.platform, not args.no_bitstream, not args.no_header, args.with_memtest)
        if args.load:
                jtag.load("build/soc-"+args.platform+".bit")
        if args.flash: