systemc: Update test output for longer lived processes.

In the systemc spec, process handles can be invalidated if they have no
children and are terminated. The implementation is not required to do
so however, and for the sake of simplicity gem5 currently does not. To
quote:

"When the underlying process instance terminates, if the process
instance has no surviving children, an implementation may choose to
invalidate any associated process handles, but it is not obliged to do
so."

Two tests have reference output which is affected by this (legal)
difference in behavior. In one case, the test creates new processes
which reuse the names of processes that have been terminated. Since
gem5 doesn't invalidate the old processes, a standard mechanism is
activated which renames the processes to something which is unique.

The other test has this same problem, and also prints the hierarchy
of processes several times during the test. In that hierarchy, the
terminated tests with no live children are still present, where in the
old reference output they've been removed.

This change updates the reference output to match gem5's behavior.

Change-Id: I363448de10080bdce01a4df92f991c67b31a2401
Reviewed-on: https://gem5-review.googlesource.com/c/14919
Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de>
Maintainer: Gabe Black <gabeblack@google.com>
diff --git a/src/systemc/tests/systemc/kernel/dynamic_processes/test09/golden/test09.log b/src/systemc/tests/systemc/kernel/dynamic_processes/test09/golden/test09.log
index fe9a4a4..33cd91b 100644
--- a/src/systemc/tests/systemc/kernel/dynamic_processes/test09/golden/test09.log
+++ b/src/systemc/tests/systemc/kernel/dynamic_processes/test09/golden/test09.log
@@ -22,81 +22,141 @@
 4 ns dut.grand_parent.parent2.child2 got kill
 4 ns dut.grand_parent.parent2.child3 got kill
 4 ns dut.grand_parent.parent2 initialization
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child1. Latter declaration will be renamed to dut.grand_parent.parent2.child1_0
+
+In process: dut.grand_parent.parent2 @ 4 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child2. Latter declaration will be renamed to dut.grand_parent.parent2.child2_0
+
+In process: dut.grand_parent.parent2 @ 4 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child3. Latter declaration will be renamed to dut.grand_parent.parent2.child3_0
+
+In process: dut.grand_parent.parent2 @ 4 ns
 4 ns dut.grand_parent initialization
 
-4 ns dut.grand_parent.parent2.child1 initialization
-4 ns dut.grand_parent.parent2.child2 initialization
-4 ns dut.grand_parent.parent2.child3 initialization
+4 ns dut.grand_parent.parent2.child1_0 initialization
+4 ns dut.grand_parent.parent2.child2_0 initialization
+4 ns dut.grand_parent.parent2.child3_0 initialization
 8 ns stimulus issuing reset
 8 ns dut.grand_parent.parent1.child1 initialization
 8 ns dut.grand_parent.parent1.child2 initialization
 8 ns dut.grand_parent.parent1.child3 initialization
 8 ns dut.grand_parent.parent1 initialization
-8 ns dut.grand_parent.parent2.child1 initialization
-8 ns dut.grand_parent.parent2.child2 initialization
-8 ns dut.grand_parent.parent2.child3 initialization
+8 ns dut.grand_parent.parent2.child1_0 initialization
+8 ns dut.grand_parent.parent2.child2_0 initialization
+8 ns dut.grand_parent.parent2.child3_0 initialization
 8 ns dut.grand_parent.parent2 removing children
-8 ns dut.grand_parent.parent2.child1 got kill
-8 ns dut.grand_parent.parent2.child2 got kill
-8 ns dut.grand_parent.parent2.child3 got kill
+8 ns dut.grand_parent.parent2.child1_0 got kill
+8 ns dut.grand_parent.parent2.child2_0 got kill
+8 ns dut.grand_parent.parent2.child3_0 got kill
 8 ns dut.grand_parent.parent2 initialization
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child1. Latter declaration will be renamed to dut.grand_parent.parent2.child1_1
+
+In process: dut.grand_parent.parent2 @ 8 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child2. Latter declaration will be renamed to dut.grand_parent.parent2.child2_1
+
+In process: dut.grand_parent.parent2 @ 8 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child3. Latter declaration will be renamed to dut.grand_parent.parent2.child3_1
+
+In process: dut.grand_parent.parent2 @ 8 ns
 8 ns dut.grand_parent initialization
 
-8 ns dut.grand_parent.parent2.child1 initialization
-8 ns dut.grand_parent.parent2.child2 initialization
-8 ns dut.grand_parent.parent2.child3 initialization
+8 ns dut.grand_parent.parent2.child1_1 initialization
+8 ns dut.grand_parent.parent2.child2_1 initialization
+8 ns dut.grand_parent.parent2.child3_1 initialization
 12 ns stimulus issuing reset
 12 ns dut.grand_parent.parent1.child1 initialization
 12 ns dut.grand_parent.parent1.child2 initialization
 12 ns dut.grand_parent.parent1.child3 initialization
 12 ns dut.grand_parent.parent1 initialization
-12 ns dut.grand_parent.parent2.child1 initialization
-12 ns dut.grand_parent.parent2.child2 initialization
-12 ns dut.grand_parent.parent2.child3 initialization
+12 ns dut.grand_parent.parent2.child1_1 initialization
+12 ns dut.grand_parent.parent2.child2_1 initialization
+12 ns dut.grand_parent.parent2.child3_1 initialization
 12 ns dut.grand_parent.parent2 removing children
-12 ns dut.grand_parent.parent2.child1 got kill
-12 ns dut.grand_parent.parent2.child2 got kill
-12 ns dut.grand_parent.parent2.child3 got kill
+12 ns dut.grand_parent.parent2.child1_1 got kill
+12 ns dut.grand_parent.parent2.child2_1 got kill
+12 ns dut.grand_parent.parent2.child3_1 got kill
 12 ns dut.grand_parent.parent2 initialization
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child1. Latter declaration will be renamed to dut.grand_parent.parent2.child1_2
+
+In process: dut.grand_parent.parent2 @ 12 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child2. Latter declaration will be renamed to dut.grand_parent.parent2.child2_2
+
+In process: dut.grand_parent.parent2 @ 12 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child3. Latter declaration will be renamed to dut.grand_parent.parent2.child3_2
+
+In process: dut.grand_parent.parent2 @ 12 ns
 12 ns dut.grand_parent initialization
 
-12 ns dut.grand_parent.parent2.child1 initialization
-12 ns dut.grand_parent.parent2.child2 initialization
-12 ns dut.grand_parent.parent2.child3 initialization
+12 ns dut.grand_parent.parent2.child1_2 initialization
+12 ns dut.grand_parent.parent2.child2_2 initialization
+12 ns dut.grand_parent.parent2.child3_2 initialization
 16 ns stimulus issuing reset
 16 ns dut.grand_parent.parent1.child1 initialization
 16 ns dut.grand_parent.parent1.child2 initialization
 16 ns dut.grand_parent.parent1.child3 initialization
 16 ns dut.grand_parent.parent1 initialization
-16 ns dut.grand_parent.parent2.child1 initialization
-16 ns dut.grand_parent.parent2.child2 initialization
-16 ns dut.grand_parent.parent2.child3 initialization
+16 ns dut.grand_parent.parent2.child1_2 initialization
+16 ns dut.grand_parent.parent2.child2_2 initialization
+16 ns dut.grand_parent.parent2.child3_2 initialization
 16 ns dut.grand_parent.parent2 removing children
-16 ns dut.grand_parent.parent2.child1 got kill
-16 ns dut.grand_parent.parent2.child2 got kill
-16 ns dut.grand_parent.parent2.child3 got kill
+16 ns dut.grand_parent.parent2.child1_2 got kill
+16 ns dut.grand_parent.parent2.child2_2 got kill
+16 ns dut.grand_parent.parent2.child3_2 got kill
 16 ns dut.grand_parent.parent2 initialization
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child1. Latter declaration will be renamed to dut.grand_parent.parent2.child1_3
+
+In process: dut.grand_parent.parent2 @ 16 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child2. Latter declaration will be renamed to dut.grand_parent.parent2.child2_3
+
+In process: dut.grand_parent.parent2 @ 16 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child3. Latter declaration will be renamed to dut.grand_parent.parent2.child3_3
+
+In process: dut.grand_parent.parent2 @ 16 ns
 16 ns dut.grand_parent initialization
 
-16 ns dut.grand_parent.parent2.child1 initialization
-16 ns dut.grand_parent.parent2.child2 initialization
-16 ns dut.grand_parent.parent2.child3 initialization
+16 ns dut.grand_parent.parent2.child1_3 initialization
+16 ns dut.grand_parent.parent2.child2_3 initialization
+16 ns dut.grand_parent.parent2.child3_3 initialization
 20 ns stimulus issuing reset
 20 ns dut.grand_parent.parent1.child1 initialization
 20 ns dut.grand_parent.parent1.child2 initialization
 20 ns dut.grand_parent.parent1.child3 initialization
 20 ns dut.grand_parent.parent1 initialization
-20 ns dut.grand_parent.parent2.child1 initialization
-20 ns dut.grand_parent.parent2.child2 initialization
-20 ns dut.grand_parent.parent2.child3 initialization
+20 ns dut.grand_parent.parent2.child1_3 initialization
+20 ns dut.grand_parent.parent2.child2_3 initialization
+20 ns dut.grand_parent.parent2.child3_3 initialization
 20 ns dut.grand_parent.parent2 removing children
-20 ns dut.grand_parent.parent2.child1 got kill
-20 ns dut.grand_parent.parent2.child2 got kill
-20 ns dut.grand_parent.parent2.child3 got kill
+20 ns dut.grand_parent.parent2.child1_3 got kill
+20 ns dut.grand_parent.parent2.child2_3 got kill
+20 ns dut.grand_parent.parent2.child3_3 got kill
 20 ns dut.grand_parent.parent2 initialization
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child1. Latter declaration will be renamed to dut.grand_parent.parent2.child1_4
+
+In process: dut.grand_parent.parent2 @ 20 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child2. Latter declaration will be renamed to dut.grand_parent.parent2.child2_4
+
+In process: dut.grand_parent.parent2 @ 20 ns
+
+Warning: (W505) object already exists: dut.grand_parent.parent2.child3. Latter declaration will be renamed to dut.grand_parent.parent2.child3_4
+
+In process: dut.grand_parent.parent2 @ 20 ns
 20 ns dut.grand_parent initialization
 
-20 ns dut.grand_parent.parent2.child1 initialization
-20 ns dut.grand_parent.parent2.child2 initialization
-20 ns dut.grand_parent.parent2.child3 initialization
+20 ns dut.grand_parent.parent2.child1_4 initialization
+20 ns dut.grand_parent.parent2.child2_4 initialization
+20 ns dut.grand_parent.parent2.child3_4 initialization
 Program completed
diff --git a/src/systemc/tests/systemc/kernel/process_control/test07/golden/test07.log b/src/systemc/tests/systemc/kernel/process_control/test07/golden/test07.log
index 07bc056..3971e93 100644
--- a/src/systemc/tests/systemc/kernel/process_control/test07/golden/test07.log
+++ b/src/systemc/tests/systemc/kernel/process_control/test07/golden/test07.log
@@ -51,40 +51,74 @@
 ------ (400 ns) ------
  dut (sc_module)
   dut.parent (sc_thread_process) (running)
+   dut.parent.child0 (sc_thread_process) (terminated)
+    dut.parent.child0.grandchild (sc_thread_process) (terminated)
    dut.parent.child1 (sc_thread_process) (terminated)
+    dut.parent.child1.grandchild (sc_thread_process) (terminated)
     dut.parent.child1.dyn_obj (sc_object)
 ---------------------- 
 +++ dut.parent.child1.dyn_obj deleted
 ------ (500 ns) ------
  dut (sc_module)
   dut.parent (sc_thread_process) (running)
+   dut.parent.child0 (sc_thread_process) (terminated)
+    dut.parent.child0.grandchild (sc_thread_process) (terminated)
+   dut.parent.child1 (sc_thread_process) (terminated)
+    dut.parent.child1.grandchild (sc_thread_process) (terminated)
 ---------------------- 
-+++ dut.parent.child0 starting (500 ns)
-+++ dut.parent.child1 starting (500 ns)
+
+Warning: (W505) object already exists: dut.parent.child0. Latter declaration will be renamed to dut.parent.child0_0
+
+In process: dut.parent @ 500 ns
+
+Warning: (W505) object already exists: dut.parent.child1. Latter declaration will be renamed to dut.parent.child1_0
+
+In process: dut.parent @ 500 ns
++++ dut.parent.child0_0 starting (500 ns)
++++ dut.parent.child1_0 starting (500 ns)
 ------ (600 ns) ------
  dut (sc_module)
   dut.parent (sc_thread_process) (running)
-   dut.parent.child0 (sc_thread_process) (running)
-    dut.parent.child0.local (sc_object)
-   dut.parent.child1 (sc_thread_process) (running)
-    dut.parent.child1.local (sc_object)
+   dut.parent.child0 (sc_thread_process) (terminated)
+    dut.parent.child0.grandchild (sc_thread_process) (terminated)
+   dut.parent.child1 (sc_thread_process) (terminated)
+    dut.parent.child1.grandchild (sc_thread_process) (terminated)
+   dut.parent.child0_0 (sc_thread_process) (running)
+    dut.parent.child0_0.local (sc_object)
+   dut.parent.child1_0 (sc_thread_process) (running)
+    dut.parent.child1_0.local (sc_object)
 ---------------------- 
-+++ dut.parent.child1.grandchild starting (600 ns)
-+++ dut.parent.child0.grandchild starting (600 ns)
-+++ dut.parent.child0.local deleted
-+++ dut.parent.child1.grandchild.local deleted
-+++ dut.parent.child1.local deleted
++++ dut.parent.child0_0.grandchild starting (600 ns)
++++ dut.parent.child1_0.grandchild starting (600 ns)
++++ dut.parent.child0_0.local deleted
++++ dut.parent.child1_0.grandchild.local deleted
++++ dut.parent.child1_0.local deleted
 +++ kills sent ... (650 ns)
 ------ (700 ns) ------
  dut (sc_module)
   dut.parent (sc_thread_process) (running)
    dut.parent.child0 (sc_thread_process) (terminated)
-    dut.parent.child0.grandchild (sc_thread_process) (running)
-     dut.parent.child0.grandchild.local (sc_object)
+    dut.parent.child0.grandchild (sc_thread_process) (terminated)
+   dut.parent.child1 (sc_thread_process) (terminated)
+    dut.parent.child1.grandchild (sc_thread_process) (terminated)
+   dut.parent.child0_0 (sc_thread_process) (terminated)
+    dut.parent.child0_0.grandchild (sc_thread_process) (running)
+     dut.parent.child0_0.grandchild.local (sc_object)
+   dut.parent.child1_0 (sc_thread_process) (terminated)
+    dut.parent.child1_0.grandchild (sc_thread_process) (terminated)
 ---------------------- 
 +++ dut.parent exiting (700 ns)
-+++ dut.parent.child0.grandchild exiting (800 ns)
-+++ dut.parent.child0.grandchild.local deleted
++++ dut.parent.child0_0.grandchild exiting (800 ns)
++++ dut.parent.child0_0.grandchild.local deleted
 ------ (900 ns) ------
  dut (sc_module)
+  dut.parent (sc_thread_process) (terminated)
+   dut.parent.child0 (sc_thread_process) (terminated)
+    dut.parent.child0.grandchild (sc_thread_process) (terminated)
+   dut.parent.child1 (sc_thread_process) (terminated)
+    dut.parent.child1.grandchild (sc_thread_process) (terminated)
+   dut.parent.child0_0 (sc_thread_process) (terminated)
+    dut.parent.child0_0.grandchild (sc_thread_process) (terminated)
+   dut.parent.child1_0 (sc_thread_process) (terminated)
+    dut.parent.child1_0.grandchild (sc_thread_process) (terminated)
 ----------------------