• 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. No of Logic Levels in EDI

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 92
  • Views 13141
  • 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

No of Logic Levels in EDI

BhTeja
BhTeja over 14 years ago

Is there any command to find out No of Logic levels in EDI..

 

  • Cancel
  • kazad
    kazad over 14 years ago

    Hi BhTeja

    I use the tcl procedure 'getLogicLevel' to extract the no. of logic levels from a given set of timing points. The procedures are embedded.

    Let me know if you have any issues with the procedure.

    Thanks

    Khandaker

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

    # Procedure to generate timing slack file
    # Usage: generateSlackReport -mode <setup | hold> -slackTarget <slack_target> -file <report_file>

    proc generateSlackReport {args} {


        # Defaults
        set slackTarget 0.0


        # Get setup/hold
        if {[regexp {\-mode} $args]} {
     set analysisMode [lindex $args [expr [lsearch $args -mode] + 1]]
        }


        # Get slack target
        if {[regexp {\-slackTarget} $args]} {
     set slackTarget [lindex $args [expr [lsearch $args -slackTarget] + 1]]
        }


        # Get slack file name
        if {[regexp {\-file} $args]} {
     set slackFile [lindex $args [expr [lsearch $args -file] + 1]]
        }

     

        # Help
        set helpString "Usage : generateSlackReport \
                                    \-mode <setup | hold > \
                                    \-slackTarget <slack_target> \
                                    \-file <slack_file_name> \
                                    \-help"


        if {[regexp {\-help} $args] || $args == ""} {
     puts $helpString
     return 0
        }


        # Main code
        ############################################################

       
        # Open slack report file
        set f [open $slackFile w]


        # Set command set for setup/hold analysis
        if {$analysisMode == "setup"} {
     set rptTimingCmd {report_timing -from [all_registers -clock_pins] -to [all_registers -data_pins] -max_slack $slackTarget -late -collection}

        } elseif {$analysisMode == "hold"} {
     set rptTimingCmd {report_timing -from [all_registers -clock_pins] -to [all_registers -data_pins] -max_slack $slackTarget -early -collection}

        } else {
     puts "ERROR: Unsupported analysis mode!"
     return 0
        }

       
        # Report header
        puts $f [genLine -width 100 -char "="]
        puts $f [format "%-10s %-8s %-8s %-25s %-50s %80s" "Slack" "Level" "Skew" "Clock Domain" "Launch Point" "Capture Point"]
        puts $f [genLine -width 100 -char "="]

     

        # Create a collection of timing paths
        set timingPaths [eval $rptTimingCmd]
     
        if {[sizeof_collection $timingPaths] > 0} {
     
     # Iterate over the set of paths, and process them one at-a-time
     foreach_in_collection path [sort_collection $timingPaths {slack}] {
        
         set timingPointsColl [get_property $path timing_points]
         set logicDepth [getLogicLevel $timingPointsColl]

         set startPoint     [get_property [get_property $path launching_point] hierarchical_name]
         set endPoint       [get_property [get_property $path capturing_point] hierarchical_name]
         set launchClock    [get_property [get_property $path launching_clock] hierarchical_name]
         set captureClock   [get_property [get_property $path capturing_clock] hierarchical_name]
         set launchClkEdge  [lindex [split [get_property $path launching_clock_open_edge_type] {}] 0]
         set captureClkEdge [lindex [split [get_property $path capturing_clock_close_edge_type] {}] 0]
         set launchClockTime [expr [get_property $path launching_clock_latency] + [get_property $path launching_clock_open_edge_time]]
         set captureClockTime [expr [get_property $path capturing_clock_latency] + [get_property $path capturing_clock_close_edge_time]]
         set skew [expr $captureClockTime - $launchClockTime]
         set slack          [get_property $path slack]
        
        
         puts $f [format "%-10s %-8s %-8.2f %-25s %-50s %-80s" $slack $logicDepth $skew "${launchClock}(${launchClkEdge})->${captureClock}(${captureClkEdge})" $startPoint $endPoint]
        
     }
        }
       
        close $f
    }


    # Procedure to get logic level from a given collection of timing points
    proc getLogicLevel {timingPointsColl} {

        set currentInst ""
        set pathInstList {}
       
       
        foreach_in_collection timingPointObj $timingPointsColl {
     
     set pinObj [get_property $timingPointObj pin]
     set objType [get_property $pinObj object_type]
     
     if {$objType == "pin"} {
         set instObj [get_cell -of_objects $pinObj]
         set instName [get_property $instObj hierarchical_name]
     } else {
         set instName [get_property $pinObj hierarchical_name]
     }
     
     if {$instName != $currentInst} {
         lappend pathInstList $instName
         set currentInst $instName
     }
        }
        set logicLevel [llength $pathInstList]

        return $logicLevel
    }


    # Procedure to generate line seperator
    # Usage: genLine -width <width> -char <"character">
    proc genLine {args} {

        # Default
        set char "-"

        # Get width
        if {[regexp {\-width} $args]} {
            set width [lindex $args [expr [lsearch $args -width] + 1]]
        }

        # Get char
        if {[regexp {\-char} $args]} {
            set char [lindex $args [expr [lsearch $args -char] + 1]]
        }
       
       
        # Help
        set helpString "Usage : genLine -width <width> -char <character>"
       
        if {[regexp {\-help} $args] || $args == ""} {
     puts $helpString
     return 0
        }
       
        # Main code
        #########################################################################
     
       
        for {set i 0} {$i <= $width} {incr i} {
     lappend print_list $char
        }

        return "[join $print_list $char]"
    }

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

    Thanks Kazad.  Its working .

                   

     

    • 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