Email: bknpk@hotmail.com Phone: +972-54-7649119


Unit hierarchy ASCII text report from specman.

  1. In this site hierarchy scripts were discussed regrading a verilog, VHDL or mixed design. Please see example: script

  2. For the HDL it usually possible to obtain a list of all loaded files easily. Sometimes it -for HDL- requires a non affordable effort. For example in cases such as you become part of great project and there is no single list. For those cases I used the ncls utility. Please see example: ncls

  3. For the hdl hierarchy finder, I had a perl script that extracts hierarchy. While it is fairly easy to obtain the list of files loaded into specman e_list , I decided for a different approach. I count entirely on the specman tool to generate the required information and than parse it with a perl script.

  4. First I added this e-code to the test.

  5. //Suggested by my friend :Author of Specman Verification
    extend any_unit {
      post_generate() is also {
        outf("dbg pini path A\n");
        print me;
        outf("dbg pini path B\n");
      };
    };
    //Note: this code may not work on encrypted code.

  6. Now you can run the script and obtain a nice report of the specman units involved: perl ~/bin/e_tree.pl specman.elog.
    The report looks like:

  7. ----------------------------------------
    message_logger-@1:
    message_logger
    e_path:sys.logger
    hdl_path:
    ----------------------------------------
    ----------------------------------------
    pm_37_clkgen_seed_generator_u-@2:
    pm_37_clkgen_seed_generator_u
    e_path:sys.pm_37_clkgen_seed_generator
    hdl_path:
    ----------------------------------------
    ----------------------------------------
    virtual_driver_u-@3:
    virtual_driver_u
    e_path:sys.pm_tb_env.virtual_driver
    hdl_path:~/pm_tb
    ----------------------------------------
    ...
    ----------------------------------------
    pm_tb_env_u-@6:
    pm_tb_env_u
    e_path:sys.pm_tb_env
    hdl_path:~/pm_tb
    ----------------------------------------
    ----------------------------------------
    sys-@0:
    sys
    e_path:sys
    hdl_path:
    ----------------------------------------

  8. This script can be improved to output a better report doing the following:
    The output is not sorted. The way specman prints it to the log file is the one printed to the report.
    The specman e-log contains much more information than the unit tree, which is reported presently by the script. All kind of ports are listed: such as event, bit and method ports.



  9. go to the script e_tree script

  10. Note that the HDL path of each unit is shown in the report. Also note that the HDL path can be printed per each unit, using the following:
    p sys.env.full_hdl_path()

  11. I have an improved version of the script. From the very same info I colloect:
    unit name, e path, hdl path, driver type and enclosing unit. The last two are for sequence drivers. The data is sorted in a complex way. First it is sorted by the hierarchy depth. Next for same level of hierarchy units, e path based sort is used.

    if($ARGV[0] eq "c") {
      #complex sort
      #unit e_path hdl_path driver_type enclosing_env
      @as = sort {
        &hier_level($a, $a_level);
        &hier_level($b, $b_level);
        if   ($a_level > $b_level) {return  1;}
        elsif($a_level < $b_level) {return -1;}
        else {
          return $a cmp $b;
        }
      } @a;
      print("\n\ntree report\n");
      print("===========================================================\n");
      foreach $j ( @as ) {
      ...



 

  ...


I would be happy to offer my services. Call ASAP !


Home

Download Area

How to grep all loaded file in specman or ncsim.


VHDL SD slave CRC16 RTL.






Search This Site


Feedback This Site




new pages on this site