( 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
|
|