• 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 to Get the user input in the CIW

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 9000
  • 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 to Get the user input in the CIW

Jinhyung
Jinhyung over 2 years ago

Thanks for your interest.

Now I'm trying to make user enter their own input.

I just found the post with same problem as me, and read the post about enterString() function.

I made the test code like this


procedure(test()

          printf("Enter the input: \n")

          d_in = enterString(?prompts list("user input"))
          printf("The input you enter is %s" d_in)

)


This code works, but I found that the "enterString()" is the enterfunction, so it only works when I open the layout cellview window.

It doesn't work if I close all the cellview window.

I want the function like scanf() in C language.

Therefore, I'm looking for the function that always work whether the cellview window is open or not.

If it is possible, could you help me to find the function.

Again, thanks for your time.

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago
    Jinhyung said:
    I want the function like scanf() in C language.

    You could always use the SKILL scanf function!

    However, I would say that in my experience nobody ever likes an interface that expects you to type something in the CIW - far better to have some kind of form to capture the information you're asking the user to provide.It feels more natural to a Virtuoso user.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jinhyung
    Jinhyung over 2 years ago in reply to Andrew Beckett

    Thanks for your time.

    I understand the meaning you recommend me, and I think it's the best way.

    I'll try to follow your advice.

    Actually, now I'm making a program that load schematic, layout and set their environment automatically when user needs to open the circuit. So, I thought that user should type specific circuit name, then load schematic, layout automatically. In this case, I need some function to get the user input, and I found out that I can use scanf(). so, I use scanf() like the following code.


    procedure(test()

             scanf("%s" d_in)

             printf("input is %s" d_in)

    )


    However, it didn't work. 

    So, now I'm trying my best to follow your advice, but if I use scanf, could you teach me how to use it?

    Again, thanks for your time

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Jinhyung

    Ah, because I never do this, I'd forgotten that scanf() doesn't work in the CIW. You get:

    *Error* fscanf: no file associated with port - port:"*ciwInPort*"

    As an alternative, you can use gets() to read the line and then use ssscanf to parse it:

    procedure(test()
      let((d_in line)
        line=gets()
        sscanf(line "%s" d_in)
        printf("input is %s" d_in)
        d_in
      )
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Jinhyung
    Jinhyung over 2 years ago in reply to Andrew Beckett

    I perfectly understand it. It works in my code.

    But, like your suggestion, I should try to minimize the code which makes user type their inputs.

    Thanks for your time, and it really taught me a lot.

    Thanks a lot, Andrew.

    • 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