From: Florent Kermarrec Date: Tue, 18 Aug 2015 23:06:48 +0000 (+0200) Subject: litecores: add -Ob option to make.py (allow to build with yosys for example) X-Git-Tag: 24jan2021_ls180~2139 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63538a7d04c1e9344ac21dfaa61613a920e0471a;p=litex.git litecores: add -Ob option to make.py (allow to build with yosys for example) --- diff --git a/misoclib/com/liteeth/example_designs/make.py b/misoclib/com/liteeth/example_designs/make.py index a297da5b..023e8576 100755 --- a/misoclib/com/liteeth/example_designs/make.py +++ b/misoclib/com/liteeth/example_designs/make.py @@ -46,6 +46,7 @@ all clean, build-csr-csv, build-bitstream, load-bitstream. parser.add_argument("-p", "--platform", default=None, help="platform to build for") parser.add_argument("-Ot", "--target-option", default=[], nargs=2, action="append", help="set target-specific option") parser.add_argument("-Op", "--platform-option", default=[], nargs=2, action="append", help="set platform-specific option") + parser.add_argument("-Ob", "--build-option", default=[], nargs=2, action="append", help="set build option") parser.add_argument("--csr_csv", default="./test/csr.csv", help="CSV file to save the CSR map into") parser.add_argument("action", nargs="+", help="specify an action") @@ -134,7 +135,8 @@ System Clk: {} MHz write_to_file(args.csr_csv, csr_csv) if actions["build-bitstream"]: - vns = platform.build(soc, build_name=build_name) + build_kwargs = dict((k, autotype(v)) for k, v in args.build_option) + vns = platform.build(soc, build_name=build_name, **build_kwargs) if hasattr(soc, "do_exit") and vns is not None: if hasattr(soc.do_exit, '__call__'): soc.do_exit(vns) diff --git a/misoclib/com/liteusb/example_designs/make.py b/misoclib/com/liteusb/example_designs/make.py index e60dd6ce..e3eed9d3 100644 --- a/misoclib/com/liteusb/example_designs/make.py +++ b/misoclib/com/liteusb/example_designs/make.py @@ -46,6 +46,7 @@ all clean, build-csr-csv, build-bitstream, load-bitstream. parser.add_argument("-p", "--platform", default=None, help="platform to build for") parser.add_argument("-Ot", "--target-option", default=[], nargs=2, action="append", help="set target-specific option") parser.add_argument("-Op", "--platform-option", default=[], nargs=2, action="append", help="set platform-specific option") + parser.add_argument("-Ob", "--build-option", default=[], nargs=2, action="append", help="set build option") parser.add_argument("--csr_csv", default="./test/csr.csv", help="CSV file to save the CSR map into") parser.add_argument("action", nargs="+", help="specify an action") @@ -128,7 +129,8 @@ System Clk: {} MHz write_to_file(args.csr_csv, csr_csv) if actions["build-bitstream"]: - vns = platform.build(soc, build_name=build_name, run=True) + build_kwargs = dict((k, autotype(v)) for k, v in args.build_option) + vns = platform.build(soc, build_name=build_name, **build_kwargs) if hasattr(soc, "do_exit") and vns is not None: if hasattr(soc.do_exit, '__call__'): soc.do_exit(vns) diff --git a/misoclib/mem/litesata/example_designs/make.py b/misoclib/mem/litesata/example_designs/make.py index 7bc247e2..263892ef 100755 --- a/misoclib/mem/litesata/example_designs/make.py +++ b/misoclib/mem/litesata/example_designs/make.py @@ -46,6 +46,7 @@ all clean, build-csr-csv, build-bitstream, load-bitstream. parser.add_argument("-p", "--platform", default=None, help="platform to build for") parser.add_argument("-Ot", "--target-option", default=[], nargs=2, action="append", help="set target-specific option") parser.add_argument("-Op", "--platform-option", default=[("programmer", "vivado")], nargs=2, action="append", help="set platform-specific option") + parser.add_argument("-Ob", "--build-option", default=[], nargs=2, action="append", help="set build option") parser.add_argument("--csr_csv", default="./test/csr.csv", help="CSV file to save the CSR map into") parser.add_argument("action", nargs="+", help="specify an action") @@ -149,7 +150,8 @@ System Clk: {} MHz (min: {} MHz) v_output.write("build/litesata.v") if actions["build-bitstream"]: - vns = platform.build(soc, build_name=build_name, run=True) + build_kwargs = dict((k, autotype(v)) for k, v in args.build_option) + vns = platform.build(soc, build_name=build_name, **build_kwargs) if hasattr(soc, "do_exit") and vns is not None: if hasattr(soc.do_exit, '__call__'): soc.do_exit(vns) diff --git a/misoclib/tools/litescope/example_designs/make.py b/misoclib/tools/litescope/example_designs/make.py index 4a9cb583..bc26b09c 100755 --- a/misoclib/tools/litescope/example_designs/make.py +++ b/misoclib/tools/litescope/example_designs/make.py @@ -46,6 +46,7 @@ all clean, build-csr-csv, build-bitstream, load-bitstream. parser.add_argument("-p", "--platform", default=None, help="platform to build for") parser.add_argument("-Ot", "--target-option", default=[], nargs=2, action="append", help="set target-specific option") parser.add_argument("-Op", "--platform-option", default=[], nargs=2, action="append", help="set platform-specific option") + parser.add_argument("-Ob", "--build-option", default=[], nargs=2, action="append", help="set build option") parser.add_argument("--csr_csv", default="./test/csr.csv", help="CSV file to save the CSR map into") parser.add_argument("action", nargs="+", help="specify an action") @@ -143,7 +144,8 @@ RLE: {} write_to_file(args.csr_csv, csr_csv) if actions["build-bitstream"]: - vns = platform.build(soc, build_name=build_name, run=True) + build_kwargs = dict((k, autotype(v)) for k, v in args.build_option) + vns = platform.build(soc, build_name=build_name, **build_kwargs) if hasattr(soc, "do_exit") and vns is not None: if hasattr(soc.do_exit, '__call__'): soc.do_exit(vns)