• 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. Custom IC SKILL
  3. Skill code for saving the content of a notes block in a...

Stats

  • Replies 2
  • Subscribers 143
  • Views 653
  • Members are here 0

Skill code for saving the content of a notes block in a schematic to a file?

StephanWeber
StephanWeber 1 month ago

Hi,

I tried Grok AI to make some skill code for this task, but it failed.

I have some note blocks in my schematic (just pure descriptions), and I want to pick the one with starting with string "Key" into a text file.

However, the skill code fails to get even any notes block. 

I am using ic 23.10.130.

The code to find notes (and more, just for debugging) is this:

; Check available collections
      let( (notes labels annotations figs text schText textDisplay shapes dbObjects)
        notes = cv~>notes || nil
        labels = cv~>labels || nil
        annotations = cv~>annotations || nil
        figs = cv~>figs || nil
        text = cv~>text || nil
        schText = cv~>schText || nil
        textDisplay = cv~>textDisplay || nil
        shapes = cv~>shapes || nil
        dbObjects = cv~>dbObjects || nil
        printf("Total notes in schematic: %d\n" length(notes))
        printf("Total labels in schematic: %d\n" length(labels))
        printf("Total annotations in schematic: %d\n" length(annotations))
        printf("Total figures in schematic: %d\n" length(figs))
        printf("Total text objects in schematic: %d\n" length(text))
        printf("Total schText objects in schematic: %d\n" length(schText))
        printf("Total textDisplay objects in schematic: %d\n" length(textDisplay))
        printf("Total shapes in schematic: %d\n" length(shapes))
        printf("Total dbObjects in schematic: %d\n" length(dbObjects))
       

But in CIW I get number of notes is zero.

So I think the key issue is that finding the notes should be done differently.

Inital code was this:

; Open the cell view
      cv = dbOpenCellViewByType(libName cellName viewName viewType "r")
      if(cv then
        printf("Schematic %s/%s/%s successfully opened.\n" libName cellName viewName)
      else
        error("Cannot open cell view %s/%s/%s" libName cellName viewName)
      )
      
      ; Check for notes and labels
      let( (notes labels)
        notes = cv~>notes

BTW, my intention is to collect all key specifications in our IP blocks for documentation purposes. So the next step would be to get a top-cell and dive down in hierarchy.

Bye Stephan

  • Sign in to reply
  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett 1 month ago

    Stephan,

    The dangers of using LLMs to write code... this has so many issues that you'll spend longer fixing it than writing from scratch.

    procedure(CCFwriteNotes(fileName @key (cv geGetEditCellView()) pattern)
      let(((pat pattern && pcreCompile(pattern)) port)
        port=outfile(fileName)
        unless(port
          error("Could not write file %L\n" fileName)
        )
        foreach(shape cv~>shapes
          when(shape~>objType=="label" && shape~>layerName=="text"
            when(!pat || pcreExecute(pat shape~>theLabel)
              fprintf(port "%s\n" shape~>theLabel)
            )
          )
        )
        close(port)
      )
    )

    Then you can use CCFwriteNotes("./notes.txt" ?pattern "^Key") ; if you specify a pattern, it's the regular expression to match the text. Without ?pattern it writes all note text.

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • StephanWeber
    StephanWeber 1 month ago in reply to Andrew Beckett

    Works like a charm!! Extended it (with AI) to check the whole hierarchy and for multiple keywords.

    It can help me and all analog designers a lot. The only great improvement would be the ability to have nicer tables instead of only pure text note blocks. This is because often we need tables e.g. to define a trimming table, the DFT logic or the operating modes of an IP.

    If I want to re-use an analog circuit IP, I inspect always the schematic, and having hints and knowing the key parameters, such as gain, Idd, Vdd range, etc. is super-helpful. But we need this also in our general IP documentation, like in a Word document, for different review presentations, etc. For me the most native starting point is always "Cadence". Just because at the end, what is in a Word doc or ppt can be easily outdated, e.g. because I extended the trim bus by one bit or someone decides the default gain is 0.5V/A not 0.533V/A, etc.

    Bye Stephan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • StephanWeber
    StephanWeber 1 month ago in reply to Andrew Beckett

    Works like a charm!! Extended it (with AI) to check the whole hierarchy and for multiple keywords.

    It can help me and all analog designers a lot. The only great improvement would be the ability to have nicer tables instead of only pure text note blocks. This is because often we need tables e.g. to define a trimming table, the DFT logic or the operating modes of an IP.

    If I want to re-use an analog circuit IP, I inspect always the schematic, and having hints and knowing the key parameters, such as gain, Idd, Vdd range, etc. is super-helpful. But we need this also in our general IP documentation, like in a Word document, for different review presentations, etc. For me the most native starting point is always "Cadence". Just because at the end, what is in a Word doc or ppt can be easily outdated, e.g. because I extended the trim bus by one bit or someone decides the default gain is 0.5V/A not 0.533V/A, etc.

    Bye Stephan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

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