sc_main.cc (12982:c7966254372e) sc_main.cc (12990:19d91b53e04e)
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

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

142{
143 Tick now = ::sc_gem5::scheduler.getCurTick();
144 sc_start(sc_time::from_value(MaxTick - now), SC_EXIT_ON_STARVATION);
145}
146
147void
148sc_pause()
149{
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

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

142{
143 Tick now = ::sc_gem5::scheduler.getCurTick();
144 sc_start(sc_time::from_value(MaxTick - now), SC_EXIT_ON_STARVATION);
145}
146
147void
148sc_pause()
149{
150 if (::sc_gem5::kernel->status() == SC_RUNNING)
150 if (::sc_gem5::Kernel::status() == SC_RUNNING)
151 ::sc_gem5::scheduler.schedulePause();
152}
153
154void
155sc_start(const sc_time &time, sc_starvation_policy p)
156{
157 Tick now = ::sc_gem5::scheduler.getCurTick();
158 ::sc_gem5::scheduler.start(now + time.value(), p == SC_RUN_TO_TIME);

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

173sc_get_stop_mode()
174{
175 return _stop_mode;
176}
177
178void
179sc_stop()
180{
151 ::sc_gem5::scheduler.schedulePause();
152}
153
154void
155sc_start(const sc_time &time, sc_starvation_policy p)
156{
157 Tick now = ::sc_gem5::scheduler.getCurTick();
158 ::sc_gem5::scheduler.start(now + time.value(), p == SC_RUN_TO_TIME);

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

173sc_get_stop_mode()
174{
175 return _stop_mode;
176}
177
178void
179sc_stop()
180{
181 if (::sc_gem5::kernel->status() == SC_STOPPED)
181 if (::sc_gem5::Kernel::status() == SC_STOPPED)
182 return;
183
184 if (sc_is_running()) {
185 bool finish_delta = (_stop_mode == SC_STOP_FINISH_DELTA);
186 ::sc_gem5::scheduler.scheduleStop(finish_delta);
187 } else {
182 return;
183
184 if (sc_is_running()) {
185 bool finish_delta = (_stop_mode == SC_STOP_FINISH_DELTA);
186 ::sc_gem5::scheduler.scheduleStop(finish_delta);
187 } else {
188 ::sc_gem5::kernel->stop();
188 ::sc_gem5::Kernel::stop();
189 }
190}
191
192const sc_time &
193sc_time_stamp()
194{
195 static sc_time tstamp;
196 Tick tick = ::sc_gem5::scheduler.getCurTick();

--- 49 unchanged lines hidden ---
189 }
190}
191
192const sc_time &
193sc_time_stamp()
194{
195 static sc_time tstamp;
196 Tick tick = ::sc_gem5::scheduler.getCurTick();

--- 49 unchanged lines hidden ---