Question

I would like to take commands interactively from a user from standard input in a SystemC simulation. I am using Mentor Questa and it seems that nothing from cout is printed to prompt the user (even with a flush immediately after the stream to cout). I am using "getline" from iostream to get input. Does someone know how to accomplish this? Or has anyone seen a complete example with explanations as to how one would accomplish this?

Edit:

So, it looks like running vsim with the "-c" and "-keepstdout" options causes some really odd behavior. Running vsim with "-keepstdout" causes the GUI to launch but stdin and stdout are sent to the launching terminal. So perhaps this is a Questa bug and not a SystemC question.

Was it helpful?

Solution

SystemC is C++. You can use standard C++ techniques for user I/O.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top