targets/lambdaconcept_ecpix5.py: added argument to select version (r02 by default)

This commit is contained in:
Gwenhael Goavec-Merou 2024-06-14 15:57:11 +02:00
parent 6e6246d718
commit 635e932084
1 changed files with 4 additions and 3 deletions

View File

@ -222,6 +222,7 @@ class BaseSoC(SoCCore):
def main(): def main():
from litex.build.parser import LiteXArgumentParser from litex.build.parser import LiteXArgumentParser
parser = LiteXArgumentParser(platform=lambdaconcept_ecpix5.Platform, description="LiteX SoC on ECPIX-5.") parser = LiteXArgumentParser(platform=lambdaconcept_ecpix5.Platform, description="LiteX SoC on ECPIX-5.")
parser.add_target_argument("--version", default="r02", help="board version r0X (0 < X <= 3).")
parser.add_target_argument("--flash", action="store_true", help="Flash bitstream to SPI Flash.") parser.add_target_argument("--flash", action="store_true", help="Flash bitstream to SPI Flash.")
parser.add_target_argument("--device", default="85F", help="ECP5 device (45F or 85F).") parser.add_target_argument("--device", default="85F", help="ECP5 device (45F or 85F).")
parser.add_target_argument("--sys-clk-freq", default=75e6, type=float, help="System clock frequency.") parser.add_target_argument("--sys-clk-freq", default=75e6, type=float, help="System clock frequency.")
@ -252,12 +253,12 @@ def main():
builder.build(**parser.toolchain_argdict) builder.build(**parser.toolchain_argdict)
if args.load: if args.load:
prog = soc.platform.create_programmer() prog = soc.platform.create_programmer(args.version)
prog.load_bitstream(builder.get_bitstream_filename(mode="sram")) prog.load_bitstream(builder.get_bitstream_filename(mode="sram"))
if args.flash: if args.flash:
prog = soc.platform.create_programmer() prog = soc.platform.create_programmer(args.version)
prog.flash(None, builder.get_bitstream_filename(mode="flash", ext=".svf")) # FIXME prog.flash(0, builder.get_bitstream_filename(mode="flash"))
if __name__ == "__main__": if __name__ == "__main__":
main() main()