Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

does $system work in windows os?

Status
Not open for further replies.

trured

Newbie
Joined
Nov 24, 2022
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
29
Does not $system() work in windows os?
modelsim documentation gives an example using unix command but does not mention that this will not work in windows.

This is what is in the documentation -

$system("command"); This system function takes a literal string argument, executes the specified operating system command, and displays the status of the underlying OS process. Double quotes are required for the OS command. For example, to list the contents of the working directory on Unix: $system("ls -l"); Return value of the $system function is a 32-bit integer that is set to the exit status code of the underlying OS process.

This is what I am trying to do in my testbench.


Code:
 initial

        begin

                $system("set s=10");

                $system("echo value of s is  %s%");

        end

I expect this to be printed in the transcript - value of s is 10. but I get - value of s is %s%

I have been at it for so long and not able to figure it out.
please let me know what am i doing wrong here.
 

Unfortunately we are all slaves to tool documentation. If a description on how to use it for Windows does not exist, probably it is not supported (?).

Have you tried some Siemens forum where discussuion on Modelsim is allowed?
 

Check if $system() is connecting to the windows command shell at all, e.g. by echoing a globally defined enviroment variable. If it does, the problem is probably that each $system() call starts its own shell instance, so that "set s=10" isn't kept.
 

Unfortunately we are all slaves to tool documentation. If a description on how to use it for Windows does not exist, probably it is not supported (?).

Have you tried some Siemens forum where discussuion on Modelsim is allowed?
i did not post there. i did not think about it. thank you, i will post there.
 

Check if $system() is connecting to the windows command shell at all, e.g. by echoing a globally defined enviroment variable. If it does, the problem is probably that each $system() call starts its own shell instance, so that "set s=10" isn't kept.
i tried this - $system("echo %PATH%"); and it printed value of path.
is there a way to have two commands in one $system call? I tried $system("(set s=10 & echo %s%)"); and
it printed %s%
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top