The CDC API

This Document describes the "Clock Domain Analyzer" extension to the "Database API". This API provides commands to get information about clock domains and clock domain crossings.

The following commands are available:

Initialize

$db cdc new

$db cdc new $top ?-skipundriven? ?-cmpr? ?-skipless <int>?

The Clock Domain Analyzer API needs to be initialize to a top level module. During this initialization some options can be specified. This command will return a reference to the CDC in-memory structure later referred to as $cdc.

The following options are available:

$top

The OID of the top level module.

-skipundriven

The clock domain search will stop with an error message if it finds any undriven clock signal. Use this option to ignore such errors.

-cmpr

Comprehensive Mode: collects all possible clock domain sources for all FFs rather than trying to estimate the clock domain sources. As this will slow down the process and may create complex results it should be only enabled if clock domain violations are expected. As an advantage a list of all found clock domain crossings is created below the clock domain list.

-skipless <int>

Skip clock domains with less FFs than…​: this option can be used to ignore small clock domains (e.g. asynchronous Flip-Flops).

Example
set cdc [$db cdc new $top]

Get Clock Domain Information

$cdc getDomainCount

$cdc getDomainCount

Get the number of clock domains.

Example
$cdc getDomainCount

$cdc getDomainList

$cdc getDomainList ?-incr? ?-decr?

Get list of clock domain indices, sorted by number of contained clockPins.

The following options are available:

-incr

Sort the result in increasing order ("smallest" items first).

-decr

Sort the result in decreasing order ("largest" items first).

Example
set domains [$cdc getDomainList]

Get Clock Domain Details

$cdc getSrc

$cdc getSrc $domainIdx

Get clock source driver pin/port for given clock domain index.

The following options are available:

$domainIdx

The clock domain index.

Example
set domainIdx [lindex $domains 0]
      set clkSrc    [$cdc getSrc $domainIdx]

$cdc getAllSources

$cdc getAllSources $domainIdx

Get all clock source driver pins/ports for given clock domain index.

The following options are available:

$domainIdx

The clock domain index.

Example
set domainIdx  [lindex $domains 0]
      set clkSources [$cdc getAllSources $domainIdx]

$cdc getClkPinList

$cdc getClkPinList $domainIdx

Get list of clock pins for given clock domain index.

The following options are available:

$domainIdx

The clock domain index.

Example
set clkPinList [$cdc getClkPinList $domainIdx]

$cdc getClkPinCount

$cdc getClkPinCount $domainIdx

Get the number of physical clock pins for given clock domain index.

The following options are available:

$domainIdx

The clock domain index.

Example
set clkPinCount [$cdc getClkPinCount $domainIdx]

$cdc getReducedClkPinList

$cdc getReducedClkPinList $domainIdx

Get reduced list of clock pins for given clock domain index for each hierarchy level only one clock pin connected to one clock net is returned.

The following options are available:

$domainIdx

The clock domain index.

Example
set redClkPinList [$cdc getReducedClkPinList $domainIdx]

$cdc getTreeList

$cdc getTreeList $domainIdx ?-nocache? ?-skipcontrollogic?

Get cone to all clock pins for one clock domain.

The following options are available:

$domainIdx

The clock domain index.

-nocache

Do not use a previously calculated clock domain, force the recalculation of the clock domain structure.

-skipcontrollogic

Skip control logic.

Example
set clkTree [$cdc getTreeList $domainIdx]

$cdc getReducedTreeList

$cdc getReducedTreeList $domainIdx ?-nocache? ?-skipcontrollogic?

Get reduced cone for one clock domain (see getReducedClkPinList).

The following options are available:

$domainIdx

The clock domain index.

-nocache

Do not use a previously calculated clock domain, force the recalculation of the clock domain structure.

-skipcontrollogic

Skip control logic.

Example
set clkTree [$cdc getReducedTreeList $domainIdx]

$cdc getClkPinDomains

$cdc getClkPinDomains $clkPinOid

Get list of clock source drivers (domains) for given clock pin.

The following options are available:

$clkPinOid

The clock pin OID.

Example
set clkPin    [lindex $clkPinList 0]
      set clkDomain [$cdc getClkPinDomains $clkPin]

$cdc getTreeCrossCount

$cdc getTreeCrossCount

Get number of clock tree crossings.

Example
$cdc getTreeCrossCount

$cdc getTreeCrossList

$cdc getTreeCrossList ?-incr? ?-decr? ?-srcincr? ?-srcdecr?

Get list of tree crossings indices, sorted by number of contained clk pins or clkSrc pins.

The following options are available:

-incr

Sort the result in increasing order ("smallest" items first).

-decr

Sort the result in decreasing order ("largest" items first).

-srcincr

Sort the result in increasing order of the clock source pins.

-srcdecr

Sort the result in decreasing order of the clock source pins.

Example
set treeCrossList [$cdc getTreeCrossList]

$cdc getTreeCrossSrcList

$cdc getTreeCrossSrcList $crossIdx

Get list of clock source driver for one tree crossing.

The following options are available:

$crossIdx

Tree crossing index.

Example
set crossIdx [lindex $treeCrossList 0]
      if {$crossIdx != {}} {
          $cdc getTreeCrossSrcList $crossIdx
      }

$cdc getTreeCrossClkPinList

$cdc getTreeCrossClkPinList $crossIdx

Get list of clock pins which are clocked by the multiple clock sources return by getTreeCrossSrcList.

The following options are available:

$crossIdx

Tree crossing index.

Example
if {$crossIdx != {}} {
          $cdc getTreeCrossClkPinList $crossIdx
      }

$cdc getTreeCrossCone

$cdc getTreeCrossCone $crossIdx

Get the cone with the tree crossing.

The following options are available:

$crossIdx

Tree crossing index.

Example
if {$crossIdx != {}} {
          $cdc getTreeCrossCone $crossIdx
      }

Get Clock Domain Crossings

$cdc calcDomainCross

$cdc calcDomainCross ?-removedrs? ?$domainIdxList?

Generate data structures and return domainCrossCount.

The following options are available:

-removedrs

Remove Dual-Rank-Synchronizer.

$domainIdxList

The list of clock domain indices.

Example
$cdc calcDomainCross

$cdc getDomainCrossCount

$cdc getDomainCrossCount

Get number of domain crossings.

Example
$cdc getDomainCrossCount

$cdc getDomainCrossList

$cdc getDomainCrossList ?-incr? ?-decr?

Get list of domain crossings indices, sorted by number of contained clk pins.

The following options are available:

-incr

Sort the result in increasing order ("smallest" items first).

-decr

Sort the result in decreasing order ("largest" items first).

Example
set domainCrossList [$cdc getDomainCrossList]

$cdc getDomainCrossDomainPair

$cdc getDomainCrossDomainPair $domainCrossIdx

Get list of clock source driver for one domain crossing.

The following options are available:

$domainCrossIdx

Index of the domain crossing.

Example
set domainCrossIdx [lindex $domainCrossList 0]
      $cdc getDomainCrossDomainPair $domainCrossIdx

$cdc getDomainCrossTrgList

$cdc getDomainCrossTrgList $domainCrossIdx

Get target list for given domain crossing.

The following options are available:

$domainCrossIdx

Index of the domain crossing.

Example
$cdc getDomainCrossTrgList $domainCrossIdx

$cdc getDomainCrossCone

$cdc getDomainCrossCone $domainCrossIdx

Get cone for given domain crossing.

The following options are available:

$domainCrossIdx

Index of the domain crossing.

Example
$cdc getDomainCrossCone $domainCrossIdx

Finalize

$cdc free

$cdc free

The free command can be used to clear all internal data structures.

Example
$cdc free