sc_clock.hh (12931:2dd5b061490b) sc_clock.hh (13065:eec7d19ac479)
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

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

28 */
29
30#ifndef __SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
31#define __SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
32
33#include "../core/sc_time.hh"
34#include "sc_signal.hh"
35
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

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

28 */
29
30#ifndef __SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
31#define __SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
32
33#include "../core/sc_time.hh"
34#include "sc_signal.hh"
35
36namespace sc_gem5
37{
38
39class ClockTick;
40
41} // namespace sc_gem5
42
36namespace sc_core
37{
38
39template <class T>
40class sc_in;
41
42class sc_time;
43

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

69 const sc_time &period() const;
70 double duty_cycle() const;
71 const sc_time &start_time() const;
72 bool posedge_first() const;
73
74 // Nonstandard
75 static const sc_time &time_stamp();
76
43namespace sc_core
44{
45
46template <class T>
47class sc_in;
48
49class sc_time;
50

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

76 const sc_time &period() const;
77 double duty_cycle() const;
78 const sc_time &start_time() const;
79 bool posedge_first() const;
80
81 // Nonstandard
82 static const sc_time &time_stamp();
83
77 virtual const char *kind() const;
84 virtual const char *kind() const { return "sc_clock"; }
78
79 protected:
80 virtual void before_end_of_elaboration();
81
82 private:
85
86 protected:
87 virtual void before_end_of_elaboration();
88
89 private:
90 friend class ::sc_gem5::ClockTick;
91
83 // Disabled
84 sc_clock(const sc_clock &) : sc_interface(), sc_signal<bool>() {}
85 sc_clock &operator = (const sc_clock &) { return *this; }
92 // Disabled
93 sc_clock(const sc_clock &) : sc_interface(), sc_signal<bool>() {}
94 sc_clock &operator = (const sc_clock &) { return *this; }
95
96 sc_time _period;
97 double _dutyCycle;
98 sc_time _startTime;
99 bool _posedgeFirst;
100
101 ::sc_gem5::ClockTick *_gem5UpEdge;
102 ::sc_gem5::ClockTick *_gem5DownEdge;
103
104 void tickUp() { sc_signal<bool>::write(true); }
105 void tickDown() { sc_signal<bool>::write(false); }
86};
87
88typedef sc_in<bool> sc_in_clk;
89
90// Deprecated
91typedef sc_inout<bool> sc_inout_clk;
92typedef sc_out<bool> sc_out_clk;
93
94} // namespace sc_core
95
96#endif //__SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__
106};
107
108typedef sc_in<bool> sc_in_clk;
109
110// Deprecated
111typedef sc_inout<bool> sc_inout_clk;
112typedef sc_out<bool> sc_out_clk;
113
114} // namespace sc_core
115
116#endif //__SYSTEMC_EXT_CHANNEL_SC_CLOCK_HH__