1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33 34 35
36 package ti.uia.family.c64p;
37
38 import xdc.runtime.Types;
39
40 /*!
41 * ======== TimestampC6474Timer.xdc ========
42 * Implementation of `{@link ITimestampProvider}` using C6474 General purpose
43 * 64b timer
44 */
45 @ModuleStartup
46 module TimestampC6474Timer inherits ti.uia.runtime.IUIATimestampProvider {
47
48 /*!
49 * ======== TimerInstance ========
50 * Enumeration that defines the base addresses for each timer instance
51 * of the TMS6474 device.
52 * Timer2 is used by default.
53 */
54 enum TimerInstance {
55 TimerInstance_Timer0 = 0x02910000,
56 TimerInstance_Timer1 = 0x02920000,
57 TimerInstance_Timer2 = 0x02930000,
58 TimerInstance_Timer3 = 0x02940000,
59 TimerInstance_Timer4 = 0x02950000,
60 TimerInstance_Timer5 = 0x02960000
61 };
62
63 /*!
64 * ======== timerBaseAdrs ========
65 * Base address of the timer to be used as the global timer that provides
66 * a common time reference for all CPUs.
67 *
68 * This timer will be used to enable multicore event correlation.
69 * @a(Example)
70 * Example showing .cfg script to configure the timerBaseAdrs:
71 * @p(code)
72 * var GlobalTimestampTimer = xdc.useModule('ti.uia.family.c64p.TimestampC6474Timer');
73 * GlobalTimestampTimer.timerBaseAdrs = GlobalTimestampTimer.TimerInstance_Timer3;
74 * @p
75 */
76 config TimerInstance timerBaseAdrs = TimerInstance_Timer2;
77
78 /*!
79 * ======== maxTimerClockFreq =========
80 * The highest timer clock frequency.
81 *
82 * The default ticks per second rate of the timer is calculated by dividing
83 * the timer's bus clock frequency by the cyclesPerTick config parameter.
84 */
85 override config Types.FreqHz maxTimerClockFreq;
86
87
88 /*!
89 * ======== maxBusClockFreq =========
90 * The highest bus clock frequency used to drive the timer.
91 *
92 * The default ticks per second rate of the timer is calculated by dividing
93 * the timer's bus clock frequency by the cyclesPerTick config parameter.
94 */
95 override config Types.FreqHz maxBusClockFreq;
96
97 /*!
98 * ======== canFrequencyBeChanged =========
99 * Indicates whether the timer frequency can be changed or not
100 *
101 * @a(returns) true if the timer's clock frequency can be changed
102 */
103 override metaonly config Bool canFrequencyBeChanged = false;
104
105 /*!
106 * ======== cpuCyclesPerTick =========
107 * The number of CPU cycles each tick of the timestamp corresponds to
108 *
109 * A value of 0 indicates that no conversion between the timer's tick count
110 * and CPU cycles is possible.
111 */
112 override metaonly config UInt32 cpuCyclesPerTick = 6;
113
114
115 /*!
116 * ======== canCpuCyclesPerTickBeChanged =========
117 * Indicates whether the timer's cycles per tick divide down ratio can be
118 * changed or not
119 *
120 * @a(returns) true if the timer's CPU cycles per tick can be changed
121 */
122 override metaonly config Bool canCpuCyclesPerTickBeChanged = false;
123 /*!
124 * ======== get32 ========
125 * Return a 32-bit timestamp
126 *
127 * @a(returns)
128 * Returns a 32-bit timestamp value.
129 * Use `{@link #getFreq}` to convert this value into units of real time.
130 *
131 * @see #get64
132 */
133 @DirectCall
134 override Bits32 get32();
135
136 /*!
137 * ======== get64 ========
138 * Return a 64-bit timestamp
139 *
140 * @param(result) pointer to 64-bit result
141 *
142 * This parameter is a pointer to a structure representing a 64-bit
143 * wide timestamp value where the current timestamp is written.
144 *
145 * If the underlying hardware does not support 64-bit resolution, the
146 * `hi` field of `result` is always set to 0; see
147 * `{@link xdc.runtime.Types#Timestamp64}`. So, it is possible for
148 * the `lo` field to wrap around without any change to the `hi` field.
149 * Use `{@link #getFreq}` to convert this value into units of real
150 * time.
151 *
152 * @see #get32
153 */
154 @DirectCall
155 override Void get64(Types.Timestamp64 *result);
156
157 /*!
158 * ======== getFreq ========
159 * Get the timestamp timer's frequency (in Hz)
160 *
161 * @param(freq) pointer to a 64-bit result
162 *
163 * This parameter is a pointer to a structure representing a 64-bit
164 * wide frequency value where the timer's frequency (in Hz)
165 * is written; see `{@link xdc.runtime.Types#FreqHz}`.
166 * This function provides a way of converting timestamp
167 * values into units of real time.
168 *
169 * @see #get32
170 * @see #get64
171 */
172 @DirectCall
173 override Void getFreq(Types.FreqHz *freq);
174
175 instance:
176 }
177
178 179
180 181 182 183