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>
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"
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; }
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
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;
366};
367
368inline void
369Sensitivity::notifyWork(Event *e)
370{
371 process->satisfySensitivity(this);
372}
373

--- 16 unchanged lines hidden ---