make: add decorator option
This commit is contained in:
parent
9aa474c6f0
commit
860f27300f
5
make.py
5
make.py
|
@ -4,6 +4,7 @@ import sys, argparse, importlib, subprocess, struct
|
||||||
|
|
||||||
from mibuild.tools import write_to_file
|
from mibuild.tools import write_to_file
|
||||||
from migen.util.misc import autotype
|
from migen.util.misc import autotype
|
||||||
|
from migen.fhdl import simplify
|
||||||
|
|
||||||
from misoclib.gensoc import cpuif
|
from misoclib.gensoc import cpuif
|
||||||
from misoclib.s6ddrphy import initsequence
|
from misoclib.s6ddrphy import initsequence
|
||||||
|
@ -19,6 +20,7 @@ def _get_args():
|
||||||
parser.add_argument("-Xp", "--external-platform", default="", help="use external platform file in the specified path")
|
parser.add_argument("-Xp", "--external-platform", default="", help="use external platform file in the specified path")
|
||||||
parser.add_argument("-Xt", "--external-target", default="", help="use external target file in the specified path")
|
parser.add_argument("-Xt", "--external-target", default="", help="use external target file in the specified path")
|
||||||
|
|
||||||
|
parser.add_argument("-d", "--decorate", default=[], action="append", help="apply simplification decorator to top-level")
|
||||||
parser.add_argument("-Ob", "--build-option", default=[], nargs=2, action="append", help="set build option")
|
parser.add_argument("-Ob", "--build-option", default=[], nargs=2, action="append", help="set build option")
|
||||||
parser.add_argument("-B", "--no-bitstream", default=False, action="store_true", help="do not build bitstream file")
|
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 files with CSR/IRQ/SDRAM_PHY definitions")
|
parser.add_argument("-H", "--no-header", default=False, action="store_true", help="do not build C header files with CSR/IRQ/SDRAM_PHY definitions")
|
||||||
|
@ -91,6 +93,9 @@ def main():
|
||||||
bios_file.close()
|
bios_file.close()
|
||||||
soc.init_bios_memory(bios_data)
|
soc.init_bios_memory(bios_data)
|
||||||
|
|
||||||
|
for decorator in args.decorate:
|
||||||
|
soc = getattr(simplify, decorator)(soc)
|
||||||
|
|
||||||
if not args.no_bitstream:
|
if not args.no_bitstream:
|
||||||
build_kwargs = dict((k, autotype(v)) for k, v in args.build_option)
|
build_kwargs = dict((k, autotype(v)) for k, v in args.build_option)
|
||||||
platform.build(soc, build_name=build_name, **build_kwargs)
|
platform.build(soc, build_name=build_name, **build_kwargs)
|
||||||
|
|
Loading…
Reference in New Issue