( ESNUG 346 Item 10 ) -------------------------------------------- [3/16/00]

Subject: How To Find The Number Of Instances Of Each Module Inside Of VCS

> Is there a tool using which i can find the total number of instances of a
> given module in my design?  e.g. I may be instantiating DFF's or MUX cells
> everywhere, and I need to know how many of each type are instantiated
> across the entire hierarchy.  At least VCS does not seem to print out this
> info.
>
>     - Sudheendra Hangal
>       Sun Microsystems                         Mountain View, CA


From: Paul Campbell <taniwha@taniwha.com>

You can do it through PLIs, but it's a pain.  A much simpler, low tech way
to do it is:

  1) add:

        // repeat this for all objects you want to count

        module top_count;
        integer df_count;
        initial begin
          df_count=0;
          #2 $display("%d DF flops instantiated", df_count);
        end

  2) and to the DF module (or other objects you want to count) add:

        initial #1 top_count.df_count=top_count.df_count+1;

As I said -- low tech but it works.  If your DF module is intended to be
synthesised you might want to surround the initial statement with a
"// synopsys translate_on/off" pair.

    - Paul Campbell

         ----    ----    ----    ----    ----    ----   ----

From: "Per Edstrom" <pedstrom@home.com>

An easy way to do this in VCS is to specify -Xman=0x11 to put all source
files into tokens.v.

Then: grep ^<module name> tokens.v | wc

    - Per Edstrom
      Axis



 Sign up for the DeepChip newsletter.
Email
 Read what EDA tool users really think.


Feedback About Wiretaps ESNUGs SIGN UP! Downloads Trip Reports Advertise

"Relax. This is a discussion. Anything said here is just one engineer's opinion. Email in your dissenting letter and it'll be published, too."
This Web Site Is Modified Every 2-3 Days
Copyright 1991-2024 John Cooley.  All Rights Reserved.
| Contact John Cooley | Webmaster | Legal | Feedback Form |

   !!!     "It's not a BUG,
  /o o\  /  it's a FEATURE!"
 (  >  )
  \ - / 
  _] [_     (jcooley 1991)