Deleted Added
sdiff udiff text old ( 13087:1df34ed84a4b ) new ( 13128:60311a75e876 )
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

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

27 * Authors: Gabe Black
28 */
29
30#include "base/logging.hh"
31#include "systemc/core/process.hh"
32#include "systemc/core/scheduler.hh"
33#include "systemc/ext/core/sc_main.hh"
34#include "systemc/ext/core/sc_process_handle.hh"
35
36namespace sc_core
37{
38
39const char *
40sc_unwind_exception::what() const throw()
41{
42 return _isReset ? "RESET" : "KILL";

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

191sc_process_handle::terminated() const
192{
193 return _gem5_process ? _gem5_process->terminated() : false;
194}
195
196const sc_event &
197sc_process_handle::terminated_event() const
198{
199 static sc_event non_event;
200 return _gem5_process ? _gem5_process->terminatedEvent() : non_event;
201}
202
203
204void
205sc_process_handle::suspend(sc_descendent_inclusion_info include_descendants)
206{
207 if (!_gem5_process)
208 return;
209 _gem5_process->suspend(include_descendants == SC_INCLUDE_DESCENDANTS);
210}
211
212void
213sc_process_handle::resume(sc_descendent_inclusion_info include_descendants)
214{
215 if (!_gem5_process)
216 return;
217 _gem5_process->resume(include_descendants == SC_INCLUDE_DESCENDANTS);
218}
219
220void
221sc_process_handle::disable(sc_descendent_inclusion_info include_descendants)
222{
223 if (!_gem5_process)
224 return;
225 _gem5_process->disable(include_descendants == SC_INCLUDE_DESCENDANTS);
226}
227
228void
229sc_process_handle::enable(sc_descendent_inclusion_info include_descendants)
230{
231 if (!_gem5_process)
232 return;
233 _gem5_process->enable(include_descendants == SC_INCLUDE_DESCENDANTS);
234}
235
236void
237sc_process_handle::kill(sc_descendent_inclusion_info include_descendants)
238{
239 if (!_gem5_process)
240 return;
241 _gem5_process->kill(include_descendants == SC_INCLUDE_DESCENDANTS);
242}
243
244void
245sc_process_handle::reset(sc_descendent_inclusion_info include_descendants)
246{
247 if (!_gem5_process)
248 return;
249 _gem5_process->reset(include_descendants == SC_INCLUDE_DESCENDANTS);
250}
251
252bool
253sc_process_handle::is_unwinding()
254{
255 if (!_gem5_process) {
256 //TODO This should generate a systemc style warning if the handle is
257 //invalid.
258 return false;
259 } else {
260 return _gem5_process->isUnwinding();
261 }
262}
263
264const sc_event &
265sc_process_handle::reset_event() const
266{
267 static sc_event non_event;
268 return _gem5_process ? _gem5_process->resetEvent() : non_event;
269}
270
271
272void
273sc_process_handle::sync_reset_on(
274 sc_descendent_inclusion_info include_descendants)
275{
276 if (!_gem5_process)
277 return;
278 _gem5_process->syncResetOn(include_descendants == SC_INCLUDE_DESCENDANTS);
279}
280
281void
282sc_process_handle::sync_reset_off(
283 sc_descendent_inclusion_info include_descendants)
284{
285 if (!_gem5_process)
286 return;
287 _gem5_process->syncResetOff(include_descendants == SC_INCLUDE_DESCENDANTS);
288}
289
290
291sc_process_handle
292sc_get_current_process_handle()
293{
294 if (sc_is_running())

--- 14 unchanged lines hidden ---