• 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. Regular Expressions

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 142
  • Views 10786
  • 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

Regular Expressions

Serjik
Serjik over 8 years ago

Hi all,

Can anyone help to solve the problem ?

I've got a library (shem) with lots of cells. Each cell contain schematic view and a symbol. If the name of the cell begins with "dff" or "lat" i need to run df procedure, if it doesn't, i have to run pn procedure. But i stuck with regular expressions for that.

Here is the code:

l=ddGetObj( "shem")~>cells
v = listToVector( l)
for( i 0 (length( l)-1) ddGetObjName( v[i])
    case(ddGetObjName( v[i])
        (rexMatchp("^dff*")
        df( ddGetObjName( v[i])))
        (rexMatchp("^lat*")
        df( ddGetObjName( v[i])))
        (t
        pn( ddGetObjName( v[i])))
);case
);for


df and pn procedures use cellName as a parametre.

Maybe there is anothe wey to get cellNames from the library ?

containce
containce
containce
containce
containce
  • Cancel
  • ebecheto
    ebecheto over 8 years ago

    Is that whyat you are looking for ?


    _______________

    ;; copyleft ebecheto
    
    ;pattern=".*_sim"
    ;pattern;=> ".*_sim"
    ;(setq libNames ddGetLibList()~>name)
    ;(setq libNames '("analogLib"))
    
    defun(rexFindCell (@optional (pattern ".*_sim") (libNames ddGetLibList()~>name))
    " commentary "
    let( (ddLibs)
    unless(listp(libNames) libNames=list(libNames))
    ddLibs=setof(dd ddGetLibList() member(dd~>name libNames))
    assocLib=foreach(mapcan dd ddLibs foreach(mapcan cc dd~>cells list(list(dd~>name cc~>name))))
    ; lib_cell=nth(3 assocLib);=> ("analogLib" "xfmr")
    remove(nil foreach(mapcar lib_cell assocLib
    if(rexMatchp(pattern cadr(lib_cell)) then lib_cell else nil)
    ))))
    
    ;; _USAGE_
    ;; rexFindCell(".*_sim")
    ;; rexFindCell("^mos" '("PRIMLIB" "analogLib"))
    ;; rexFindCell("cap$"  "analogLib")
    ;; rexFindCell("^simu_" )
    printf("rexFindCell(\"^mos\" '(\"PRIMLIB\" \"analogLib\"));<== search in lib for cells starting by nmos\n")
    printf("rexFindCell(\"^simu\"));<== search cells starting with simu in all libraries\n")
    printf("rexFindCell(\"cap$\"  \"analogLib\");<== searching in one lib for cell ending with name cap\n")
    

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ebecheto
    ebecheto over 8 years ago
    sorry i read your question too fast. Your bug is : PUT A DOT BEFFORE STAR
    ^dff.*
    ^lat.*
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 8 years ago

    Hi Serjik,

    You can iterate directly over lists in SKILL using foreach, it is very powerful and convenient, here's an example:

    
    let( (namePat)
      namePat = pcreCompile("^(dff|lat)") ;; name begins with either 'dff' or 'lat'
      foreach(cell ddGetObj("shem")~>cells
        when(pcreExecute(namePat cell~>name)
          ;; do your processing here
        ): when
      ); foreach
    ); let
    

    Hopefully this is what you are looking for?

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Serjik
    Serjik over 8 years ago

    Thanks to everybody.
    Now it great.

    • 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