object.cc (12952:94fca7e8120b) object.cc (12953:ddfd5e4643a9)
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 17 unchanged lines hidden (view full) ---

26 *
27 * Authors: Gabe Black
28 */
29
30#include "systemc/core/object.hh"
31
32#include "base/logging.hh"
33#include "systemc/core/module.hh"
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 17 unchanged lines hidden (view full) ---

26 *
27 * Authors: Gabe Black
28 */
29
30#include "systemc/core/object.hh"
31
32#include "base/logging.hh"
33#include "systemc/core/module.hh"
34#include "systemc/core/scheduler.hh"
34
35namespace sc_gem5
36{
37
38namespace
39{
40
41ObjectsIt

--- 40 unchanged lines hidden (view full) ---

82 n->finish(this);
83 }
84
85 if (p) {
86 // We're "within" a parent module, ie we're being created while its
87 // constructor is running.
88 parent = p->obj()->sc_obj;
89 addObject(&parent->_gem5_object->children, sc_obj);
35
36namespace sc_gem5
37{
38
39namespace
40{
41
42ObjectsIt

--- 40 unchanged lines hidden (view full) ---

83 n->finish(this);
84 }
85
86 if (p) {
87 // We're "within" a parent module, ie we're being created while its
88 // constructor is running.
89 parent = p->obj()->sc_obj;
90 addObject(&parent->_gem5_object->children, sc_obj);
90 } else if (false /* TODO Check if a process is running */) {
91 // The process is our parent.
91 } else if (scheduler.current()) {
92 // Our parent is the currently running process.
93 parent = scheduler.current();
92 } else {
93 // We're a top level object.
94 addObject(&topLevelObjects, sc_obj);
95 }
96
97 addObject(&allObjects, sc_obj);
98
99 _name = _basename;

--- 137 unchanged lines hidden ---
94 } else {
95 // We're a top level object.
96 addObject(&topLevelObjects, sc_obj);
97 }
98
99 addObject(&allObjects, sc_obj);
100
101 _name = _basename;

--- 137 unchanged lines hidden ---