• 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 Design
  3. About function define

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 15036
  • 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

About function define

bobbygang
bobbygang over 14 years ago

Hi, I wrote function define code like this :

procedure(MMM(A B C D E)
                   setplist(A '(B D C E))
                   F=getqq(A B)
                   F
)

I want to achieve that when I input :    MMM(bobby xx (1 2 ) yy (3 4))

it will give me the result :        (1 2)

But it always tell me          *Error* eval : unbound variable  -bobby

Does it mean that when I use the function MMM I should define symbol "bobby" "xx" "yy" first?

I think it's too cumbersome. How to solve this problem ?

  • Cancel
Parents
  • skillUser
    skillUser over 14 years ago

     Hi Bobby,

    I can't quite figure out what you are trying to do. In this case you appear to be calling the procedure incorrectly, you would need to do something like this instead: 

    MMM('bobby 'xx '(1 2) 'yy '(3 4))  (you could call "list(1 2)" instead of '(1 2) also).

    But even then the code probably wouldn't work.  If you call MMM with just "bobby" the SKILL interpreter will look for a variable (or function) that matches the symbol bobby and it is not finding one.  If you make the procedure an nprocedure then it might start to work the way you might want it to,  something like

    nprocedure(MMM(args)
      let( (h)
        when(h=car(args)
          setplist(h cdr(args))
          F=getqq(h cadr(args))
        ); when
      ); let
    ); nprocedure
    
    MMM(bobby xx (1 2) yy (3 4))
    => (1 2)
    bobby.xx
    => (1 2)
    bobby.yy
    => (3 4)
    F
    => (1 2)

    Is this what you are looking for?

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 14 years ago

     Hi Bobby,

    I can't quite figure out what you are trying to do. In this case you appear to be calling the procedure incorrectly, you would need to do something like this instead: 

    MMM('bobby 'xx '(1 2) 'yy '(3 4))  (you could call "list(1 2)" instead of '(1 2) also).

    But even then the code probably wouldn't work.  If you call MMM with just "bobby" the SKILL interpreter will look for a variable (or function) that matches the symbol bobby and it is not finding one.  If you make the procedure an nprocedure then it might start to work the way you might want it to,  something like

    nprocedure(MMM(args)
      let( (h)
        when(h=car(args)
          setplist(h cdr(args))
          F=getqq(h cadr(args))
        ); when
      ); let
    ); nprocedure
    
    MMM(bobby xx (1 2) yy (3 4))
    => (1 2)
    bobby.xx
    => (1 2)
    bobby.yy
    => (3 4)
    F
    => (1 2)

    Is this what you are looking for?

    Regards,

    Lawrence.

    • 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