@@ -41,7 +41,7 @@ def make(cmd_args):
41
41
parser = argparse .ArgumentParser (description = 'silice-make is the Silice build tool' )
42
42
parser .add_argument ('-s' ,'--source' , help = "Source file to build." )
43
43
parser .add_argument ('-b' ,'--board' , help = "Board to build for. Variant can be specified as board:variant" )
44
- parser .add_argument ('-t' ,'--tool' , help = "Builder used (e.g. edalize, shell)." )
44
+ parser .add_argument ('-t' ,'--tool' , help = "Builder used (e.g. edalize, shell, yowasp )." )
45
45
parser .add_argument ('-p' ,'--pins' , help = "Pins used in the design, comma separated, e.g. basic,vga" )
46
46
parser .add_argument ('-o' ,'--outdir' , help = "Specify name of output directory." , default = "BUILD" )
47
47
parser .add_argument ('-l' ,'--list_boards' , help = "List all available target boards." , action = "store_true" )
@@ -269,6 +269,7 @@ def make(cmd_args):
269
269
if not os .path .exists (script ):
270
270
print (colored ("script " + script + " not found" , 'red' ))
271
271
sys .exit ()
272
+
272
273
# prepare additional defines
273
274
defines = ""
274
275
if args .pins :
@@ -304,6 +305,20 @@ def make(cmd_args):
304
305
else :
305
306
os .system (command + " " + defines + " " + add_args + " --top " + args .top )
306
307
308
+ elif target_builder ['builder' ] == 'yowasp' :
309
+
310
+ # script check
311
+ script = os .path .join (board_path ,target_builder ['command' ])
312
+ if not os .path .exists (script ):
313
+ print (colored ("script " + script + " not found" , 'red' ))
314
+ sys .exit ()
315
+ # execute
316
+ import importlib .util
317
+ spec = importlib .util .spec_from_file_location ("module_name" , script )
318
+ module = importlib .util .module_from_spec (spec )
319
+ sys .modules ["module_name" ] = module
320
+ spec .loader .exec_module (module )
321
+
307
322
elif target_builder ['builder' ] == 'edalize' :
308
323
309
324
# ==== building with Edalize
0 commit comments