4
4
5
5
from mibuild .tools import write_to_file
6
6
from migen .util .misc import autotype
7
+ from migen .fhdl import simplify
7
8
8
9
from misoclib .gensoc import cpuif
9
10
from misoclib .s6ddrphy import initsequence
@@ -18,7 +19,8 @@ def _get_args():
18
19
parser .add_argument ("-Ot" , "--target-option" , default = [], nargs = 2 , action = "append" , help = "set target-specific option" )
19
20
parser .add_argument ("-Xp" , "--external-platform" , default = "" , help = "use external platform file in the specified path" )
20
21
parser .add_argument ("-Xt" , "--external-target" , default = "" , help = "use external target file in the specified path" )
21
-
22
+
23
+ parser .add_argument ("-d" , "--decorate" , default = [], action = "append" , help = "apply simplification decorator to top-level" )
22
24
parser .add_argument ("-Ob" , "--build-option" , default = [], nargs = 2 , action = "append" , help = "set build option" )
23
25
parser .add_argument ("-B" , "--no-bitstream" , default = False , action = "store_true" , help = "do not build bitstream file" )
24
26
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():
91
93
bios_file .close ()
92
94
soc .init_bios_memory (bios_data )
93
95
96
+ for decorator in args .decorate :
97
+ soc = getattr (simplify , decorator )(soc )
98
+
94
99
if not args .no_bitstream :
95
100
build_kwargs = dict ((k , autotype (v )) for k , v in args .build_option )
96
101
platform .build (soc , build_name = build_name , ** build_kwargs )
0 commit comments