From 63538a7d04c1e9344ac21dfaa61613a920e0471a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 19 Aug 2015 01:06:48 +0200 Subject: [PATCH] litecores: add -Ob option to make.py (allow to build with yosys for example) --- misoclib/com/liteeth/example_designs/make.py | 4 +++- misoclib/com/liteusb/example_designs/make.py | 4 +++- misoclib/mem/litesata/example_designs/make.py | 4 +++- misoclib/tools/litescope/example_designs/make.py | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/misoclib/com/liteeth/example_designs/make.py b/misoclib/com/liteeth/example_designs/make.py index a297da5bf..023e8576f 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 e60dd6ce8..e3eed9d3d 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 7bc247e20..263892efb 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 4a9cb5830..bc26b09c0 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)