@@ -161,29 +161,15 @@ static void shell_printf(tcl_shell_t *sh, const char *fmt, ...)
161
161
static bool shell_has_model (tcl_shell_t * sh )
162
162
{
163
163
if (sh -> model == NULL ) {
164
- tcl_error (sh , "no simulation loaded, try the $bold$elaborate$$ "
165
- "command first" );
164
+ tcl_error (sh , "no simulation loaded, elaborate first with the "
165
+ "$bold$-e$$ command or pass the top-level design unit "
166
+ "as a command line argument" );
166
167
return false;
167
168
}
168
169
169
170
return true;
170
171
}
171
172
172
- static void shell_clear_model (tcl_shell_t * sh )
173
- {
174
- if (sh -> model == NULL )
175
- return ;
176
-
177
- model_free (sh -> model );
178
- hash_free (sh -> namemap );
179
-
180
- sh -> model = NULL ;
181
- sh -> namemap = NULL ;
182
-
183
- if (sh -> handler .quit_sim != NULL )
184
- (* sh -> handler .quit_sim )(sh -> handler .context );
185
- }
186
-
187
173
static void shell_next_time_step (rt_model_t * m , void * user )
188
174
{
189
175
tcl_shell_t * sh = user ;
@@ -496,67 +482,15 @@ static int shell_cmd_find(ClientData cd, Tcl_Interp *interp,
496
482
}
497
483
498
484
static const char elaborate_help [] =
499
- "Elaborate a design hierarchy\n"
500
- "\n"
501
- "Syntax:\n"
502
- " elaborate [options] <toplevel>\n"
503
- "\n"
504
- "Note \"vsim\" is an alias of this command.\n"
505
- "\n"
506
- "Options:\n"
507
- "\n"
508
- "Examples:\n"
509
- " elaborate toplevel\n"
510
- " vsim toplevel\n" ;
485
+ "Obsolete command which does nothing.\n" ;
511
486
512
487
static int shell_cmd_elaborate (ClientData cd , Tcl_Interp * interp ,
513
488
int objc , Tcl_Obj * const objv [])
514
489
{
515
490
tcl_shell_t * sh = cd ;
516
- LOCAL_TEXT_BUF tb = tb_new ();
517
-
518
- int pos = 1 ;
519
- for (const char * opt ; (opt = Tcl_GetString (objv [pos ]))[0 ] == '-' ; pos ++ )
520
- goto usage ;
521
-
522
- if (pos + 1 != objc )
523
- goto usage ;
524
-
525
- lib_t work = lib_work ();
526
-
527
- tb_istr (tb , lib_name (work ));
528
- tb_append (tb , '.' );
529
- tb_cat (tb , Tcl_GetString (objv [pos ]));
530
- tb_upcase (tb );
531
-
532
- tree_t unit = lib_get (lib_work (), ident_new (tb_get (tb )));
533
- if (unit == NULL )
534
- return tcl_error (sh , "cannot find unit %s in library %s" ,
535
- Tcl_GetString (objv [pos ]), istr (lib_name (work )));
536
-
537
- shell_clear_model (sh );
538
-
539
- reset_error_count ();
540
-
541
- // Recreate the JIT instance and unit registry as it may have
542
- // references to stale code
543
- jit_free (sh -> jit );
544
- unit_registry_free (sh -> registry );
545
- sh -> registry = unit_registry_new ();
546
- sh -> jit = (* sh -> make_jit )(sh -> registry );
547
-
548
- rt_model_t * m = model_new (sh -> jit , NULL );
549
- tree_t top = elab (tree_to_object (unit ), sh -> jit , sh -> registry ,
550
- NULL , NULL , m );
551
- model_free (m ); // XXX: reuse
552
- if (top == NULL )
553
- return TCL_ERROR ;
554
-
555
- shell_reset (sh , top );
556
- return TCL_OK ;
557
-
558
- usage :
559
- return syntax_error (sh , objv );
491
+ return tcl_error (sh , "the elaborate/vsim command has been removed, "
492
+ "elaborate the design first with \"nvc -e top --do ...\" "
493
+ "or \"nvc -e top -i\"" );
560
494
}
561
495
562
496
static const char examine_help [] =
@@ -914,48 +848,13 @@ static int shell_cmd_add(ClientData cd, Tcl_Interp *interp,
914
848
}
915
849
916
850
static const char quit_help [] =
917
- "Exit the simulator or unload the current design\n"
918
- "\n"
919
- "Syntax:\n"
920
- " quit [-sim]\n"
921
- "\n"
922
- "Options:\n"
923
- " -sim\t\tUnload the current simulation but do not exit the program.\n" ;
851
+ "Obsolete command which does nothing.\n" ;
924
852
925
853
static int shell_cmd_quit (ClientData cd , Tcl_Interp * interp ,
926
854
int objc , Tcl_Obj * const objv [])
927
855
{
928
856
tcl_shell_t * sh = cd ;
929
-
930
- bool quit_sim = false;
931
- int pos = 1 ;
932
- for (const char * opt ; (opt = next_option (& pos , objc , objv )); ) {
933
- if (strcmp (opt , "-sim" ) == 0 )
934
- quit_sim = true;
935
- else
936
- goto usage ;
937
- }
938
-
939
- if (pos != objc )
940
- goto usage ;
941
-
942
- if (quit_sim ) {
943
- if (!shell_has_model (sh ))
944
- return TCL_ERROR ;
945
- else
946
- shell_clear_model (sh );
947
- }
948
- else {
949
- sh -> quit = true;
950
-
951
- if (sh -> handler .exit != NULL )
952
- (* sh -> handler .exit )(0 , sh -> handler .context );
953
- }
954
-
955
- return TCL_OK ;
956
-
957
- usage :
958
- return syntax_error (sh , objv );
857
+ return tcl_error (sh , "the quit command has been removed" );
959
858
}
960
859
961
860
static const char exit_help [] =
@@ -1373,8 +1272,6 @@ static void recurse_objects(tcl_shell_t *sh, rt_scope_t *scope,
1373
1272
1374
1273
void shell_reset (tcl_shell_t * sh , tree_t top )
1375
1274
{
1376
- shell_clear_model (sh );
1377
-
1378
1275
jit_reset (sh -> jit );
1379
1276
1380
1277
sh -> top = top ;
0 commit comments