• 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. SKILL code to get user input from the CIW

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 125
  • Views 20800
  • 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

SKILL code to get user input from the CIW

thomas1000
thomas1000 over 11 years ago

This should be the easiest thing to do but I cannot find it in the documentation.  What command(s) are needed to prompt and receive user keyboard input from the CIW from a SKILL routine?  I am not looking for a custom user form - more on the order of one line of code or two at the most.  I don't want to get the input from a file - I want to enter it with the keyboard.

  • Cancel
  • skillUser
    skillUser over 11 years ago

    Hi Thomas,

    You could try enterString() - the documentation says that the string / entry is terminated when [Enter] is pressed. I have not played with this for a very long time, but I think it should fit your requirements.

    Regards,

    Lawrence

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • thomas1000
    thomas1000 over 11 years ago

     Thanks but I created a procedure to do this and it didn't seem to work.  My procedure was

    procedure(test()
        a = enterString()
    )

    When I run it, it immediately returns and there is no opportunity to enter the string.  If I try to enter the string I get an error saying that the string is undefined.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    If you do:

     procedure(test()
        a = enterString(?prompts list("do this"))
        printf("The value of a was %L\n" a)
    )

    And then call test() - you need to type the string you want in quotation marks, otherwise it won't read it.

    I doubt this is really what you want. The CIW is not really intended for you to read responses from the user. Why not create a form?

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 11 years ago

    Hi Thomas,

    Sorry to hear that it doesn't work - what are you trying to achieve?  Perhaps the string could be an argument for a procedure, i.e. gather the input before running?  Why not a small form to interact with the user to gather feedback?  Is the information being obtained a general-purpose text string, or is it a more specific purpose (e.g. a point list)?  Helping us to understand the problem better will elicit better responses.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • thomas1000
    thomas1000 over 11 years ago

    I don't want to be critical of SKILL but I have evidently been spoiled by other languages.  In VB you have an input statement and it creates a small form that you can use to enter values.  Everytime I look at the amount of code required for a form it is about 4 or 5 times as much code as my original application, which is very short.

     What I want to do is prompt for a number and have the user type the number (without quotes) and then use that number in a calculation.  A form would be nice but I thought I had remembered from class about 10 years back that there was something about 1 line long - maybe that memory was imagined.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 11 years ago

    Hi Thomas,

    Have you tried enterNumber()?

    regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • thomas1000
    thomas1000 over 11 years ago

    Taking a cue from Andrew's post, I tried the following:

    procedure(test()
     a = enterNumber(?prompts list("Enter a number"))
     printf("That number squared is %f\n" a**2)
    )

    However, when I type test in the CIW, the routine proceeds without stopping for user input (this is not the final application).  If you try to enter a number it does not compute its squared value.  It simply blows right past all of that.  if you type, a, in the CIW, it is undefined but since my procedure made it global, it is evident that a was never assigned.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 11 years ago

    Hi Thomas,

    Here's a quick and dirty example of creating a simple form to get the user input:

    
    ;; this is an example of using the input value
    procedure(CCFuseNum(form) printf("You entered: %L\n" form->CCFGetNumFloatField->value))
    
    ;; this is the simple form to get the number
    hiDisplayForm(
      hiCreateAppForm(?name 'CCFGetNum 
        ?fields    list( list(
                     hiCreateFloatField(?name 'CCFGetNumFloatField ?prompt "Enter number:")
                     0:0 130:30 80
                     )
                   )
        ?formTitle "Get Num"
        ?callback  'CCFuseNum
        ?dialogStyle 'modal)
    )

    There are more arguments to the hiCreateAppForm() function to control the appearance of the form etc.
    I've made the form "modal" so that the user has to interact with the form (OK/Cancel) before moving on
    to the next task.  The form structure is global, so you can access it any time after it was called, e.g.
      CCFGetNum->CCFGetNumFloatField->value
    so you do not have to use the form callback if you do not want to.

    I hope this helps you.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • thomas1000
    thomas1000 over 11 years ago

    Thanks - that looks a lot better than the other form code I have seen.  I will try it.

    • 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