Project-Bonfire / Bonfire_legacy

A Fault Tolerant NoC Architecture
GNU General Public License v3.0
7 stars 8 forks source link

simulate.py: spaces and special characters in directory names #11

Open AlexDaniel opened 7 years ago

AlexDaniel commented 7 years ago

As I go through some stuff, I notice issues outside of my scope. I will probably file everything I see.

In simulate.py, os.system is used to run a command. The command includes a couple of variables for paths, and some of these paths are based on project root. My best guess is that there is no guarantee that PROJECT_ROOT will not contain spaces, *, $ and other characters that are specially treated by shells.

The solution is quite simple, just rework lines with os.system to use subprocess.call.

AlexDaniel commented 7 years ago

FWIW:

git grep 'os\.system'
Scripts/include/file_gen.py:    return_value = os.system(net_gen_command)
Scripts/include/file_gen.py:    return_value = os.system(net_tb_gen_command)
Scripts/include/file_gen.py:    return_value = os.system(wave_do_gen_command)
Tools/Minimization_Tool/area_coverage_calc.py:    os.system("sh ./synthesis_script.sh" + " " + package_file.module_file_name + " " + checkers_file_name + " " +
simulate.py:        return_value = os.system("vsim -c -do " + package.SIMUL_DO_SCRIPT)
simulate.py:        return_value = os.system("vsim -do " + package.SIMUL_DO_SCRIPT)
simulate.py:            return_value = os.system(latency_command)