CC35xxDriverLibrary
hw_icache.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: hw_icache.h
3 *
4 * Description: Defines and prototypes for the ICACHE peripheral.
5 *
6 * Copyright (c) 2023, Texas Instruments Incorporated
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1) Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2) Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36 #ifndef __HW_ICACHE_H__
37 #define __HW_ICACHE_H__
38 /*-------------------------------------------------------------------------------
39 
40 This section defines the register offsets of the ICACHE component
41 
42 --------------------------------------------------------------------------------- */
43 
44 //The Module and Version Register identifies the module identifier and revision of the icache module
45 #define ICACHE_O_MOD_VERSION 0x00000000U
46 
47 //The control register defines the size of the remote cache data storage memory to use and whether the icache controller is enabled
48 #define ICACHE_O_CTRL 0x00000004U
49 
50 //The Status register displays the state of the icache controller
51 #define ICACHE_O_STATUS 0x00000008U
52 
53 // The Cache Address Low Register defines start of the cacheable space
54 #define ICACHE_O_CACHE_ADDRESS_LOW 0x00000010U
55 
56 // The L1 Cache Address High Register defines end of the L1 cacheable space
57 #define ICACHE_O_CACHE_ADDRESS_HIGH 0x00000018U
58 
59 // The RAM Address register defines the upper 17 bits of address for the RAM when renable is set
60 #define ICACHE_O_REGISTER_ADDRESS 0x00000020U
61 
62 // The HIT Counter register holds the number of cache Hits to the internal cache
63 #define ICACHE_O_HIT_COUNTER 0x00000040U
64 
65 //The MISS Counter register holds the number of cache misses to the internal cache
66 #define ICACHE_O_MISS_COUNTER 0x00000044U
67 
68 // The Interrupt Raw Status Register holds the raw status of the icache error interrupts
69 #define ICACHE_O_IRQ_STATUS_RAW 0x00000080U
70 
71 //The Interrupt Masked Status Register holds the masked status for the icache error interrupts
72 #define ICACHE_O_IRQ_STATUS_MASK 0x00000084U
73 
74 //The Interrupt Enable Set Register holds the interrupt enable status of the icache error interrupts
75 #define ICACHE_O_IRQ_ENABLE_SET 0x00000088U
76 
77 //The Interrupt Enable Clear Register holds the interrupt enable status of the icache error interrupts
78 #define ICACHE_O_IRQ_ENABLE_CLR 0x0000008CU
79 
80 
81 
82 /*-----------------------------------REGISTER------------------------------------
83  Register name: MOD_VERSION
84  Offset name: ICACHE_O_MOD_VERSION
85  Relative address: 0x0
86  Description: The Module and Version Register identifies the module identifier and revision of the icache module.
87  Default Value: 0x00000000
88 
89  Field: MINOR_REVISION
90  From..to bits: 0...5
91  DefaultValue: 0x0
92  Access type: read-only
93  Description: Minor revision
94 
95 */
96 #define ICACHE_MOD_VERSION_MINOR_REVISION_W 6U
97 #define ICACHE_MOD_VERSION_MINOR_REVISION_M 0x0000003FU
98 #define ICACHE_MOD_VERSION_MINOR_REVISION_S 0U
99 /*
100 
101  Field: CUSTOM_REVISION
102  From..to bits: 6...7
103  DefaultValue: 0x0
104  Access type: read-only
105  Description: Custom Revision
106 
107 */
108 #define ICACHE_MOD_VERSION_CUSTOM_REVISION_W 2U
109 #define ICACHE_MOD_VERSION_CUSTOM_REVISION_M 0x000000C0U
110 #define ICACHE_MOD_VERSION_CUSTOM_REVISION_S 6U
111 /*
112 
113  Field: MAJOR_REVISION
114  From..to bits: 8...10
115  DefaultValue: 0x0
116  Access type: read-only
117  Description: Major Revision
118 
119 */
120 #define ICACHE_MOD_VERSION_MAJOR_REVISION_W 3U
121 #define ICACHE_MOD_VERSION_MAJOR_REVISION_M 0x00000700U
122 #define ICACHE_MOD_VERSION_MAJOR_REVISION_S 8U
123 /*
124 
125  Field: RTL_VERSION
126  From..to bits: 11...15
127  DefaultValue: 0x0
128  Access type: read-only
129  Description: RTL version
130 
131 */
132 #define ICACHE_MOD_VERSION_RTL_VERSION_W 5U
133 #define ICACHE_MOD_VERSION_RTL_VERSION_M 0x0000F800U
134 #define ICACHE_MOD_VERSION_RTL_VERSION_S 11U
135 /*
136 
137  Field: MODULE_ID
138  From..to bits: 16...27
139  DefaultValue: 0x0
140  Access type: read-only
141  Description: Module ID
142 
143 */
144 #define ICACHE_MOD_VERSION_MODULE_ID_W 12U
145 #define ICACHE_MOD_VERSION_MODULE_ID_M 0x0FFF0000U
146 #define ICACHE_MOD_VERSION_MODULE_ID_S 16U
147 /*
148 
149  Field: BU
150  From..to bits: 28...29
151  DefaultValue: 0x0
152  Access type: read-only
153  Description: Module Business Unit
154 
155 */
156 #define ICACHE_MOD_VERSION_BU_W 2U
157 #define ICACHE_MOD_VERSION_BU_M 0x30000000U
158 #define ICACHE_MOD_VERSION_BU_S 28U
159 /*
160 
161  Field: SCHEME
162  From..to bits: 30...31
163  DefaultValue: 0x0
164  Access type: read-only
165  Description: Module Scheme
166 
167 */
168 #define ICACHE_MOD_VERSION_SCHEME_W 2U
169 #define ICACHE_MOD_VERSION_SCHEME_M 0xC0000000U
170 #define ICACHE_MOD_VERSION_SCHEME_S 30U
171 
172 
173 /*-----------------------------------REGISTER------------------------------------
174  Register name: CTRL
175  Offset name: ICACHE_O_CTRL
176  Relative address: 0x4
177  Description: The control register defines the size of the remote cache data storage memory to use and whether the icache controller is enabled.
178  Default Value: NA
179 
180  Field: MEM_RENABLE
181  From..to bits: 30...30
182  DefaultValue: NA
183  Access type: read-write
184  Description: .
185 
186 */
187 #define ICACHE_CTRL_MEM_RENABLE 0x40000000U
188 #define ICACHE_CTRL_MEM_RENABLE_M 0x40000000U
189 #define ICACHE_CTRL_MEM_RENABLE_S 30U
190 /*
191 
192  Field: MEM_CENABLE
193  From..to bits: 31...31
194  DefaultValue: NA
195  Access type: read-write
196  Description: .
197 
198 */
199 #define ICACHE_CTRL_MEM_CENABLE 0x80000000U
200 #define ICACHE_CTRL_MEM_CENABLE_M 0x80000000U
201 #define ICACHE_CTRL_MEM_CENABLE_S 31U
202 
203 
204 /*-----------------------------------REGISTER------------------------------------
205  Register name: STATUS
206  Offset name: ICACHE_O_STATUS
207  Relative address: 0x8
208  Description: The Status register displays the state of the icache controller.
209  Default Value: NA
210 
211  Field: OK_TO_GO
212  From..to bits: 31...31
213  DefaultValue: NA
214  Access type: read-only
215  Description: The ok_to_go status bit indicates the Tag/LRU Ram has been initialized and the cache is in an operable state.
216 
217 */
218 #define ICACHE_STATUS_OK_TO_GO 0x80000000U
219 #define ICACHE_STATUS_OK_TO_GO_M 0x80000000U
220 #define ICACHE_STATUS_OK_TO_GO_S 31U
221 
222 
223 /*-----------------------------------REGISTER------------------------------------
224  Register name: CACHE_ADDRESS_LOW
225  Offset name: ICACHE_O_CACHE_ADDRESS_LOW
226  Relative address: 0x10
227  Description: The Cache Address Low Register defines start of the cacheable space. The icache controller can cache up to a range of 8MB of of the target Flash as defined by CAL gt= CachedRange lt= CAH. This register is write protected when cenable is set.
228  Default Value: NA
229 
230  Field: MEM_ADDR_LOW
231  From..to bits: 12...31
232  DefaultValue: NA
233  Access type: read-write
234  Description: The addr_lo defines the cache low address[31:12] for the icache controller to cache. The remaining bits 10:0 are assumed to be zero
235 
236 */
237 #define ICACHE_CACHE_ADDRESS_LOW_MEM_ADDR_LOW_W 20U
238 #define ICACHE_CACHE_ADDRESS_LOW_MEM_ADDR_LOW_M 0xFFFFF000U
239 #define ICACHE_CACHE_ADDRESS_LOW_MEM_ADDR_LOW_S 12U
240 
241 
242 /*-----------------------------------REGISTER------------------------------------
243  Register name: CACHE_ADDRESS_HIGH
244  Offset name: ICACHE_O_CACHE_ADDRESS_HIGH
245  Relative address: 0x18
246  Description: The L1 Cache Address High Register defines end of the L1 cacheable space. The L1 cache can cache up to a range of 8MB of of the target Flash as defined by CAL >= CachedRange <= CAH. This register is write protected when cenable is set.
247  Default Value: NA
248 
249  Field: MEM_ADDR_HIGH
250  From..to bits: 12...31
251  DefaultValue: NA
252  Access type: read-write
253  Description: The addr_hi defines the L1 high address[31:12] for the L1 to cache. The remaining bits 10:0 are assumed to be ones.
254 
255 */
256 #define ICACHE_CACHE_ADDRESS_HIGH_MEM_ADDR_HIGH_W 20U
257 #define ICACHE_CACHE_ADDRESS_HIGH_MEM_ADDR_HIGH_M 0xFFFFF000U
258 #define ICACHE_CACHE_ADDRESS_HIGH_MEM_ADDR_HIGH_S 12U
259 
260 
261 /*-----------------------------------REGISTER------------------------------------
262  Register name: REGISTER_ADDRESS
263  Offset name: ICACHE_O_REGISTER_ADDRESS
264  Relative address: 0x20
265  Description: The RAM Address register defines the upper 17 bits of address for the RAM when renable is set. This register is write protected when renable is set
266  Default Value: NA
267 
268  Field: MEM_SEG_ADDR
269  From..to bits: 15...31
270  DefaultValue: NA
271  Access type: read-write
272  Description: The seg_addr defines RAM address[31:15] value for RAM access .
273 
274 */
275 #define ICACHE_REGISTER_ADDRESS_MEM_SEG_ADDR_W 17U
276 #define ICACHE_REGISTER_ADDRESS_MEM_SEG_ADDR_M 0xFFFF8000U
277 #define ICACHE_REGISTER_ADDRESS_MEM_SEG_ADDR_S 15U
278 
279 
280 /*-----------------------------------REGISTER------------------------------------
281  Register name: HIT_COUNTER
282  Offset name: ICACHE_O_HIT_COUNTER
283  Relative address: 0x40
284  Description: The HIT Counter register holds the number of cache Hits to the internal cache
285  Default Value: NA
286 
287  Field: MEM_HIT_COUNTER
288  From..to bits: 0...31
289  DefaultValue: NA
290  Access type: read-write
291  Description: The hit Counts the number of hits to the L1 cache. Writing zero to this register will clear its contents.
292 
293 */
294 #define ICACHE_HIT_COUNTER_MEM_HIT_COUNTER_W 32U
295 #define ICACHE_HIT_COUNTER_MEM_HIT_COUNTER_M 0xFFFFFFFFU
296 #define ICACHE_HIT_COUNTER_MEM_HIT_COUNTER_S 0U
297 
298 
299 /*-----------------------------------REGISTER------------------------------------
300  Register name: MISS_COUNTER
301  Offset name: ICACHE_O_MISS_COUNTER
302  Relative address: 0x44
303  Description: The MISS Counter register holds the number of cache misses to the internal cache .
304  Default Value: NA
305 
306  Field: MEM_MISS_COUNTER
307  From..to bits: 0...31
308  DefaultValue: NA
309  Access type: read-write
310  Description: The miss Counts the number of misses to the L1 cache. Writing zero to this register will clear its contents.
311 
312 */
313 #define ICACHE_MISS_COUNTER_MEM_MISS_COUNTER_W 32U
314 #define ICACHE_MISS_COUNTER_MEM_MISS_COUNTER_M 0xFFFFFFFFU
315 #define ICACHE_MISS_COUNTER_MEM_MISS_COUNTER_S 0U
316 
317 
318 /*-----------------------------------REGISTER------------------------------------
319  Register name: IRQ_STATUS_RAW
320  Offset name: ICACHE_O_IRQ_STATUS_RAW
321  Relative address: 0x80
322  Description: The Interrupt Raw Status Register holds the raw status of the icache error interrupts .
323  Default Value: NA
324 
325  Field: WR_ERR
326  From..to bits: 0...0
327  DefaultValue: NA
328  Access type: read-write
329  Description: The wr_err bit indicates a write error has occured to the remote cache data storage memory and the L1 is logically disabled while this bit is a '1'. Write 1 to set the wr_err status for diagnostic purposes. Writing a 0 has no effect.
330 
331 */
332 #define ICACHE_IRQ_STATUS_RAW_WR_ERR 0x00000001U
333 #define ICACHE_IRQ_STATUS_RAW_WR_ERR_M 0x00000001U
334 #define ICACHE_IRQ_STATUS_RAW_WR_ERR_S 0U
335 /*
336 
337  Field: WR_HIT
338  From..to bits: 1...1
339  DefaultValue: NA
340  Access type: read-write
341  Description: The wr_hit bit indicates a write to the cacheable range has occured potentially causing a coherency issue and the L1 is logically disabled while this bit is a '1'. Write 1 to set the wr_hit status for diagnostic purposes. Writing a 0 has no effect.
342 
343 */
344 #define ICACHE_IRQ_STATUS_RAW_WR_HIT 0x00000002U
345 #define ICACHE_IRQ_STATUS_RAW_WR_HIT_M 0x00000002U
346 #define ICACHE_IRQ_STATUS_RAW_WR_HIT_S 1U
347 
348 
349 /*-----------------------------------REGISTER------------------------------------
350  Register name: IRQ_STATUS_MASK
351  Offset name: ICACHE_O_IRQ_STATUS_MASK
352  Relative address: 0x84
353  Description: The Interrupt Masked Status Register holds the masked status for the icache error interrupts. Writing to this register will EOI the interrupt, that is if another interrupt is pending, a new pulse interrupt will be generated .
354  Default Value: NA
355 
356  Field: MEM_ERR
357  From..to bits: 0...0
358  DefaultValue: NA
359  Access type: read-write
360  Description: The wr_err bit indicates a write error has occured to the remote cache data storage memory and the L1 is logically disabled while this bit is a '1'. Write 1 to clear the wr_err status after interrupt has been serviced (raw status gets cleared, i.e. even if not enabled). Writing a 0 has no effect to this field.
361 
362 */
363 #define ICACHE_IRQ_STATUS_MASK_MEM_ERR 0x00000001U
364 #define ICACHE_IRQ_STATUS_MASK_MEM_ERR_M 0x00000001U
365 #define ICACHE_IRQ_STATUS_MASK_MEM_ERR_S 0U
366 /*
367 
368  Field: MEM_HIT
369  From..to bits: 1...1
370  DefaultValue: NA
371  Access type: read-write
372  Description: The wr_hit bit indicates a write to the cacheable range has occured potentially causing a coherency issue and the L1 is logically disabled while this bit is a '1'. Write 1 to clear the wr_hit status after interrupt has been serviced (raw status gets cleared, i.e. even if not enabled). Writing a 0 has no effect to this field.
373 
374 */
375 #define ICACHE_IRQ_STATUS_MASK_MEM_HIT 0x00000002U
376 #define ICACHE_IRQ_STATUS_MASK_MEM_HIT_M 0x00000002U
377 #define ICACHE_IRQ_STATUS_MASK_MEM_HIT_S 1U
378 
379 
380 /*-----------------------------------REGISTER------------------------------------
381  Register name: IRQ_ENABLE_SET
382  Offset name: ICACHE_O_IRQ_ENABLE_SET
383  Relative address: 0x88
384  Description: The Interrupt Enable Set Register holds the interrupt enable status of the icache error interrupts .
385  Default Value: NA
386 
387  Field: EN_WR_ERR
388  From..to bits: 0...0
389  DefaultValue: NA
390  Access type: read-write
391  Description: Interrupt Enable Set for wr_err error bit. Writing a 1 will enable the interrupt, and set this bit as well as the corresponding Interrupt Enable Clear Register. Writing a 0 has no effect.
392 
393 */
394 #define ICACHE_IRQ_ENABLE_SET_EN_WR_ERR 0x00000001U
395 #define ICACHE_IRQ_ENABLE_SET_EN_WR_ERR_M 0x00000001U
396 #define ICACHE_IRQ_ENABLE_SET_EN_WR_ERR_S 0U
397 /*
398 
399  Field: EN_WR_HIT
400  From..to bits: 1...1
401  DefaultValue: NA
402  Access type: read-write
403  Description: Interrupt Enable Set for wr_hit error bit. Writing a 1 will enable the interrupt, and set this bit as well as the corresponding Interrupt Enable Clear Register. Writing a 0 has no effect.
404 
405 */
406 #define ICACHE_IRQ_ENABLE_SET_EN_WR_HIT 0x00000002U
407 #define ICACHE_IRQ_ENABLE_SET_EN_WR_HIT_M 0x00000002U
408 #define ICACHE_IRQ_ENABLE_SET_EN_WR_HIT_S 1U
409 
410 
411 /*-----------------------------------REGISTER------------------------------------
412  Register name: IRQ_ENABLE_CLR
413  Offset name: ICACHE_O_IRQ_ENABLE_CLR
414  Relative address: 0x8C
415  Description: The Interrupt Enable Clear Register holds the interrupt enable status of the icache error interrupts.
416  Default Value: NA
417 
418  Field: EN_WR_ERR
419  From..to bits: 0...0
420  DefaultValue: NA
421  Access type: read-write
422  Description: Interrupt Enable Clear for wr_err error bit. Writing a 1 will disable the interrupt, and clear this bit as well as the corresponding Interrupt Enable Set Register. Writing a 0 has no effect.
423 
424 */
425 #define ICACHE_IRQ_ENABLE_CLR_EN_WR_ERR 0x00000001U
426 #define ICACHE_IRQ_ENABLE_CLR_EN_WR_ERR_M 0x00000001U
427 #define ICACHE_IRQ_ENABLE_CLR_EN_WR_ERR_S 0U
428 /*
429 
430  Field: EN_WR_HIT
431  From..to bits: 1...1
432  DefaultValue: NA
433  Access type: read-write
434  Description: Interrupt Enable Clear for wr_hit error bit. Writing a 1 will disable the interrupt, and clear this bit as well as the corresponding Interrupt Enable Set Register. Writing a 0 has no effect
435 
436 */
437 #define ICACHE_IRQ_ENABLE_CLR_EN_WR_HIT 0x00000002U
438 #define ICACHE_IRQ_ENABLE_CLR_EN_WR_HIT_M 0x00000002U
439 #define ICACHE_IRQ_ENABLE_CLR_EN_WR_HIT_S 1U
440 
441 #endif /* __HW_ICACHE_H__*/