Skip to content

Generated clock liberty bug fix#34

Merged
akashlevy merged 3 commits intomainfrom
genclk
Jan 28, 2026
Merged

Generated clock liberty bug fix#34
akashlevy merged 3 commits intomainfrom
genclk

Conversation

@stanminlee
Copy link

@stanminlee stanminlee commented Jan 27, 2026

Generated clock liberty fixes

One area of code is not covered at all when handling liberty defined macros, leads to no logging of data structure for generated clocks.

Therefore, created helper function and populated relevant areas


Important

Introduces makeGeneratedClocks in VerilogReader to handle generated clocks, improving code modularity by refactoring existing logic in makeModuleInstNetwork and makeLibertyInst.

  • Behavior:
    • Adds makeGeneratedClocks function in VerilogReader to map clock pin paths to liberty cells for generated clocks.
    • Calls makeGeneratedClocks in makeModuleInstNetwork and makeLibertyInst to handle generated clocks.
  • Code Refactoring:
    • Removes inline generated clock handling logic from makeLibertyInst and makeModuleInstNetwork.
  • Misc:
    • Updates VerilogReader.hh to declare makeGeneratedClocks.

This description was created by Ellipsis for 945aa18. You can customize this summary. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 77785f8 in 22 seconds. Click for details.
  • Reviewed 83 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_pnuM4x9K4eEKjGRm

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@greptile-apps
Copy link

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

This PR refactors generated clock handling by extracting duplicated logic into a helper function makeGeneratedClocks and adding a missing call in makeModuleInstNetwork.

Key Changes:

  • Created makeGeneratedClocks helper function that processes Liberty-defined generated clocks
  • Added generated clock handling to makeModuleInstNetwork (previously missing)
  • Maintained existing call in makeLibertyInst
  • Fixed variable scoping: moved inst_path declaration inside loop to prevent incorrect path reuse across multiple generated clocks

Impact:

  • Generated clocks from Liberty macros are now properly logged for module instances
  • Eliminates code duplication between the two instantiation paths
  • Improves correctness when multiple generated clocks exist per cell

Confidence Score: 4/5

  • Safe to merge with minor documentation improvement recommended
  • Code refactoring is well-executed with proper function extraction and improved variable scoping. The missing generated clock handling in makeModuleInstNetwork is now addressed. Only minor issue is missing function documentation per project standards.
  • No files require special attention beyond adding the suggested function comment

Important Files Changed

Filename Overview
verilog/VerilogReader.cc Extracted generated clock handling logic into helper function and fixed variable scoping bug
verilog/VerilogReader.hh Added helper function declaration for makeGeneratedClocks

Sequence Diagram

sequenceDiagram
    participant VR as VerilogReader
    participant Net as Network
    participant LC as LibertyCell
    
    alt Module Instance Path
        VR->>VR: makeModuleInstNetwork()
        VR->>Net: makeInstance(cell, name, parent)
        VR->>VR: makeGeneratedClocks(lib_cell, inst)
    else Liberty Instance Path
        VR->>VR: makeLibertyInst()
        VR->>Net: makeInstance(cell, name, parent)
        VR->>VR: makeGeneratedClocks(lib_cell, inst)
    end
    
    VR->>LC: generatedClocks()
    LC-->>VR: clock list
    
    loop for each GeneratedClock
        VR->>Net: pathName(inst)
        Net-->>VR: original_inst_path
        VR->>VR: strip top-level prefix
        VR->>LC: masterPin()
        LC-->>VR: pin name
        VR->>VR: construct pinPath
        VR->>Net: addGeneratedClockPinToCell(pinPath, lib_cell)
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed 945aa18 in 37 seconds. Click for details.
  • Reviewed 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_f0awlDDfUiMbjmYb

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@akashlevy akashlevy merged commit 9a50179 into main Jan 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants