Project

General

Profile

Revision 61df3cb9 src/plugins/scopes/scopes.ml

View differences:

src/plugins/scopes/scopes.ml
361 361
    include PluginType.PluginType
362 362
    val show_scopes: unit -> bool
363 363
    end) =
364
struct
365
  let name = "scopes"
366
  let is_active () = 
367
    !option_scopes || !option_show_scopes || !option_all_scopes
368
  (* || !option_mem_scopes || !option_input_scopes *)
364
  struct
365
    include PluginType.Default
366
    let name = "scopes"
367
    let is_active () = 
368
      !option_scopes || !option_show_scopes || !option_all_scopes
369
    (* || !option_mem_scopes || !option_input_scopes *)
369 370
      
370
  let show_scopes () = 
371
    !option_show_scopes && (
372
      Compiler_common.check_main ();
373
      true)
374

  
375
  let options = [
376
    "-select", Arg.String register_scopes, "specifies which variables to log";
377
    "-input", Arg.String register_inputs, "specifies the simulation input";
378
    "-show-possible-scopes", Arg.Set option_show_scopes, "list possible variables to log";
379
    "-select-all", Arg.Unit register_all_scopes, "select all possible variables to log";
380
    (* "-select-mems", Arg.Set option_mems_scopes, "select all memory variables to log";
381
     * "-select-inputs", Arg.Set option_input_scopes, "select all input variables to log"; *)
382
  ]
371
    let show_scopes () = 
372
      !option_show_scopes && (
373
        Compiler_common.check_main ();
374
        true)
375

  
376
    let usage fmt =
377
      let open Format in
378
      fprintf fmt "@[<hov 0>Scopes@ enrich@ the@ internal@ memories@ to@ record@ all@ or@ a@ selection@ of@ internals.@ In@ conjunction@ with@ the@ trace@ option@ of@ the@ produced@ binary@ it@ can@ also@ record@ these@ flow@ values@ within@ separated@ log@ files.@]@ @ ";
379
      fprintf fmt "Options are:@ "
380
    
381
    let options = [
382
        "-select", Arg.String register_scopes, "specifies which variables to log";
383
        "-input", Arg.String register_inputs, "specifies the simulation input";
384
        "-show-possible-scopes", Arg.Set option_show_scopes, "list possible variables to log";
385
        "-select-all", Arg.Unit register_all_scopes, "select all possible variables to log";
386
(* "-select-mems", Arg.Set option_mems_scopes, "select all memory variables to log";
387
 * "-select-inputs", Arg.Set option_input_scopes, "select all input variables to log"; *)
388
      ]
383 389

  
384 390
  let activate = activate
385 391

  
......
389 395
    if show_scopes () then
390 396
      begin
391 397
	let all_scopes = compute_scopes prog !Options.main_node in
392
      (* Printing scopes *)
393
      if !Options.verbose_level >= 1 then
394
	Format.printf "Possible scopes are:@   ";
395
	Format.printf "@[<v>%a@ @]@.@?" print_scopes all_scopes;
398
        (* Printing scopes *)
399
        if !Options.verbose_level >= 1 then 
400
	  Format.printf "Possible scopes are:@ ";
401
	Format.printf "@[<v 0>%a@ @]@.@?" print_scopes all_scopes;
396 402
	exit 0
397 403
      end;
398 404
    if is_active () then

Also available in: Unified diff