@@ -115,8 +115,6 @@ def __init__(
115
115
writerType : str | None ,
116
116
projectDir : Path ,
117
117
enteringDir : Path ,
118
- FABulousScript : Path = Path (),
119
- TCLScript : Path = Path (),
120
118
force : bool = False ,
121
119
):
122
120
"""Initialises the FABulous shell instance.
@@ -136,7 +134,6 @@ def __init__(
136
134
super ().__init__ (
137
135
persistent_history_file = f"{ os .getenv ('FAB_PROJ_DIR' )} /{ META_DATA_DIR } /.fabulous_history" ,
138
136
allow_cli_args = False ,
139
- startup_script = str (FABulousScript ) if not FABulousScript .is_dir () else "" ,
140
137
)
141
138
self .enteringDir = enteringDir
142
139
@@ -212,22 +209,6 @@ def __init__(
212
209
CMD_HELPER , "Helper commands are disabled until fabric is loaded"
213
210
)
214
211
215
- if not TCLScript .is_dir () and TCLScript .exists ():
216
- self ._startup_commands .append (f"run_tcl { Path (TCLScript ).absolute ()} " )
217
- self ._startup_commands .append ("exit" )
218
- elif not TCLScript .is_dir () and not TCLScript .exists ():
219
- logger .error (f"Cannot find { TCLScript } " )
220
- exit (1 )
221
-
222
- if not FABulousScript .is_dir () and FABulousScript .exists ():
223
- self ._startup_commands .append (
224
- f"run_script { Path (FABulousScript ).absolute ()} "
225
- )
226
- self ._startup_commands .append ("exit" )
227
- elif not FABulousScript .is_dir () and not FABulousScript .exists ():
228
- logger .error (f"Cannot find { FABulousScript } " )
229
- exit (1 )
230
-
231
212
def onecmd (self , * arg , ** kwargs ):
232
213
"""Override the onecmd method to handle exceptions."""
233
214
try :
@@ -637,7 +618,6 @@ def do_gen_top_wrapper(self, *ignored):
637
618
logger .info ("Generated top wrapper" )
638
619
639
620
@with_category (CMD_FABRIC_FLOW )
640
- @allow_blank
641
621
def do_run_FABulous_fabric (self , * ignored ):
642
622
"""Generates the fabric based on the CSV file, creates bitstream specification
643
623
of the fabric, top wrapper of the fabric, Nextpnr model of the fabric and
@@ -646,11 +626,11 @@ def do_run_FABulous_fabric(self, *ignored):
646
626
Does this by calling the respective functions 'do_gen_[function]'.
647
627
"""
648
628
logger .info ("Running FABulous" )
649
- self .do_gen_fabric ( )
650
- self .do_gen_bitStream_spec ( )
651
- self .do_gen_top_wrapper ( )
652
- self .do_gen_model_npnr ( )
653
- self .do_gen_geometry ( )
629
+ self .onecmd_plus_hooks ( "gen_fabric" )
630
+ self .onecmd_plus_hooks ( "gen_bitStream_spec" )
631
+ self .onecmd_plus_hooks ( "gen_top_wrapper" )
632
+ self .onecmd_plus_hooks ( "gen_model_npnr" )
633
+ self .onecmd_plus_hooks ( "gen_geometry" )
654
634
logger .info ("FABulous fabric flow complete" )
655
635
return
656
636
@@ -970,9 +950,9 @@ def do_run_FABulous_bitstream(self, args):
970
950
else :
971
951
logger .info ("No external primsLib found." )
972
952
973
- self .do_synthesis ( do_synth_args )
974
- self .do_place_and_route ( str ( json_file_path ) )
975
- self .do_gen_bitStream_binary ( str ( fasm_file_path ) )
953
+ self .onecmd_plus_hooks ( f"synthesis { do_synth_args } " )
954
+ self .onecmd_plus_hooks ( f"place_and_route { json_file_path } " )
955
+ self .onecmd_plus_hooks ( f"gen_bitStream_binary { fasm_file_path } " )
976
956
977
957
@with_category (CMD_SCRIPT )
978
958
@with_argparser (filePathRequireParser )
0 commit comments