• 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 auto-populate Real path in string using different...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 10789
  • 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 auto-populate Real path in string using different radio button

saurabh96
saurabh96 over 4 years ago

Hey...I have created two radio button, i.e. chk1 and chk2...how can we do that if I select button chk2 - then it will populate/visible the real path of file ABC.il, i.e. ~/x/abc.il into the string field, And if I select button chk1, the string will show the real path of xyz.il i.e ~/q/xyz.il.
How can we implement this using skill..pls guide me?

net= hiCreateStringField(
?name 'net
?prompt "Enter Netlist Path"
?value ""
)

button_net_data = hiCreateButton(
?name 'button_net_data
?buttonText "Browse"
?callback "ddsFileBrowseCB(hiGetCurrentForm() 'net \"\" 'fileOnly)"
)


netlists=hiCreateRadioField(
?name 'netlists
?prompt ""
?choices list("chk1" "chk2")
?value "chk2"
?enabled t
; no idea how this was supposed to work - it's a random set of values!
;?callback list("(hiSetFieldEnabled() 'netlists 'net '(t nil ) ;;)"
?callback list("MyEnableFields(hiGetCurrentForm())")
)

procedure(MyEnableFields(form)
let((netEnabled)
case(form->netlists->value
("chk2"
getWorkingDir()=nil
)
("chk1"
getWorkingDir()=t
)
)

)
)

hiCreateAppForm(?name 'forum86 ?fields list(net button_net_data netlists))
MyEnableFields(forum86)
hiDisplayForm(forum86)

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    I have no idea what you mean. Clearly your code makes no sense, because you are trying to do:

    getWorkingDir()=nil

    I can't imagine what you were thinking this would do (if it worked, which it doesn't) - assigning the result of a function to nil or t makes no sense anyway. What does "populating the real path of ABC.il" mean, and how would it know that this should be ~/x/abc.il ?

    You really are going to need to ask clear questions if you expect an answer. Otherwise you're likely to have your questions ignored if you can't provide enough information to give somebody (like me or Max who've answered so far) any chance of answering.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Oh, I am very sorry, Andrew...let me try once again to explain to you...
    "populating the file path of ABC.il" means suppose, file x is present in PWD, then string value will be the file path of that file. and same for another radio button. I thought that should I hardcode the file path in a string value, but PWD will be different for different users. Isn't there something like we can use Unix commands like ($PWD) or other in skills to implement it?
    Hope it clears some clouds.
    Regards,
    SRV

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Oh, I am very sorry, Andrew...let me try once again to explain to you...
    "populating the file path of ABC.il" means suppose, file x is present in PWD, then string value will be the file path of that file. and same for another radio button. I thought that should I hardcode the file path in a string value, but PWD will be different for different users. Isn't there something like we can use Unix commands like ($PWD) or other in skills to implement it?
    Hope it clears some clouds.
    Regards,
    SRV

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    I'm not sure these are completely reversible operations, but you could use:

    form->net->value=simplifyFilename(form->net->value t)

    to convert to a full path (the t as the second argument tells the function not to resolve symbolic links). To go back to a local path, you could potentially just use a regular expression approach to remove everything before the last "/". For example:

    removeDir=pcreCompile("^.*/")
    form->net->value=pcreReplace(removeDir form->net->value "" 1)

    The reason why I question whether this is quite right is that if the path was originally not in the working dir (so say you'd entered ./subdir/ABC.il) then converted to a full path, the second operation would change it back to "ABC.il" which is not necessarily right. It's a bit of a strange use model, so I'll leave that to you to determine the logic that you want.

    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