HierarchySurfer2

The unholy union of HS and HSV



HS2 is a Perl (v5.x!) script that analyzes a set of Verilog or VHDL source files in order to derive their hierarchy. After the source files are parsed and the hierarchy is determined, various tool scripts are generated as well as a report on the hierarchy. Also, a detailed report file is generated to give you more information about the designs that HS2 found. The current version is v2.26.1 released on 9/12/0.
 
This is the page to:

Work under consideration:
  • Radical changes to the SHF files
  • Template synthesis scripts based on the ports.
  • An API to allow user access to the HS2 data structures... Some day...

  • Latest Release Info

    v2.26.1, Now, more than before

    This will work on WinDOS NT now. Also some bug and reporting fixes.  A few new options also.

    Here is an executive summary of what is new in this release:

    Known Problems: What was not done in time for this release
    back to the top


    HierarchySurfer2 Documentation

    What is HierarchySurfer2

    HS2 is a Perl script that analyzes a set of VHDL or Verilog source files in order to derive their hierarchy. After the source files are analyzed, various tool scripts are generated as well as a report on the hierarchy of the source. Also, a detailed report file is generated to give you more information about the designs that HS found.

    Why use HierarchySurfer2

    HS2 greatly reduces your "time to tool" (TTT) by automating the boring and error prone tasks of figuring out a design's hierarchy and building scripts to get that design into your tool!

    How to use HierarchySurfer2

    Basically, all you have to do is tell HS2 in what directories the source files reside and what the extensions are for the source files.

    The defaults are:

  • source directory is the current directory.
  • The source code is VHDL, use the '-l Verilog' command line option to surf Verilog.
  • The default source code extention is 'v' for Verilog and 'vhd' for VHDL.
  • Here is an example of looking in two directories for two different file extensions:

    HS2 -d ~erik/source/vhdl /home/carlw/testcases -e vhd hdl

    Of course, the Perl interpreter must be installed on your UNIX system. HS2 will only run under Perl5. You can get Perl from one of the Perl homepages, like this one http://perl.com/perl/index.html

    Switches and such

    Here are the major switches, as far as you know... A final word of caution, there are a number of hidden switches. I suggest that you don't play with these. They won't add any value, and they well might screw you up. Best leave well enough alone...

    Scripts and Outputs

    The real reason to use HS2 is to get the scripts and reports that it creates.

    In VHDL mode, each top level design gets the following scripts:

    Also, if you don't have explicit configuration files but want them, HS2 will create them for you when it is invoked with the "-w" switch. If there is one explicit configuration already for the entity/architecture pair and there is only one architecture, then the "-w" switch will do nothing!

    In Verilog mode, each top level design gets:

    Runtime Outputs

    As the program runs, it trys to tell what it is doing. Basically there are five steps:
    1. Set up and check for files to parse
    2. Parse the files
    3. Merge design unit information
    4. Build the hierarchy (s)
    5. Output the scripts and reports
    Also, HS2 spits out exception infomation as it is detected. For example, if an entity or module is found twice amongst the source file, HS2 spits out a message right away so you can kill it and fix the problem.

    VHDL Configuration Handling

    HS2 uses configurations to help build the design hierarchy. They are lumped into two catagories: explicit and implicit. An explicit configuration is one that is contained in a configuration statement. An implicit one is just the existance of an architecture for a given entity.

    HS2 will only "succeed" and produce scripts if every entity in all the source files has one and only one valid configuration. This occurs in the following cases:

    1. A single explicit configuration and any number of implicit configurations.

    2. A single implicit configuration and no explicit configurations.

    Any other case is not "clean" so HS2 can't determine the hierarchy automatically. If this happens, HS2 will spit out the offending entitys and any files that contain configurations.

    One common occurance is many implicit configurations. If this happens, re-run HS2 with the "-w" switch and it will write an explicit configuration file for every implicit one. Then you can delete all the one that you don't want and run HS once more to build the hierarchy.

    A common technique when there are more than one explicit configurations is to move all but the desired file to another extension, like "erik.vhd.other". In this way, HS2 won't find and parse that file.

    Like the rest of our synthesis tools, configurations are only supported for one level of entity/architecture mapping.

    Hierarchy VHDL Error Reporting

    Most of the errors that HS2 finds fall into two catagories: configuration errors, entity error. A good rule of thumb to remember when trying to surf some source is:
    "An entity can only appear once in a set of source files, and each entity can have only one valid configuration"
    When HS2 detects an error, it whines about it, and trys to provide some information about the error. Frankly, the error reporting is not that good, but it should be enough to help find and fix the problem. If an error is detected, no scripts are produced.

    HS2 also attempts to detect when components are "missing". This could mean that you did not include all the source files in the surf path. It could also mean that the component is contained in a package that HS2 did not surf. These are only warnings, not errors, so scripts are produced.

    VHDL Restrictions

    HS2 was specifically designed to not restrict the VHDL description style or the way into design units are put into files. Period. In other words, the few restrictions listed are below: Anything else should be considered a bug, until I decide it is a restriction!

    Common Questions and Answers:

    1) How does HS2 know where the top of my design is?

    a) Quite simple really, after all the entities or modules are read into the system. The information for each design unit is "merged" together. Now the design unit knows what its children are, but not who its parents are. So, for each given design unit, HS2 looks to see if it is a child of another design.  If it is not, then it is a top level design.

    2) How can HS2 know what the difference between my testbench and the top of my design?

    A) It can't! HS2 does not care if the code in the files is or is not synthesizable, it just determines the hierarchy for that code. The recommended way to work around this is to run HS2 once on your complete set of files. Look for the entity name or design file that is your top, then re-run HS2 with the "-t" followed by that top entity name.

    3) How come HierarchySurfer does not support Verilog.

    A) It does, use the -l Verilog switch.

    4) What limits are there on my coding style?

    A) HS2 was designed to have no limits, but it is a pretty hacked together set of parsers. We don't need a tool getting of the way of designers. If you find some code that is not parsed correctly, please email it to me (erik)

    5) When ha_shell elaborates the top level design, it pulls in some previous db files in my search_path, how can I stop this?

    A) This is a bug with ha_shell that will be fixed sometime. For now, you have to not let ha_shell see those db files. You can do that by: 1) removing the files, or 2) removing their location from your search_path variable.

    6) Does HS2 produce make files?

    A) For VHDL simulation analyze, it does. The makefile produced is a very programmable description of how to build a simulation model. Try it, you might likeit!

    back to the top


    Bugs, enhancements, and questions

    Write your bug reports, enhancement requests and questions on the back of a $100 bill and send it to me at erik@synopsys.com Remember, HS2 is free, and you get what you pay for!!
    back to the top