• 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. How should I use skill code to get the mapping between instanceName...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 6136
  • 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

How should I use skill code to get the mapping between instanceName and its terminalName and netName

xingz311
xingz311 over 2 years ago
How should I use skill code to get the mapping between instanceName  and its terminalName and netName

return like:
map["I15<0>"]["is_500nA<4>"] = "is_500nA_VMC_C<2>"

sch:

  • Cancel
Parents
  • AurelBuche
    AurelBuche over 2 years ago

    Hello,

    This seems like a simple problem to address but the answer is not as simple as it looks!

    I rewrote a code snippet from older scripts I had, if someone have a simpler solution please share it!

    Code is below, it is written in SKILL++ and defines only get_inst_term_net function to be used like :
    (get_inst_term_net (geGetEditCellView) "I15<0>" "is_500nA<4>")

    Hope this helps, don't hesitate to give feedback in case you face any issue or notice a bug

    Aurel

    browse_nets.ils

    (inScheme
    (let ((bus_pcre (pcreCompile "(\\w+)<(\\d+)>")))
    
      (defun parse_name_with_bit (name_with_bit "t")
        "Return separated name and bit from NAME_WITH_BIT"
        (assert (pcreMatchp bus_pcre name_with_bit) "Unable to find name and bit in %s" name_with_bit)
        (list (pcreSubstitute "\\1") (atoi (pcreSubstitute "\\2"))))
    
      (defun get_term_by_name (inst name "dt")
        "Return INST terminal named NAME"
        (car (exists term inst->conns (pcreMatchp (strcat "^" name "<\\d+(:\\d+)?>$") term->name))))
    
      (defun find_mem_conn_by_name (inst term_name_with_bit "dt")
        "Return INST terminal and index associated to TERM_NAME_WITH_BIT"
        (destructuringBind (term_name term_bit) (or (parse_name_with_bit term_name_with_bit)
                                                    (error "Unable to find terminal %s in %A" term_name_with_bit inst->name))
          (letseq ((term  (get_term_by_name inst term_name))
                   (index (sub1 (lindex (dbProduceMemName term->name) term_name_with_bit)))
                   )
            (when index (list term index))
            )))
    
      (defglobalfun get_inst_term_net (cv inst_name_with_bit term_name_with_bit "dtt")
      "Return signal associated to INST_NAME_WITH_BIT TERM_NAME_WITH_BIT in CV
    Example (get_inst_term_net (geGetEditCellView) \"I<12>\" \"OUT<3>\") -> \"CONNECTED_NET\""
      ;; -------------------------------------------------------
      ;; In this code, we differenciate bit and index:
      ;; - bit is given in name (i.e. in "I<12>" bit is 12)
      ;; - index is the bit position in bus
      ;;   (i.e. in "I<27:12>" bit 27 is at index 0,
      ;;   bit 12 at index 15 and bit 20 at index 7) 
      ;; -------------------------------------------------------
      ;; Find instance index, it is given directly by `dbFindMemInstByName'
      (destructuringBind (inst inst_index) (or (dbFindMemInstByName cv inst_name_with_bit)
                                               (error "Unable to find instance %s in %s/%s/%s"
                                                      inst_name_with_bit cv->libName cv->cellName cv->viewName))
        ;; Find term bit
        (destructuringBind (term term_index) (or (find_mem_conn_by_name inst term_name_with_bit)
                                                 (error "Unable to find terminal %s in instance %s in %s/%s/%s"
                                                        term_name_with_bit inst_name_with_bit cv->libName cv->cellName cv->viewName))
          (let ((signal_index (dbGetNameNumBit term->name)*inst_index + term_index))
            (nth signal_index term->net->signals)->name
            ))))
    
      )); Scheme closure
    
    
    ;(get_inst_term_net (geGetEditCellView) "DUT<20>" "OUT<1>")
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • AurelBuche
    AurelBuche over 2 years ago

    Hello,

    This seems like a simple problem to address but the answer is not as simple as it looks!

    I rewrote a code snippet from older scripts I had, if someone have a simpler solution please share it!

    Code is below, it is written in SKILL++ and defines only get_inst_term_net function to be used like :
    (get_inst_term_net (geGetEditCellView) "I15<0>" "is_500nA<4>")

    Hope this helps, don't hesitate to give feedback in case you face any issue or notice a bug

    Aurel

    browse_nets.ils

    (inScheme
    (let ((bus_pcre (pcreCompile "(\\w+)<(\\d+)>")))
    
      (defun parse_name_with_bit (name_with_bit "t")
        "Return separated name and bit from NAME_WITH_BIT"
        (assert (pcreMatchp bus_pcre name_with_bit) "Unable to find name and bit in %s" name_with_bit)
        (list (pcreSubstitute "\\1") (atoi (pcreSubstitute "\\2"))))
    
      (defun get_term_by_name (inst name "dt")
        "Return INST terminal named NAME"
        (car (exists term inst->conns (pcreMatchp (strcat "^" name "<\\d+(:\\d+)?>$") term->name))))
    
      (defun find_mem_conn_by_name (inst term_name_with_bit "dt")
        "Return INST terminal and index associated to TERM_NAME_WITH_BIT"
        (destructuringBind (term_name term_bit) (or (parse_name_with_bit term_name_with_bit)
                                                    (error "Unable to find terminal %s in %A" term_name_with_bit inst->name))
          (letseq ((term  (get_term_by_name inst term_name))
                   (index (sub1 (lindex (dbProduceMemName term->name) term_name_with_bit)))
                   )
            (when index (list term index))
            )))
    
      (defglobalfun get_inst_term_net (cv inst_name_with_bit term_name_with_bit "dtt")
      "Return signal associated to INST_NAME_WITH_BIT TERM_NAME_WITH_BIT in CV
    Example (get_inst_term_net (geGetEditCellView) \"I<12>\" \"OUT<3>\") -> \"CONNECTED_NET\""
      ;; -------------------------------------------------------
      ;; In this code, we differenciate bit and index:
      ;; - bit is given in name (i.e. in "I<12>" bit is 12)
      ;; - index is the bit position in bus
      ;;   (i.e. in "I<27:12>" bit 27 is at index 0,
      ;;   bit 12 at index 15 and bit 20 at index 7) 
      ;; -------------------------------------------------------
      ;; Find instance index, it is given directly by `dbFindMemInstByName'
      (destructuringBind (inst inst_index) (or (dbFindMemInstByName cv inst_name_with_bit)
                                               (error "Unable to find instance %s in %s/%s/%s"
                                                      inst_name_with_bit cv->libName cv->cellName cv->viewName))
        ;; Find term bit
        (destructuringBind (term term_index) (or (find_mem_conn_by_name inst term_name_with_bit)
                                                 (error "Unable to find terminal %s in instance %s in %s/%s/%s"
                                                        term_name_with_bit inst_name_with_bit cv->libName cv->cellName cv->viewName))
          (let ((signal_index (dbGetNameNumBit term->name)*inst_index + term_index))
            (nth signal_index term->net->signals)->name
            ))))
    
      )); Scheme closure
    
    
    ;(get_inst_term_net (geGetEditCellView) "DUT<20>" "OUT<1>")
    
    • Cancel
    • Vote Up 0 Vote Down
    • 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