actions["build-csr-header"] = True actions["build-bitstream"] = True actions["load-bitstream"] = True if actions["build-bitstream"]: actions["build-csr-csv"] = True actions["build-csr-header"] = True actions["build-bitstream"] = True actions["load-bitstream"] = True if actions["clean"]: subprocess.call(["rm", "-rf", "build/*"]) if actions["build-csr-csv"]: csr_csv = cpuif.get_csr_csv(csr_regions) write_to_file(args.csr_csv, csr_csv) if actions["build-csr-header"]: csr_header = cpuif.get_csr_header(csr_regions, soc.get_constants(), with_access_functions=False) write_to_file(args.csr_header, csr_header) if actions["build-bitstream"]: vns = platform.build(soc, build_name=build_name) if hasattr(soc, "do_exit") and vns is not None: if hasattr(soc.do_exit, '__call__'): soc.do_exit(vns) if actions["load-bitstream"]: prog = platform.create_programmer() prog.load_bitstream("build/" + build_name + platform.bitstream_ext)
linker_output_format) linker_regions = cpuif.get_linker_regions(memory_regions) write_to_file(os.path.join(genhdir, "regions.ld"), boilerplate + linker_regions) for sdram_phy in ["sdrphy", "ddrphy"]: if hasattr(soc, sdram_phy): sdram_phy_header = initsequence.get_sdram_phy_header( getattr(soc, sdram_phy).settings) write_to_file(os.path.join(genhdir, "sdram_phy.h"), boilerplate + sdram_phy_header) mem_header = cpuif.get_mem_header( memory_regions, getattr(soc, "flash_boot_address", None)) write_to_file(os.path.join(genhdir, "mem.h"), boilerplate + mem_header) csr_header = cpuif.get_csr_header(csr_regions, soc.get_constants()) write_to_file(os.path.join(genhdir, "csr.h"), boilerplate + csr_header) if actions["build-csr-csv"]: csr_csv = cpuif.get_csr_csv(csr_regions) write_to_file(args.csr_csv, csr_csv) if actions["build-bios"]: ret = subprocess.call(["make", "-C", os.path.join("software", "bios")]) if ret: raise OSError("BIOS build failed") bios_file = os.path.join("software", "bios", "bios.bin") if actions["build-bitstream"]: if soc.integrated_rom_size:
if soc.cpu_type != "none": cpu_mak = cpuif.get_cpu_mak(soc.cpu_type) write_to_file(os.path.join(genhdir, "cpu.mak"), cpu_mak) linker_output_format = cpuif.get_linker_output_format(soc.cpu_type) write_to_file(os.path.join(genhdir, "output_format.ld"), linker_output_format) linker_regions = cpuif.get_linker_regions(memory_regions) write_to_file(os.path.join(genhdir, "regions.ld"), boilerplate + linker_regions) for sdram_phy in ["sdrphy", "ddrphy"]: if hasattr(soc, sdram_phy): sdram_phy_header = initsequence.get_sdram_phy_header(getattr(soc, sdram_phy).settings) write_to_file(os.path.join(genhdir, "sdram_phy.h"), boilerplate + sdram_phy_header) mem_header = cpuif.get_mem_header(memory_regions, getattr(soc, "flash_boot_address", None)) write_to_file(os.path.join(genhdir, "mem.h"), boilerplate + mem_header) csr_header = cpuif.get_csr_header(csr_regions, soc.get_constants()) write_to_file(os.path.join(genhdir, "csr.h"), boilerplate + csr_header) if actions["build-csr-csv"]: csr_csv = cpuif.get_csr_csv(csr_regions) write_to_file(args.csr_csv, csr_csv) if actions["build-bios"]: ret = subprocess.call(["make", "-C", os.path.join("software", "bios")]) if ret: raise OSError("BIOS build failed") bios_file = os.path.join("software", "bios", "bios.bin") if actions["build-bitstream"]: if soc.integrated_rom_size:
actions["load-bitstream"] = True if actions["build-bitstream"]: actions["build-csr-csv"] = True actions["build-csr-header"] = True actions["build-bitstream"] = True actions["load-bitstream"] = True if actions["clean"]: subprocess.call(["rm", "-rf", "build/*"]) if actions["build-csr-csv"]: csr_csv = cpuif.get_csr_csv(csr_regions) write_to_file(args.csr_csv, csr_csv) if actions["build-csr-header"]: csr_header = cpuif.get_csr_header(csr_regions, soc.get_constants(), with_access_functions=False) write_to_file(args.csr_header, csr_header) if actions["build-bitstream"]: vns = platform.build(soc, build_name=build_name) if hasattr(soc, "do_exit") and vns is not None: if hasattr(soc.do_exit, '__call__'): soc.do_exit(vns) if actions["load-bitstream"]: prog = platform.create_programmer() prog.load_bitstream("build/" + build_name + platform.bitstream_ext)