• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Digital Implementation
  3. command to list only the flops in the design

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 93
  • Views 14010
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

command to list only the flops in the design

ssuhas
ssuhas over 14 years ago

Hi,

Can anyone let me know how do we list only the flops in the design using encounter.

And also In case I want to list the buffers , Inverters etc. How do we do so?

 Thanks

  • Cancel
  • kazad
    kazad over 14 years ago

    Here is a procedure you can try:

    Usage:

    findFlop * => To list all flops

    findFlop *a/b/c*reg* => To serach for specific flop pattern

     proc findFlop {flopPattern} {

        set flopList {}

        foreach instPtr [dbGet top.insts] {
            set cellPtr [dbInstCell $instPtr]
            if {[dbIsCellStdCell $cellPtr] && [dbIsCellSequential $cellPtr] && ![dbIsCellLatch $cellPtr] && \
                    ![isCellClockGating $cellPtr] && [string match $flopPattern $cellPtr]} {
                lappend flopList [dbInstName $instPtr]
            }
        }
        return $flopList
    }

    # Procedure to find buffers in the design
    proc findBuffer {bufPattern} {

        set bufList {}

        foreach instPtr [dbGet top.insts] {
            set cellPtr [dbInstCell $instPtr]
            if {[dbIsCellStdCell [dbInstCell $instPtr]] && [dbIsCellBuffer $cellPtr] && [string match $bufPattern $cellPtr]} {
                lappend bufList [dbInstName $instPtr]
            }
        }
        return $bufList
    }

    # Procedure to find inverters in the design
    proc findInverter {invPattern} {

        set invList {}

        foreach instPtr [dbGet top.insts] {
            set cellPtr [dbInstCell $instPtr]
            if {[dbIsCellStdCell [dbInstCell $instPtr]] && [dbIsCellInverter $cellPtr] && [string match $invPattern $cellPtr]} {
                lappend invList [dbInstName $instPtr]
            }
        }
        return $invList
    }

    Thanks

    Khandaker

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kazad
    kazad over 14 years ago

    Fixed the bug .. here are the updated procedures:

    # Procedure to find flops in the design
    proc findFlop {flopPattern} {
       
        set flopList {}

        foreach instPtr [dbGet top.insts] {
     set cellPtr [dbInstCell $instPtr]
     if {[dbIsCellStdCell $cellPtr] && [dbIsCellSequential $cellPtr] && ![dbIsCellLatch $cellPtr] && \
      ![isCellClockGating $cellPtr] && [string match $flopPattern [dbInstName $instPtr]]} {
         lappend flopList [dbInstName $instPtr]
     }
        }
        return $flopList
    }

    # Procedure to find buffers in the design
    proc findBuffer {bufPattern} {
       
        set bufList {}

        foreach instPtr [dbGet top.insts] {
     set cellPtr [dbInstCell $instPtr]
     if {[dbIsCellStdCell [dbInstCell $instPtr]] && [dbIsCellBuffer $cellPtr] && [string match $bufPattern [dbInstName $instPtr]]} {
         lappend bufList [dbInstName $instPtr]
     }
        }
        return $bufList
    }

    # Procedure to find inverters in the design
    proc findInverter {invPattern} {
       
        set invList {}

        foreach instPtr [dbGet top.insts] {
     set cellPtr [dbInstCell $instPtr]
     if {[dbIsCellStdCell [dbInstCell $instPtr]] && [dbIsCellInverter $cellPtr] && [string match $invPattern [dbInstName $instPtr]]} {
         lappend invList [dbInstName $instPtr]
     }
        }
        return $invList
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kazad
    kazad over 14 years ago

    Fixed the bug .. here are the updated procedures:

    # Procedure to find flops in the design
    proc findFlop {flopPattern} {
       
        set flopList {}

        foreach instPtr [dbGet top.insts] {
     set cellPtr [dbInstCell $instPtr]
     if {[dbIsCellStdCell $cellPtr] && [dbIsCellSequential $cellPtr] && ![dbIsCellLatch $cellPtr] && \
      ![isCellClockGating $cellPtr] && [string match $flopPattern [dbInstName $instPtr]]} {
         lappend flopList [dbInstName $instPtr]
     }
        }
        return $flopList
    }

    # Procedure to find buffers in the design
    proc findBuffer {bufPattern} {
       
        set bufList {}

        foreach instPtr [dbGet top.insts] {
     set cellPtr [dbInstCell $instPtr]
     if {[dbIsCellStdCell [dbInstCell $instPtr]] && [dbIsCellBuffer $cellPtr] && [string match $bufPattern [dbInstName $instPtr]]} {
         lappend bufList [dbInstName $instPtr]
     }
        }
        return $bufList
    }

    # Procedure to find inverters in the design
    proc findInverter {invPattern} {
       
        set invList {}

        foreach instPtr [dbGet top.insts] {
     set cellPtr [dbInstCell $instPtr]
     if {[dbIsCellStdCell [dbInstCell $instPtr]] && [dbIsCellInverter $cellPtr] && [string match $invPattern [dbInstName $instPtr]]} {
         lappend invList [dbInstName $instPtr]
     }
        }
        return $invList
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information