openrisc / orpsoc-cores

Core description files for FuseSoC
124 stars 79 forks source link

Executing more than one testbench #109

Open rjfnobre opened 7 years ago

rjfnobre commented 7 years ago

How can I use more than one instance of the mor1kx simulator at the same time, and still be able to kill the instance that is giving me problems (e.g., takes more than 10 seconds to terminate)?

Right now I'm able to execute one instance at the time, killing it with 'pkill -f Vorpsoc_top' if it takes more than 10 seconds to terminate by itself, but I would like to be able to use more than a core/cpu at the time by running multiple instances of the simulator.

// EXECUTE ONCE ON STARTUP timelimit -t10 fusesoc sim --sim=verilator --build-only mor1kx-cappuccino

// LOOP fusesoc sim --sim=verilator --keep mor1kx-cappuccino --elf-load /tmp/application > info.dat pkill -f Vorpsoc_top

olofk commented 7 years ago

Hmm... that's a good question, but unfortunately I can't give you a good answer. Maybe the best way to do it is to create a custom script that launches all instances in the background and records the pid of each one. In python, this could likely be done by launching each fusesoc process with subprocess.Popen, check if they are still alive with subprocess.poll and kill with subprocess.terminate or subprocess.kill. Something similar could probably be done in a shell script or other programming languages as well, but I'm not really sure how

olofk commented 7 years ago

ok, I got a little curious, so I decided to implement it myself as a python script. This launches all the OpenRISC tests, saves the contents of stdout and stderr of each one and kills them after 10 seconds. Change to your liking and let me know if it works

rjfnobre commented 7 years ago

Thanks for the fast reply.

I will test that and report back to you.