• 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 Execute Unix Commands through CIW Window and Store...

Stats

  • Locked Locked
  • Replies 21
  • Subscribers 143
  • Views 12330
  • 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 Execute Unix Commands through CIW Window and Store the output in a variable on Unix/CIW Window (Rather than file)?

Sonu Chopra
Sonu Chopra over 5 years ago

Hello Support,

I have one query regrading the Execution of Unix Commands through CIW Window. Currently i am using system or sh/shell Command and i am storing the output in a file . Can there be a way that We Can Store the output in a variable itself (Accessible form Unix/CIW Window).

The Query is that i want to have the layer Map File Path and I want to store it to a variable (Don't want output  to redirect to file and i don't want to read the file to get the path in a variable if possible)

; Getting the LayerMapFile Path and Storing in a file 

system("piGetInfo $DKITROOT lyrFilIn  >layermapfile.il")  

Above Command is working Fine and layermapfile.il is containing the LayerMapFile Path

;Getting the LayerMapFile Path and Storing in a Variable

system("setenv layerMapFile `piGetInfo $DKITROOT lyrFilIn` ")

Above Command is throwing a error :- sh: setenv: command not found

Can you please provide some help on this?

Thanks in Advance,

Regards

Sonu 

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

    Hi Sonu,

    There are several things wrong here. First of all, "setenv" is a csh not sh command, and so it's not surprising that gives an error. Even if you'd used csh() instead of sh(), it wouldn't have helped because you're setting an environment variable in a child process which you'd not have been able to see (environment variables are only inherited in UNIX child processes, not to the parent).

    I think you probably should just do:

    cid=ipcBeginProcess("piGetInfo $DKITROOT lyrFilIn")
    ipcWait(cid)
    layerMap=ipcReadProcess(cid)

    Then you'll have the data in a SKILL variable which is presumably what you wanted.

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Sonu,

    There are several things wrong here. First of all, "setenv" is a csh not sh command, and so it's not surprising that gives an error. Even if you'd used csh() instead of sh(), it wouldn't have helped because you're setting an environment variable in a child process which you'd not have been able to see (environment variables are only inherited in UNIX child processes, not to the parent).

    I think you probably should just do:

    cid=ipcBeginProcess("piGetInfo $DKITROOT lyrFilIn")
    ipcWait(cid)
    layerMap=ipcReadProcess(cid)

    Then you'll have the data in a SKILL variable which is presumably what you wanted.

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    Thanks for quick response and help. Yes , I agree with you that "Setenv"  belongs to csh (but I was not aware that csh can be used in skill). Btw , As You have mentioned it will also not work.

    There is two more queries for which I need your guidance :-

    1. There is any built-in function in skill to sort the list (in alphabetical order) or we have to transverse the list for sorting the list? Can you please help how we can sort the list (if there is no direct function in skill) ? ( the list is only containing text data)

    2. I am using hiCreateComboField function to create a drop down field and its working fine but when I am typing in it doesn't filter any result based upon  data entered by me?

    Can you please provide some help how to do that with this function or recommend any other function to do that?

    Thanks in Advance ,

    Regards

    Sonu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Sonu Chopra

    Hi Sonu,

    Unsurprisingly, the function to sort a list in SKILL is called sort. You would do:

    mylist=sort(mylist 'alphalessp)

    The second argument is the name of a function (or a function object) which accepts two arguments, and is used to determine whether the first argument is less than the second argument. Note that you must use the return value of the sort function as it's a destructive function that changes the pointers in the list in place.

    I don't understand what you mean by the hiCreateComboField question, or what you mean by filtering here. I would suggest you create a new post (since this is nothing to do with the original question), ideally with a code example that you've written, and some pictures and illustrations to describe what it is  you're expecting.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    Sorry , I was only looking  sort function only  in list functions section in skill language user manual but it was there in Arithmetic Function .

    As You have suggested I will create a separate post for my second query with code example and pictures .

    Thanks Again for all the help

    Regards

    Sonu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 5 years ago in reply to Sonu Chopra

    Hi Andrew,

    I think the idea is to repopulate the combo box each time you type something into the text field. So assume you start wit a list '("abc" "def" "auv") and then type 'a' into the text filed only "abc" and "auv" should remain as combo box items. I think I did something a while ago but I'd have to look it up.

    Max

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to mbracht

    Max, I'm assuming you're referring to this post.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to mbracht

    Hello mbracht,

    I am looking for the same as you mentioned.

    Regards

    Sonu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    The post mentioned by you is storing the previous inputs given by the user in a drop down list.

    But my query is that I have to create a drop down field (which I am creating through hiCreateComboField ) which will contain a list of items through which user can select any item belonging to drop down list and can also type in the drop down field. when I am typing in the drop down field then I am expecting that fields will show me list of items matching the text entered by me (Which is not the case)

    Let us Take an example :-

    I have a drop down field with list :- ("sonu"  "andrew"  "max" "anil")

    When I am typing "a" in drop down field then I am expecting to show only two result from the list which is "andrew" and "anil" but currently this is not the case. I am able to type any value in the list and drop down field is accepting that value. I want drop down menu field to have only those value which is mentioned in list(not any value).

    Can you please provide some help on this?

    Regards

    Sonu

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Sonu Chopra

    Hi Sonu,

    There's not really support for this (quite). There's an enhancement CCR 2167658 to ask for a true filtering/auto-complete mechanism. The closest you have right now is that you could use the ?modifyCallback to be called each time the user types, and then you could update the ->items list on the field to match just those which match the typed-in value (you'd need to store the full list somewhere else on the field as a property so that you keep the full list somewhere to filter from that).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • mbracht
    mbracht over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    Exactly - only I don't get it running anymore...no idea why. Reassigning to form->combo->items is not reflected in the actual combo box.
    I also found a  related Enhancement CCR:

     CCR 2167658:hiCreateComboField to filter choices like ddHiCreateLibraryComboField

    Max
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to mbracht

    Max,

    This code (assuming I can paste it in - it's causing trouble) works. I used substring and setof rather than pcreMatchList as it's not really a regexp:

    I can't paste the code or add as an attachment. I'll speak to IT.

    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