process.hh (12991:9d018d22aefd) process.hh (12997:cfc14d8f4725)
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#ifndef __SYSTEMC_CORE_PROCESS_HH__
31#define __SYSTEMC_CORE_PROCESS_HH__
32
33#include <functional>
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#ifndef __SYSTEMC_CORE_PROCESS_HH__
31#define __SYSTEMC_CORE_PROCESS_HH__
32
33#include <functional>
34#include <memory>
34#include <vector>
35
36#include "base/fiber.hh"
37#include "sim/eventq.hh"
38#include "systemc/core/bindinfo.hh"
39#include "systemc/core/list.hh"
40#include "systemc/core/object.hh"
41#include "systemc/ext/core/sc_event.hh"
42#include "systemc/ext/core/sc_export.hh"
43#include "systemc/ext/core/sc_interface.hh"
44#include "systemc/ext/core/sc_module.hh"
45#include "systemc/ext/core/sc_port.hh"
46#include "systemc/ext/core/sc_process_handle.hh"
35#include <vector>
36
37#include "base/fiber.hh"
38#include "sim/eventq.hh"
39#include "systemc/core/bindinfo.hh"
40#include "systemc/core/list.hh"
41#include "systemc/core/object.hh"
42#include "systemc/ext/core/sc_event.hh"
43#include "systemc/ext/core/sc_export.hh"
44#include "systemc/ext/core/sc_interface.hh"
45#include "systemc/ext/core/sc_module.hh"
46#include "systemc/ext/core/sc_port.hh"
47#include "systemc/ext/core/sc_process_handle.hh"
48#include "systemc/ext/utils/sc_report.hh"
47
48namespace sc_gem5
49{
50
51class Sensitivity
52{
53 protected:
54 Process *process;

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

265
266class Process : public ::sc_core::sc_object, public ListNode
267{
268 public:
269 virtual ::sc_core::sc_curr_proc_kind procKind() const = 0;
270 bool needsStart() const { return _needsStart; }
271 bool dynamic() const { return _dynamic; }
272 bool isUnwinding() const { return _isUnwinding; }
49
50namespace sc_gem5
51{
52
53class Sensitivity
54{
55 protected:
56 Process *process;

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

267
268class Process : public ::sc_core::sc_object, public ListNode
269{
270 public:
271 virtual ::sc_core::sc_curr_proc_kind procKind() const = 0;
272 bool needsStart() const { return _needsStart; }
273 bool dynamic() const { return _dynamic; }
274 bool isUnwinding() const { return _isUnwinding; }
275 void isUnwinding(bool v) { _isUnwinding = v; }
273 bool terminated() const { return _terminated; }
274
275 void forEachKid(const std::function<void(Process *)> &work);
276
277 bool suspended() const { return _suspended; }
278 bool disabled() const { return _disabled; }
279
280 void suspend(bool inc_kids);

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

313 void satisfySensitivity(Sensitivity *);
314
315 void ready();
316
317 virtual Fiber *fiber() { return Fiber::primaryFiber(); }
318
319 static Process *newest() { return _newest; }
320
276 bool terminated() const { return _terminated; }
277
278 void forEachKid(const std::function<void(Process *)> &work);
279
280 bool suspended() const { return _suspended; }
281 bool disabled() const { return _disabled; }
282
283 void suspend(bool inc_kids);

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

316 void satisfySensitivity(Sensitivity *);
317
318 void ready();
319
320 virtual Fiber *fiber() { return Fiber::primaryFiber(); }
321
322 static Process *newest() { return _newest; }
323
324 void lastReport(::sc_core::sc_report *report);
325 ::sc_core::sc_report *lastReport() const;
326
321 protected:
322 Process(const char *name, ProcessFuncWrapper *func, bool _dynamic,
323 bool needs_start);
324
325 static Process *_newest;
326
327 virtual ~Process()
328 {

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

350 int refCount;
351
352 size_t stackSize;
353
354 Sensitivities staticSensitivities;
355 PendingSensitivities pendingStaticSensitivities;
356
357 Sensitivity *dynamicSensitivity;
327 protected:
328 Process(const char *name, ProcessFuncWrapper *func, bool _dynamic,
329 bool needs_start);
330
331 static Process *_newest;
332
333 virtual ~Process()
334 {

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

356 int refCount;
357
358 size_t stackSize;
359
360 Sensitivities staticSensitivities;
361 PendingSensitivities pendingStaticSensitivities;
362
363 Sensitivity *dynamicSensitivity;
364
365 std::unique_ptr<::sc_core::sc_report> _lastReport;
358};
359
360inline void
361Sensitivity::notifyWork(Event *e)
362{
363 process->satisfySensitivity(this);
364}
365

--- 16 unchanged lines hidden ---
366};
367
368inline void
369Sensitivity::notifyWork(Event *e)
370{
371 process->satisfySensitivity(this);
372}
373

--- 16 unchanged lines hidden ---