• 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. Add function into rodCreatePath

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 145
  • Views 16206
  • 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

Add function into rodCreatePath

user002
user002 over 15 years ago

Hi all, I've been reading your posts for about 2 months, I'm trying to learn skill and they're very useful! thanks.

I'm asking for help here because I don't know how to do properly the next thing:

I want to add for example 100 lines of subRects with a separation of 1 to my MultiPart Path, I've created this function:

;----------------Function------------------

procedure(anillo(w puntos)
  cv = geGetEditCellView()
  mipath = rodCreatePath(
        ?layer           list("M1" "logic")
        ?width           w
        ?pts             puntos
        ?endType         "flush"
        ?cvId            cv
        ?encSubPath      list(
           list(
             ?layer        list("XN" "logic")
             ?enclosure    -0.22            
             ?beginOffset  0.22
             ?endOffset    if(pathstate~>closed then -0.22 else 0.22)
           );NWell
           list(
             ?layer        list("ACTIVE" "logic")
             ?enclosure    -0.04        
             ?beginOffset  0.04
             ?endOffset    if(pathstate~>closed then -0.04 else 0.04)
           );Active
        ) ;encpath
        for(i 0 99
          ?subRect         list(
            list(
              ?layer      list("CS" "logic")
              ?width      0.22
              ?length     0.22
              ?endOffset  -0.06
              ?beginOffset -0.06
              ?space      0.28
              ?sep        i  ;This gives me the separation.
            );contactos
          );subrect
        );for
        
  ) ; end rodCreatePath
);proc

;------------------EOFunction----------------

But when I try to run it with my parameters OK it says: 

;--------------------CIW Window---------------

 *Error* rodCreatePath: extra arguments or keyword missing - (t)

;--------------------End of CIW Window-----------------

It's just because the "for()" function returns "true" (t) . (I think.)

What could I do to solve this? Any other good technique for doing this? Thanks in advance.

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    Yes, the problem is partly because for() returns t, and also because you've got the ?subRect within the for loop. 

    Easiest way to do this is probably to build a list of integers from 0 to 99, and then use foreach(mapcar) to transform this list of integers into the subRect entries.

    For example this modification to your code (I suspect you'll need to adjust it, because I think all the contacts aren't in the right place, but I'm sure you can take care of that part).

    procedure(abSequence(start stop)
      let((i seq)
        i=stop
        while(i>=start
          seq=cons(i-- seq)
        )
        seq
      )
    )
    
    procedure(anillo(w puntos)
      cv = geGetEditCellView()
      mipath = rodCreatePath(
            ?layer           list("M1" "logic")
            ?width           w
            ?pts             puntos
            ?endType         "flush"
            ?cvId            cv
            ?encSubPath      list(
               list(
                 ?layer        list("XN" "logic")
                 ?enclosure    -0.22            
                 ?beginOffset  0.22
                 ?endOffset    if(pathstate~>closed then -0.22 else 0.22)
               );NWell
               list(
                 ?layer        list("ACTIVE" "logic")
                 ?enclosure    -0.04        
                 ?beginOffset  0.04
                 ?endOffset    if(pathstate~>closed then -0.04 else 0.04)
               );Active
            ) ;encpath
    	?subRect
    	  foreach(mapcar i abSequence(0 99)
                list(
                  ?layer      list("CS" "logic")
                  ?width      0.22
                  ?length     0.22
                  ?endOffset  -0.06
                  ?beginOffset -0.06
                  ?space      0.28
                  ?sep        i  ;This gives me the separation.
                );contactos
              ); foreach abSequence
            
      ) ; end rodCreatePath
    );proc
    

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • user002
    user002 over 15 years ago

     Thank you very much Andrew. It works nice.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • johnmck
    johnmck over 14 years ago

    Andrew, the code above was very helpful but I am having a syntax problem when I try to add a second layer into the foreach.  I couldn't add a second foreach loop either.  Here is an example of what I'm trying to do.  Thanks,  John

     ?subRect
      foreach(mapcar i abSequence(0 99)
                list(
                  ?layer      list("CS" "logic")
                  ?width      0.22
                  ?length     0.22
                  ?endOffset  -0.06
                  ?beginOffset -0.06
                  ?space      0.28
                  ?sep        i  ;This gives me the separation.
                );contactos

                list(
                  ?layer      list("V1" "logic")
                  ?width      0.22
                  ?length     0.22
                  ?endOffset  -0.06
                  ?beginOffset -0.06
                  ?space      0.28
                  ?sep        i  ;This gives me the separation.
                );contactos2

              ); foreach abSequence

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • lrl12skdev
    lrl12skdev over 14 years ago

     Hi johnmick,

    I think it's because your argument for ?subRect is wrong, it is expecting a single list but you are giving him 2. the best way I guess is to form the list outside the rod function, let say you build the list and call it subrectlist then you can just simply write ?subRect subrectlist

    example

    list1 =   foreach(mapcar i abSequence(0 99)
                list(
                  ?layer      list("CS" "logic")
                  ?width      0.22
                  ?length     0.22
                  ?endOffset  -0.06
                  ?beginOffset -0.06
                  ?space      0.28
                  ?sep        i  ;This gives me the separation.
                );contactos

    );foreach

    list2 = foreach(mapcar i abSequence(0 99)
                list(
                  ?layer      list("CS" "logic")
                  ?width      0.22
                  ?length     0.22
                  ?endOffset  -0.06
                  ?beginOffset -0.06
                  ?space      0.28
                  ?sep        i  ;This gives me the separation.
                );contactos

    );foreach

    subrectlist = append(list1 list2)

    ?subRect  subrectlist

     of course this is just a quick and dirty solution to show what I mean but you can do it in more efficient way perhaps avoiding append function.

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • johnmck
    johnmck over 14 years ago

    That works!  Thanks!  I knew it was a simple fix, I just couldn't find it.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago
    The other way would be to do something like this (using foreach mapcan):

     ?subRect

      foreach(mapcan i abSequence(0 99)

    list(
                list(

                  ?layer      list("CS" "logic")

                  ?width      0.22

                  ?length     0.22

                  ?endOffset  -0.06

                  ?beginOffset -0.06

                  ?space      0.28

                  ?sep        i  ;This gives me the separation.

                );contactos

                list(

                  ?layer      list("V1" "logic")

                  ?width      0.22

                  ?length     0.22

                  ?endOffset  -0.06

                  ?beginOffset -0.06

                  ?space      0.28

                  ?sep        i  ;This gives me the separation.

                );contactos2
    )
              ); foreach abSequence

    Apologies for the formatting - replying from a hand-held device. Foreach mapcan will merge the lists in the body of the foreach as it proceeds.

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • johnmck
    johnmck over 14 years ago

    Andrew, thanks for the help.  I had tried that but didn't change the mapcar to mapcan!!!

    • 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