clock_domain.hh (9793:6e6cefc1db1f) clock_domain.hh (9827:f47274776aa0)
1/*
2 * Copyright (c) 2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

51#include "params/DerivedClockDomain.hh"
52#include "params/SrcClockDomain.hh"
53#include "sim/sim_object.hh"
54
55/**
56 * Forward declaration
57 */
58class DerivedClockDomain;
1/*
2 * Copyright (c) 2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

51#include "params/DerivedClockDomain.hh"
52#include "params/SrcClockDomain.hh"
53#include "sim/sim_object.hh"
54
55/**
56 * Forward declaration
57 */
58class DerivedClockDomain;
59class VoltageDomain;
59
60/**
61 * The ClockDomain provides clock to group of clocked objects bundled
60
61/**
62 * The ClockDomain provides clock to group of clocked objects bundled
62 * under the same clock domain. The clock domains provide support for
63 * under the same clock domain. The clock domains, in turn, are
64 * grouped into voltage domains. The clock domains provide support for
63 * a hierarchial structure with source and derived domains.
64 */
65class ClockDomain : public SimObject
66{
67
68 protected:
69
70 /**
71 * Pre-computed clock period in ticks. This is populated by the
72 * inheriting classes based on how their period is determined.
73 */
74 Tick _clockPeriod;
75
76 /**
65 * a hierarchial structure with source and derived domains.
66 */
67class ClockDomain : public SimObject
68{
69
70 protected:
71
72 /**
73 * Pre-computed clock period in ticks. This is populated by the
74 * inheriting classes based on how their period is determined.
75 */
76 Tick _clockPeriod;
77
78 /**
79 * Voltage domain this clock domain belongs to
80 */
81 VoltageDomain *_voltageDomain;
82
83 /**
77 * Pointers to potential derived clock domains so we can propagate
78 * changes.
79 */
80 std::vector<DerivedClockDomain*> children;
81
82 public:
83
84 typedef ClockDomainParams Params;
84 * Pointers to potential derived clock domains so we can propagate
85 * changes.
86 */
87 std::vector<DerivedClockDomain*> children;
88
89 public:
90
91 typedef ClockDomainParams Params;
85 ClockDomain(const Params *p) : SimObject(p), _clockPeriod(0) {}
92 ClockDomain(const Params *p, VoltageDomain *voltage_domain) :
93 SimObject(p),
94 _clockPeriod(0),
95 _voltageDomain(voltage_domain) {}
86
87 /**
88 * Get the clock period.
89 *
90 * @return Clock period in ticks
91 */
92 inline Tick clockPeriod() const { return _clockPeriod; }
93
94 /**
96
97 /**
98 * Get the clock period.
99 *
100 * @return Clock period in ticks
101 */
102 inline Tick clockPeriod() const { return _clockPeriod; }
103
104 /**
105 * Get the voltage domain.
106 *
107 * @return Voltage domain this clock domain belongs to
108 */
109 inline VoltageDomain *voltageDomain() const { return _voltageDomain; }
110
111
112 /**
113 * Get the current voltage this clock domain operates at.
114 *
115 * @return Voltage applied to the clock domain
116 */
117 inline double voltage() const;
118
119 /**
95 * Add a derived domain.
96 *
97 * @param Derived domain to add as a child
98 */
99 void addDerivedDomain(DerivedClockDomain *clock_domain)
100 { children.push_back(clock_domain); }
101
102};

--- 58 unchanged lines hidden ---
120 * Add a derived domain.
121 *
122 * @param Derived domain to add as a child
123 */
124 void addDerivedDomain(DerivedClockDomain *clock_domain)
125 { children.push_back(clock_domain); }
126
127};

--- 58 unchanged lines hidden ---