Deleted Added
sdiff udiff text old ( 13185:286a48639227 ) new ( 13188:7af408b60cac )
full compact
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

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

89}
90
91void
92Kernel::regStats()
93{
94 if (scMainDone || stopAfterCallbacks)
95 return;
96
97 for (auto m: sc_gem5::allModules)
98 for (auto p: m->ports)
99 p->_gem5Finalize();
100
101 status(::sc_core::SC_END_OF_ELABORATION);
102 for (auto m: sc_gem5::allModules) {
103 callbackModule(m);
104 m->sc_mod()->end_of_elaboration();
105 for (auto p: m->ports)
106 p->end_of_elaboration();
107 for (auto e: m->exports)
108 e->end_of_elaboration();
109 }
110 callbackModule(nullptr);
111 for (auto c: sc_gem5::allChannels)
112 c->sc_chan()->end_of_elaboration();
113}
114
115void
116Kernel::startup()
117{
118 if (scMainDone)
119 return;
120
121 schedule(t0Event, curTick());
122
123 if (stopAfterCallbacks)
124 return;
125
126 status(::sc_core::SC_START_OF_SIMULATION);
127 for (auto m: sc_gem5::allModules) {
128 m->sc_mod()->start_of_simulation();
129 for (auto p: m->ports)
130 p->start_of_simulation();
131 for (auto e: m->exports)
132 e->start_of_simulation();
133 }
134 for (auto c: sc_gem5::allChannels)
135 c->sc_chan()->start_of_simulation();
136
137 startComplete = true;
138
139 if (stopAfterCallbacks)
140 stopWork();
141
142 kernel->status(::sc_core::SC_RUNNING);
143}

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

150 else
151 stopWork();
152}
153
154void
155Kernel::stopWork()
156{
157 status(::sc_core::SC_END_OF_SIMULATION);
158 for (auto m: sc_gem5::allModules) {
159 m->sc_mod()->end_of_simulation();
160 for (auto p: m->ports)
161 p->end_of_simulation();
162 for (auto e: m->exports)
163 e->end_of_simulation();
164 }
165 for (auto c: sc_gem5::allChannels)
166 c->sc_chan()->end_of_simulation();
167
168 endComplete = true;
169
170 status(::sc_core::SC_STOPPED);
171}
172
173void
174Kernel::t0Handler()

--- 23 unchanged lines hidden ---