sc_clock.cc (13065:eec7d19ac479) sc_clock.cc (13135:4bb2f323fb1a)
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 "base/types.hh"
32#include "sim/core.hh"
33#include "sim/eventq.hh"
34#include "systemc/core/kernel.hh"
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 "base/types.hh"
32#include "sim/core.hh"
33#include "sim/eventq.hh"
34#include "systemc/core/kernel.hh"
35#include "systemc/core/process_types.hh"
35#include "systemc/core/sched_event.hh"
36#include "systemc/core/scheduler.hh"
37#include "systemc/ext/channel/sc_clock.hh"
38#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name
39
40namespace sc_gem5
41{
42

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

55 ::sc_core::sc_time _period) :
56 ScEvent([this]() { tick(); }),
57 clock(clock), _period(_period), _name(clock->name()),
58 funcWrapper(clock, to ? &::sc_core::sc_clock::tickUp :
59 &::sc_core::sc_clock::tickDown)
60 {
61 _name += (to ? ".up_tick" : ".down_tick");
62 _procName = _name + ".p";
36#include "systemc/core/sched_event.hh"
37#include "systemc/core/scheduler.hh"
38#include "systemc/ext/channel/sc_clock.hh"
39#include "systemc/ext/core/sc_module.hh" // for sc_gen_unique_name
40
41namespace sc_gem5
42{
43

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

56 ::sc_core::sc_time _period) :
57 ScEvent([this]() { tick(); }),
58 clock(clock), _period(_period), _name(clock->name()),
59 funcWrapper(clock, to ? &::sc_core::sc_clock::tickUp :
60 &::sc_core::sc_clock::tickDown)
61 {
62 _name += (to ? ".up_tick" : ".down_tick");
63 _procName = _name + ".p";
63 p = newMethodProcess(_procName.c_str(), &funcWrapper);
64 p = new Method(_procName.c_str(), &funcWrapper);
65 scheduler.reg(p);
64 scheduler.dontInitialize(p);
65 }
66
67 ~ClockTick()
68 {
69 if (scheduled())
70 scheduler.deschedule(this);
71 p->popListNode();

--- 97 unchanged lines hidden ---
66 scheduler.dontInitialize(p);
67 }
68
69 ~ClockTick()
70 {
71 if (scheduled())
72 scheduler.deschedule(this);
73 p->popListNode();

--- 97 unchanged lines hidden ---