Skip to content
Snippets Groups Projects
Commit 95cd2262 authored by Pieter Donker's avatar Pieter Donker
Browse files

L2SDP-888, changed env function

parent d93cd94e
No related branches found
No related tags found
1 merge request!15Resolve L2SDP-888
...@@ -105,11 +105,10 @@ def main(args, time_ordered_tb_dict): ...@@ -105,11 +105,10 @@ def main(args, time_ordered_tb_dict):
# start 'n_proc' tb worker processes # start 'n_proc' tb worker processes
logger.info("Run all tests using %d workers", n_proc) logger.info("Run all tests using %d workers", n_proc)
modelsim_log_path = os.path.join(args.log_path, "modelsim") modelsim_log_path = os.path.join(args.log_path, "modelsim")
my_env = os.environ.copy()
workers = [] workers = []
for i in range(n_proc): for i in range(n_proc):
worker_id = i + 1 worker_id = i + 1
worker = TestBenchWorker(worker_id, my_env, control_queue[i], task_queue, response_queue, MK_TIMEOUT, SIM_TIMEOUT, modelsim_log_path) worker = TestBenchWorker(worker_id, control_queue[i], task_queue, response_queue, MK_TIMEOUT, SIM_TIMEOUT, modelsim_log_path)
workers.append(worker) workers.append(worker)
worker.start() worker.start()
...@@ -420,10 +419,9 @@ def generate_email_report( ...@@ -420,10 +419,9 @@ def generate_email_report(
class TestBenchWorker(multiprocessing.Process): class TestBenchWorker(multiprocessing.Process):
"""TestBenchWorker class is a process that will check for tasks to process in the in_queue""" """TestBenchWorker class is a process that will check for tasks to process in the in_queue"""
def __init__(self, worker_id, my_env, control_queue, in_queue, out_queue, max_mk_time, max_sim_time, log_path): def __init__(self, worker_id, control_queue, in_queue, out_queue, max_mk_time, max_sim_time, log_path):
multiprocessing.Process.__init__(self) multiprocessing.Process.__init__(self)
self._id = worker_id self._id = worker_id
self._my_env = my_env
self._ctrl = control_queue self._ctrl = control_queue
self._in = in_queue self._in = in_queue
self._out = out_queue self._out = out_queue
...@@ -454,8 +452,8 @@ class TestBenchWorker(multiprocessing.Process): ...@@ -454,8 +452,8 @@ class TestBenchWorker(multiprocessing.Process):
if not os.path.exists(sim_dir): if not os.path.exists(sim_dir):
os.mkdir(sim_dir) os.mkdir(sim_dir)
os.putenv("HDL_IOFILE_SIM_DIR", sim_dir) os.environ["HDL_IOFILE_SIM_DIR"] = sim_dir
self.terminal = Terminal(print_stdout_on_timeout=True, env=my_env) self.terminal = Terminal(print_stdout_on_timeout=True)
self.terminal.run_cmd(f"rm -rf {sim_dir}/*") self.terminal.run_cmd(f"rm -rf {sim_dir}/*")
print(self.terminal.stdout()) print(self.terminal.stdout())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment