Thursday, November 1, 2007

Report Number of Flip Flops and Latches in Each Submodule

The Tcl script at the end of this article enables you to report the number
of flip-flops and latches in each submodule. Source the script after you
read in the design.

Here is an example of usage and output:
------------------------------------------------------------------------------

dc_shell-xg-t> source reg_count.tcl
-------------
Design Name: MUX_TOP
MUX_TOP has 0 flops
MUX_TOP has 0 latchs
MUX_TOP has 0 total registers

Design Name: BYTE_MODE
BYTE_MODE has 2 flops
BYTE_MODE has 0 latchs
BYTE_MODE has 2 total registers

Design Name: CTRL_STTS_LGIC
CTRL_STTS_LGIC has 53 flops
CTRL_STTS_LGIC has 0 latchs
CTRL_STTS_LGIC has 53 total registers

Design Name: NIBBLE_MODE
NIBBLE_MODE has 2 flops
NIBBLE_MODE has 0 latchs
NIBBLE_MODE has 2 total registers

Design Name: NEG_MODE
NEG_MODE has 4 flops
NEG_MODE has 0 latchs
NEG_MODE has 4 total registers

Design Name: SPP_FIFO
SPP_FIFO has 3 flops
SPP_FIFO has 0 latchs
SPP_FIFO has 3 total registers

Design Name: CMPTBLTY_MODE
CMPTBLTY_MODE has 2 flops
CMPTBLTY_MODE has 0 latchs
CMPTBLTY_MODE has 2 total registers

Design Name: FIFO
FIFO has 70 flops
FIFO has 0 latchs
FIFO has 70 total registers

Design Name: EPP
EPP has 4 flops
EPP has 1 latchs
EPP has 5 total registers

Design Name: ECP
ECP has 4 flops
ECP has 0 latchs
ECP has 4 total registers

Design Name: TERMN
TERMN has 3 flops
TERMN has 0 latchs
TERMN has 3 total registers

----------------------------
-- reg_count.tcl
----------------------------
foreach_in_collection cell [get_cells -hier -filter "is_hierarchical==true"] {

set des_nam [get_attribute $cell ref_name]

current_instance $cell > /tmp/null

echo "Design Name: ${des_nam}"

echo "${des_nam} has [sizeof_collection [all_registers -edge_triggered]] flops"

echo "${des_nam} has [sizeof_collection [all_registers -level_sensitive]] latchs"

echo "${des_nam} has [sizeof_collection [all_registers]] total registers"

current_instance > /tmp/null

}

----------

No comments: