make: add option to include memtest cores

This commit is contained in:
Sebastien Bourdeauducq 2013-07-11 18:32:05 +02:00
parent be40cf178c
commit aa5cdd5e67
1 changed files with 5 additions and 4 deletions

View File

@ -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: