• 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 12319
  • 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
  • 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
  • Sonu Chopra
    Sonu Chopra over 5 years ago in reply to Andrew Beckett

    Hello Andrew,

    If I understand it well then you have code which can solve my query but you are able to attach and update the code?  OR  its not done till now and it will taken care in future by enhancement CCR 2167658 ?

    Regards

    Sonu

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

    I have some code that will alter the drop-down list as you type - that's what I'm struggling to upload at the moment. The enhancement will be more about showing the completion options directly in the type-in field (similar to that which happens for the ddHiCreateLibraryComboField/ddHiCreateCellComboField etc and for leCreateLayerField).

    So to clarify - the code I have works right now, but doesn't do everything the enhancement requests. It may be enough for your needs though.

    Andrew

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

    Hello Andrew,

    Thanks for Clarification . But , if its alter the original drop down list (When user type-in) then there is an issue as when user select or type-in for the second time the drop down list will not be same as original list? OR you are altering the drop list locally and keep the same original drop down list as for next time then its really serving my purpose?

    Please share the code when its done :)

    Really thanks a-lot for the quick responses and help

    Regards

    Sonu

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

    With my code there is no problem with deleting what you've typed in and then typing something else. It keeps the complete list of choices and updates starting from the complete set each time you type.

    So I'll post it as soon as I can!

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

    Hello Andrew,

    Thanks for all the help.  I will wait for your update.

    Regards

    Sonu

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

    Hi Sonu,

    With help from my friend in IT, we managed to find a particular keyword in the code that it objects to - I rewrote the code to avoid that. Here's the updated code:

    let((cf)
        cf=hiCreateComboField(
            ?name 'cf 
            ?items list("sonu" "andrew" "max" "anil")
            ?modifyCallback 
                lambda((field form value flag)
                    let((len)
                        len=strlen(value)
                        form->cf->items=setof(item form->cf->allItems
                            strncmp(item value len)==0
                        )
                        t
                    )
                )
            )
        cf->allItems=cf->items
        hiCreateAppForm(
            ?name 'CCFform
            ?fields list(cf)
        )
        hiDisplayForm(CCFform)
    )

    Regards,

    Andrew.

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

    It didn't like substring in my original code, so I changed to use strncmp instead.

    Andrew

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

    Hello Andrew,

    Thanks for the code. It really work fine for me. But There is one more point (Which may be quite complex to implement) that whenever I am typing something in drop down field its giving the filter list based on matching the case (its expected as you have used the strncmp) . Can we have the filter list result based on case insensitive search?

    For Example :- drop_down_list =("andrew" "sonu" "max" "anil").

    Currently as per your code if I am typing "A" its gives no result? Can We have some code which still gives the filter list as  "andrew" "anil" even if I type "A" in Drop Down Field?

    Thanks Again Andrew for all the help,

    Regards

    Sonu

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

    Hi Sonu,

    Use  strncmp(item lowerCase(value) len)==0 instead. This is assuming that allItems is entirely lower case. If not, you could put lowerCase(item) too...

    Andrew

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

    Hello Andrew,

    Thanks for the code. Yes its Working fine for me :).

    Regards

    Sonu

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

    Hello Andrew,

    Thanks for the code. Yes its Working fine for me :).

    Regards

    Sonu

    • 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