Capture CM_L4PER3_CLKSTCTRL as part of CTT Dump
[sitara-dss-files/am57xx-dss-files.git] / am57xx-ctt.dss
1 /*
2  * Copyright (c) 2018, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * *  Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
34 var ctt_registers_am570x= [
35         0x4a005560,
36         0x4ae06118,
37         0x4a008920,
38         0x4ae06190,
39         0x4a0052e4,
40         0x4ae061c8,
41         0x4ae06174,
42         0x4a009848,
43         0x4ae07888,
44         0x4a005228,
45         0x4a002360,
46         0x4a0051ec,
47         0x4a009770,
48         0x4a009908,
49         0x4a005254,
50         0x4a009858,
51         0x4a00521c,
52         0x4ae061bc,
53         0x4a009750,
54         0x4a009780,
55         0x4a0097a8,
56         0x4a008778,
57         0x4a009328,
58         0x4a005234,
59         0x4a005244,
60         0x4a0052b8,
61         0x4a005130,
62         0x4a005154,
63         0x4a0098e8,
64         0x4a008e40,
65         0x4a005550,
66         0x4a0093e8,
67         0x4ae07830,
68         0x4a00516c,
69         0x4a009620,
70         0x4a005520,
71         0x4a005580,
72         0x4a008210,
73         0x4a008e28,
74         0x4ae061a0,
75         0x4a009738,
76         0x4a005248,
77         0x4a009800,
78         0x4a0052c8,
79         0x4a0052d8,
80         0x4a005140,
81         0x4a0052e8,
82         0x4a0098a8,
83         0x4a009798,
84         0x4a0051e0,
85         0x4ae06108,
86         0x4a0051f0,
87         0x4ae07840,
88         0x4ae06170,
89         0x4a0097d8,
90         0x4a005210,
91         0x4a0098f0,
92         0x4ae07838,
93         0x4a005220,
94         0x4a009868,
95         0x4a008158,
96         0x4a00519c,
97         0x4a0086a0,
98         0x4ae06138,
99         0x4ae061c4,
100         0x4a0051f4,
101         0x4ae06114,
102         0x4a008e50,
103         0x4a009760,
104         0x4a009720,
105         0x4ae061d0,
106         0x4a009878,
107         0x4a00814c,
108         0x4a008200,
109         0x4a005160,
110         0x4a0093b0,
111         0x4a005170,
112         0x4ae061d8,
113         0x4a009120,
114         0x4a008b30,
115         0x4a0052c0,
116         0x4a0051ac,
117         0x4ae061a8,
118         0x4a00815c,
119         0x4a005568,
120         0x4a0093d0,
121         0x4a009820,
122         0x4a009220,
123         0x4a002534,
124         0x4a009020,
125         0x4a0098d0,
126         0x4a0093e0,
127         0x4a009130,
128         0x4a009850,
129         0x4a005158,
130         0x4a005764,
131         0x4a009788,
132         0x4a008160,
133         0x4ae07878,
134         0x4a009890,
135         0x4a009870,
136         0x4a0097f0,
137         0x4ae06194,
138         0x4a009340,
139         0x4a009028,
140         0x4a0097c4,
141         0x4a009810,
142         0x4a0097b0,
143         0x4a0051dc,
144         0x4a008780,
145         0x4a005144,
146         0x4a008164,
147         0x4a008140,
148         0x4a0097c8,
149         0x4a008150,
150         0x4ae0610c,
151         0x4a0098c8,
152         0x4ae06198,
153         0x4ae06168,
154         0x4ae06184,
155         0x4ae06148,
156         0x4a0051a0,
157         0x4a0051b0,
158         0x4ae0619c,
159         0x4a009740,
160         0x4a00821c,
161         0x4a009808,
162         0x4a009728,
163         0x4ae061cc,
164         0x4a005558,
165         0x4ae0612c,
166         0x4ae06178,
167         0x4a009830,
168         0x4a00818c,
169         0x4a00820c,
170         0x4a008f28,
171         0x4a002544,
172         0x4a009898,
173         0x4ae06124,
174         0x4ae061b0,
175         0x4a009840,
176         0x4a009768,
177         0x4a009904,
178         0x4a00515c,
179         0x4ae061b8,
180         0x4a0052bc,
181         0x4ae061b4,
182         0x4a009778,
183         0x4a005570,
184         0x4a0097a0,
185         0x4ae06110,
186         0x4a009828,
187         0x4ae06164,
188         0x4a008b40,
189         0x4ae06160,
190         0x4ae0615c,
191         0x4ae06158,
192         0x4a0098e0,
193         0x4a009330,
194         0x4ae0614c,
195         0x4a005420,
196         0x4a0093f0,
197         0x4a008180,
198         0x4a0052b4,
199         0x4a008190,
200         0x4a00512c,
201         0x4a005100,
202         0x4a0097f8,
203         0x4a008f20,
204         0x4ae0618c,
205         0x4a0098a0,
206         0x4a0098c0,
207         0x4a009790,
208         0x4a009838,
209         0x4a009818,
210         0x4a0097b8,
211         0x4a008728,
212         0x4a0097d0,
213         0x4a008e20,
214         0x4a0098f8,
215         0x4ae07880,
216         0x4a009860,
217         0x4ae061ac,
218         0x4a0098b0,
219         0x4a0052c4,
220         0x4a00513c,
221         0x4ae06120,
222         0x4a009748,
223         0x4ae06144,
224         0x4a005578,
225         0x4a005240,
226         0x4a009718,
227         0x4a009730,
228         0x4a0052a8,
229         0x4a005120,
230         0x4a0086b0,
231         0x4a009910,
232         0x4ae06188,
233         0x4ae061a4,
234         0x4ae06128
235 ];
237 var ctt_registers_am571x = [
238         0x4a005560,
239         0x4ae06118,
240         0x4a008920,
241         0x4ae06190,
242         0x4a0052e4,
243         0x4ae061c8,
244         0x4ae06174,
245         0x4a009848,
246         0x4ae07888,
247         0x4a005228,
248         0x4a002360,
249         0x4a0051ec,
250         0x4a009770,
251         0x4a009908,
252         0x4ae07a04,
253         0x4a005254,
254         0x4a009858,
255         0x4a00521c,
256         0x4ae061bc,
257         0x4a009750,
258         0x4a009780,
259         0x4a0097a8,
260         0x4a008778,
261         0x4a009328,
262         0x4a005234,
263         0x4a005244,
264         0x4a0052b8,
265         0x4a009388,
266         0x4a005130,
267         0x4a005154,
268         0x4a0098e8,
269         0x4a008e40,
270         0x4a005550,
271         0x4a0093e8,
272         0x4ae07830,
273         0x4a00516c,
274         0x4a009620,
275         0x4a005520,
276         0x4a005580,
277         0x4a008210,
278         0x4a008e28,
279         0x4ae061a0,
280         0x4a009738,
281         0x4a005248,
282         0x4a009800,
283         0x4a0052c8,
284         0x4a0052d8,
285         0x4a005140,
286         0x4a0052e8,
287         0x4a0098a8,
288         0x4a009798,
289         0x4ae061c0,
290         0x4a0051e0,
291         0x4ae06108,
292         0x4a0051f0,
293         0x4ae07840,
294         0x4ae06170,
295         0x4a0097d8,
296         0x4a005210,
297         0x4a0098f0,
298         0x4ae07838,
299         0x4a005220,
300         0x4a009868,
301         0x4a008158,
302         0x4a00519c,
303         0x4a0086a0,
304         0x4ae06138,
305         0x4ae061c4,
306         0x4a0051f4,
307         0x4ae06114,
308         0x4a008e50,
309         0x4a009760,
310         0x4a009720,
311         0x4ae061d0,
312         0x4a009878,
313         0x4a00814c,
314         0x4a008200,
315         0x4a005160,
316         0x4a0093b0,
317         0x4a005170,
318         0x4ae061d8,
319         0x4a009120,
320         0x4a008b30,
321         0x4a0052c0,
322         0x4a0051ac,
323         0x4ae061a8,
324         0x4a00815c,
325         0x4a005568,
326         0x4a0093d0,
327         0x4a009820,
328         0x4a009220,
329         0x4a002534,
330         0x4a009020,
331         0x4a0098d0,
332         0x4a0093e0,
333         0x4a009130,
334         0x4a009850,
335         0x4a005158,
336         0x4a005764,
337         0x4a009788,
338         0x4a008160,
339         0x4ae07878,
340         0x4a005744,
341         0x4a009890,
342         0x4a009870,
343         0x4a0097f0,
344         0x4ae06194,
345         0x4a009340,
346         0x4a009028,
347         0x4a0097c4,
348         0x4a009810,
349         0x4a0097b0,
350         0x4a0051dc,
351         0x4a008780,
352         0x4a005144,
353         0x4a008164,
354         0x4a008140,
355         0x4a0097c8,
356         0x4a008150,
357         0x4ae0610c,
358         0x4a0098c8,
359         0x4ae06198,
360         0x4ae06168,
361         0x4ae06184,
362         0x4ae06148,
363         0x4a0051a0,
364         0x4a0051b0,
365         0x4ae0619c,
366         0x4a009740,
367         0x4a00821c,
368         0x4a009808,
369         0x4a009728,
370         0x4ae061cc,
371         0x4a005558,
372         0x4ae0612c,
373         0x4ae06178,
374         0x4a009830,
375         0x4a00818c,
376         0x4a00820c,
377         0x4a008f28,
378         0x4a002544,
379         0x4a009898,
380         0x4ae06124,
381         0x4ae061b0,
382         0x4a009840,
383         0x4a009768,
384         0x4a009904,
385         0x4a00515c,
386         0x4ae061b8,
387         0x4a0052bc,
388         0x4a0093b8,
389         0x4ae061b4,
390         0x4a009778,
391         0x4a005570,
392         0x4a0097a0,
393         0x4ae06110,
394         0x4a009828,
395         0x4ae06164,
396         0x4a008b40,
397         0x4ae06160,
398         0x4ae0615c,
399         0x4ae06158,
400         0x4a0098e0,
401         0x4a009330,
402         0x4ae0614c,
403         0x4a005420,
404         0x4a0093f0,
405         0x4a008180,
406         0x4a0052b4,
407         0x4a008190,
408         0x4a00512c,
409         0x4a005100,
410         0x4a0097f8,
411         0x4a008f20,
412         0x4ae0618c,
413         0x4a0098a0,
414         0x4a0098c0,
415         0x4a009790,
416         0x4a009838,
417         0x4a009818,
418         0x4a0097b8,
419         0x4a008728,
420         0x4a0097d0,
421         0x4a008e20,
422         0x4a0098f8,
423         0x4ae07880,
424         0x4a009860,
425         0x4ae061ac,
426         0x4a0098b0,
427         0x4a0052c4,
428         0x4a00513c,
429         0x4ae06120,
430         0x4a009748,
431         0x4ae06144,
432         0x4a005578,
433         0x4a005240,
434         0x4a009718,
435         0x4a009730,
436         0x4a0052a8,
437         0x4a005120,
438         0x4a0086b0,
439         0x4a009910,
440         0x4ae06188,
441         0x4ae061a4,
442         0x4ae06128
443 ];
445 var ctt_registers_am572x = [
446         0x4a005560,
447         0x4ae06118,
448         0x4a008920,
449         0x4ae06190,
450         0x4a0052e4,
451         0x4ae061c8,
452         0x4ae06174,
453         0x4a009848,
454         0x4ae07888,
455         0x4a005228,
456         0x4a002360,
457         0x4a0051ec,
458         0x4a009770,
459         0x4a009908,
460         0x4ae07a04,
461         0x4a005254,
462         0x4ae06154,
463         0x4a009858,
464         0x4a00521c,
465         0x4ae061bc,
466         0x4a009750,
467         0x4a009780,
468         0x4a0097a8,
469         0x4a008778,
470         0x4a009328,
471         0x4a005234,
472         0x4a005244,
473         0x4a0052b8,
474         0x4a009388,
475         0x4a005130,
476         0x4a005154,
477         0x4a0098e8,
478         0x4a008e40,
479         0x4a005550,
480         0x4a0093e8,
481         0x4ae07830,
482         0x4a00516c,
483         0x4a009620,
484         0x4a005520,
485         0x4a005580,
486         0x4a008210,
487         0x4a008e28,
488         0x4ae061a0,
489         0x4a009738,
490         0x4a005248,
491         0x4a009800,
492         0x4a0052c8,
493         0x4a0052d8,
494         0x4a005140,
495         0x4a0052e8,
496         0x4a0098a8,
497         0x4a005720,
498         0x4ae06180,
499         0x4a009798,
500         0x4ae061c0,
501         0x4a0051e0,
502         0x4ae06108,
503         0x4a0051f0,
504         0x4ae07840,
505         0x4ae06170,
506         0x4a009200,
507         0x4a0097d8,
508         0x4a005210,
509         0x4a0098f0,
510         0x4ae07838,
511         0x4a005220,
512         0x4a009868,
513         0x4a008158,
514         0x4a00519c,
515         0x4a0086a0,
516         0x4ae061d4,
517         0x4ae06138,
518         0x4ae061c4,
519         0x4a0051f4,
520         0x4ae06114,
521         0x4a008e50,
522         0x4a009760,
523         0x4a009720,
524         0x4ae061d0,
525         0x4a009878,
526         0x4a00814c,
527         0x4a008200,
528         0x4a005160,
529         0x4a0093b0,
530         0x4a005170,
531         0x4ae061d8,
532         0x4a009120,
533         0x4a008b30,
534         0x4a0052c0,
535         0x4a0051ac,
536         0x4ae061a8,
537         0x4a00815c,
538         0x4a005568,
539         0x4a0093d0,
540         0x4a009820,
541         0x4a009220,
542         0x4a002534,
543         0x4a009020,
544         0x4a0098d0,
545         0x4a0056e0,
546         0x4a0093e0,
547         0x4a009130,
548         0x4a009850,
549         0x4a005158,
550         0x4a005764,
551         0x4a009788,
552         0x4a008160,
553         0x4ae07878,
554         0x4a009030,
555         0x4a009890,
556         0x4a009870,
557         0x4a0097f0,
558         0x4ae06194,
559         0x4a009340,
560         0x4a0097c4,
561         0x4a009810,
562         0x4a0097b0,
563         0x4a0051dc,
564         0x4a008780,
565         0x4a005144,
566         0x4a008164,
567         0x4a008140,
568         0x4a0097c8,
569         0x4a008150,
570         0x4ae0610c,
571         0x4a0098c8,
572         0x4ae06198,
573         0x4ae06168,
574         0x4ae06184,
575         0x4ae06148,
576         0x4a0051a0,
577         0x4a0051b0,
578         0x4ae0619c,
579         0x4a0056a0,
580         0x4a009740,
581         0x4a00821c,
582         0x4a009808,
583         0x4a009728,
584         0x4a005290,
585         0x4ae061cc,
586         0x4a005558,
587         0x4ae0612c,
588         0x4ae06178,
589         0x4a005620,
590         0x4a009830,
591         0x4a00818c,
592         0x4a00820c,
593         0x4a008f28,
594         0x4a002544,
595         0x4a009898,
596         0x4ae061b0,
597         0x4a009840,
598         0x4a009768,
599         0x4a009904,
600         0x4a00515c,
601         0x4ae061b8,
602         0x4a0052bc,
603         0x4a0093b8,
604         0x4a008b38,
605         0x4ae061b4,
606         0x4a009778,
607         0x4a005570,
608         0x4a0097a0,
609         0x4a0052a4,
610         0x4a005660,
611         0x4ae06110,
612         0x4a009828,
613         0x4ae06164,
614         0x4a008b40,
615         0x4ae06160,
616         0x4ae0615c,
617         0x4ae06158,
618         0x4a009028,
619         0x4a0098e0,
620         0x4a005284,
621         0x4a005294,
622         0x4a009330,
623         0x4ae0614c,
624         0x4a005420,
625         0x4a0093f0,
626         0x4ae06150,
627         0x4a008180,
628         0x4a0052b4,
629         0x4a008190,
630         0x4a00512c,
631         0x4a005100,
632         0x4a0097f8,
633         0x4a008f20,
634         0x4ae0618c,
635         0x4a0098a0,
636         0x4ae061e0,
637         0x4a0098c0,
638         0x4a009790,
639         0x4a009838,
640         0x4a009818,
641         0x4a0097b8,
642         0x4a008728,
643         0x4a0097d0,
644         0x4a008e20,
645         0x4a0098f8,
646         0x4ae07880,
647         0x4ae0616c,
648         0x4a009860,
649         0x4ae061ac,
650         0x4a0098b0,
651         0x4a0052c4,
652         0x4a00513c,
653         0x4ae06120,
654         0x4a009748,
655         0x4ae06144,
656         0x4a005578,
657         0x4a005240,
658         0x4a009718,
659         0x4a009730,
660         0x4a0052a8,
661         0x4a005120,
662         0x4a0086b0,
663         0x4a009910,
664         0x4ae06188,
665         0x4ae061a4,
666         0x4ae06128
667 ];
669 var ctt_registers_am574x = [
670         0x4a005560,
671         0x4ae06118,
672         0x4a008920,
673         0x4ae06190,
674         0x4a0052e4,
675         0x4ae061c8,
676         0x4ae06174,
677         0x4a009848,
678         0x4ae07888,
679         0x4a005228,
680         0x4a002360,
681         0x4a0051ec,
682         0x4a009770,
683         0x4a009908,
684         0x4ae07a04,
685         0x4a005254,
686         0x4ae06154,
687         0x4a009858,
688         0x4a00521c,
689         0x4ae061bc,
690         0x4a009750,
691         0x4a009780,
692         0x4a0097a8,
693         0x4a008778,
694         0x4a009328,
695         0x4a005234,
696         0x4a005244,
697         0x4a0052b8,
698         0x4a009388,
699         0x4a005130,
700         0x4a005154,
701         0x4a0098e8,
702         0x4a008e40,
703         0x4a005550,
704         0x4a0093e8,
705         0x4ae07830,
706         0x4a00516c,
707         0x4a009620,
708         0x4a005520,
709         0x4a005580,
710         0x4a008210,
711         0x4a008e28,
712         0x4ae061a0,
713         0x4a009738,
714         0x4a009800,
715         0x4a0052c8,
716         0x4a0052d8,
717         0x4a005140,
718         0x4a0052e8,
719         0x4a0098a8,
720         0x4ae06180,
721         0x4a009798,
722         0x4ae061c0,
723         0x4a0051e0,
724         0x4ae06108,
725         0x4a0051f0,
726         0x4ae07840,
727         0x4ae06170,
728         0x4a009200,
729         0x4a0097d8,
730         0x4a005210,
731         0x4a0098f0,
732         0x4ae07838,
733         0x4a005220,
734         0x4a009868,
735         0x4a008158,
736         0x4a00519c,
737         0x4a0086a0,
738         0x4ae061d4,
739         0x4ae06138,
740         0x4ae061c4,
741         0x4a0051f4,
742         0x4ae06114,
743         0x4a008e50,
744         0x4a009760,
745         0x4a009720,
746         0x4ae061d0,
747         0x4a009878,
748         0x4a00814c,
749         0x4a008200,
750         0x4a005160,
751         0x4a0093b0,
752         0x4a005170,
753         0x4ae061d8,
754         0x4a009120,
755         0x4a008b30,
756         0x4a0052c0,
757         0x4a0051ac,
758         0x4ae061a8,
759         0x4a00815c,
760         0x4a005568,
761         0x4a0093d0,
762         0x4a009820,
763         0x4a009220,
764         0x4a002534,
765         0x4a0023fc,
766         0x4a009020,
767         0x4a0098d0,
768         0x4a0093e0,
769         0x4a009130,
770         0x4a009850,
771         0x4a005158,
772         0x4a005764,
773         0x4a009788,
774         0x4a008160,
775         0x4ae07878,
776         0x4a009890,
777         0x4a009870,
778         0x4a0097f0,
779         0x4ae06194,
780         0x4a009340,
781         0x4a0097c4,
782         0x4a009810,
783         0x4a0097b0,
784         0x4a0051dc,
785         0x4a008780,
786         0x4a005144,
787         0x4a008164,
788         0x4a008140,
789         0x4a0097c8,
790         0x4a008150,
791         0x4ae0610c,
792         0x4a0098c8,
793         0x4ae06198,
794         0x4ae06168,
795         0x4ae06184,
796         0x4ae06148,
797         0x4a0051a0,
798         0x4a0051b0,
799         0x4ae0619c,
800         0x4a0056a0,
801         0x4a009740,
802         0x4a00821c,
803         0x4a009808,
804         0x4a009728,
805         0x4ae061cc,
806         0x4a005558,
807         0x4ae0612c,
808         0x4ae06178,
809         0x4a005620,
810         0x4a009830,
811         0x4a00818c,
812         0x4a00820c,
813         0x4a008f28,
814         0x4a002544,
815         0x4a009898,
816         0x4ae061b0,
817         0x4a009840,
818         0x4a009768,
819         0x4a009904,
820         0x4a00515c,
821         0x4ae061b8,
822         0x4a0052bc,
823         0x4a0093b8,
824         0x4a008b38,
825         0x4ae061b4,
826         0x4a009778,
827         0x4a005570,
828         0x4a0097a0,
829         0x4a005660,
830         0x4ae06110,
831         0x4a009828,
832         0x4ae06164,
833         0x4a008b40,
834         0x4ae06160,
835         0x4ae0615c,
836         0x4ae06158,
837         0x4a009028,
838         0x4a0098e0,
839         0x4a009330,
840         0x4ae078a0,
841         0x4ae0614c,
842         0x4a005420,
843         0x4a0093f0,
844         0x4ae06150,
845         0x4a008180,
846         0x4a0052b4,
847         0x4a008190,
848         0x4a00512c,
849         0x4a005100,
850         0x4a0097f8,
851         0x4a008f20,
852         0x4ae0618c,
853         0x4a0098a0,
854         0x4a0098c0,
855         0x4a009790,
856         0x4a009838,
857         0x4a009818,
858         0x4a0097b8,
859         0x4a008728,
860         0x4a0097d0,
861         0x4a008e20,
862         0x4a0098f8,
863         0x4ae07880,
864         0x4ae0616c,
865         0x4a009860,
866         0x4ae061ac,
867         0x4a0098b0,
868         0x4a0052c4,
869         0x4a00513c,
870         0x4ae06120,
871         0x4a009748,
872         0x4ae06144,
873         0x4a005578,
874         0x4a005240,
875         0x4a009718,
876         0x4a009730,
877         0x4a0052a8,
878         0x4a005120,
879         0x4a0086b0,
880         0x4a009910,
881         0x4ae06188,
882         0x4ae061a4,
883         0x4ae06128
884 ];
886 debugSessionDAP = ds.openSession("*","CS_DAP_DebugSS");
887 debugSessionDAP.target.connect();
889 /* Check ID_CODE register (address 0x4AE0C204) to determine which 
890    AM57xx variant is being used */
891 try {
892         id_code = debugSessionDAP.memory.readWord(0,0x4AE0C204,false);
893 } catch(ex) {
894         print("\n Trouble reading ID_CODE.\n");
897 print("ID_CODE = 0x" + d2h(id_code));
899 // Check STD_FUSE_ID_2 register (address 0x4AE0C20C) for package type
900 try {
901         fuse_id_2 = debugSessionDAP.memory.readWord(0,0x4AE0C20C,false);
902 } catch(ex) {
903         print("\n Trouble reading STD_FUSE_ID_2.\n");
905 pkg_type = (fuse_id_2 & 0x00030000) >> 16;  // FUSE_ID_2[17:16] = pkg_type
907 switch(id_code) {
908         case 0x0B9BC02F:
909                 print("AM571x SR1.0 detected.\n");
910                 device_type = 571;
911                 break;
912         case 0x1B9BC02F:
913                 if(pkg_type == 1) {
914                         print("AM570x SR2.0 detected.\n");
915                         device_type = 570;
916                 } else if(pkg_type == 2) {
917                         print("AM571x SR2.0 detected.\n");
918                         device_type = 571;
919                 } else
920                         print("AM571x/AM570x SR2.0 unrecognized package type\n")
921                 break;
922         case 0x2B9BC02F:
923                 if(pkg_type == 1) {
924                         print("AM570x SR2.1 detected.\n");
925                         device_type = 570;
926                 } else if(pkg_type == 2) {
927                         print("AM571x SR2.1 detected.\n");
928                         device_type = 571;
929                 } else
930                         print("AM571x/AM570x SR2.1 unrecognized package type\n")
931                 break;
932         case 0x0B99002F:
933                 print("AM572x SR1.0 detected.\n");
934                 device_type = 572;
935                 break;
936         case 0x1B99002F:
937                 print("AM572x SR1.1 detected.\n");
938                 device_type = 572;
939                 break;
940         case 0x2B99002F:
941                 print("AM572x SR2.0 detected.\n");
942                 device_type = 572;
943                 break;
944         case 0x0BB5002F:
945                 print("AM574x SR1.0 detected.\n");
946                 device_type = 574;
947                 break;
948         default:
949                 print("Unable to identify which AM57xx variant.\n");
950                 debugSessionDAP.target.disconnect();
951                 throw("Terminating script.\n")
952                 break;
955 //Build a filename that includes date/time
956 var today = new Date();
957 var year4digit = today.getFullYear();
958 var month2digit = ("0" + (today.getMonth()+1)).slice(-2);
959 var day2digit = ("0" + today.getDate()).slice(-2);
960 var hour2digit = ("0" + today.getHours()).slice(-2);
961 var minutes2digit = ("0" + today.getMinutes()).slice(-2);
962 var seconds2digit = ("0" + today.getSeconds()).slice(-2);
963 var filename_date = '_' + year4digit + '-' + month2digit + '-' + day2digit + '_' + hour2digit + minutes2digit + seconds2digit; 
964 var userHomeFolder = System.getProperty("user.home");
965 var filename = userHomeFolder + '/Desktop/' + 'am57xx-ctt' + filename_date + '.rd1';
967 file = new java.io.FileWriter(filename);
969 if (device_type == 570) {
970         file.write("DeviceName AM570x_SR2.1_SR2.0\n");
971         ctt_registers = ctt_registers_am570x;
972 } else if (device_type == 571) {
973         file.write("DeviceName AM571x_SR2.0_SR1.0\n");
974         ctt_registers = ctt_registers_am571x;
975 } else if (device_type == 572) {
976         file.write("DeviceName AM572x_SR2.0_SR1.1\n");
977         ctt_registers = ctt_registers_am572x;
978 } else if (device_type == 574) {
979         file.write("DeviceName AM574x_SR1.0\n");
980         ctt_registers = ctt_registers_am574x;
981 } else {
982         throw("Error -- code shouldn't get here.")
985 // helper function to create 8-digit hex numbers in ascii format
986 function d2h(d) {return ("00000000" + (+d).toString(16)).slice(-8);}
988 // read CTT data from physical addresses
989 for(i=0; i<ctt_registers.length; i++)
991         try {
992                 value = debugSessionDAP.memory.readWord(0,ctt_registers[i],false);
993                 value_string = d2h(value);
994                 file.write('0x' + ("0000" + ctt_registers[i].toString(16)).slice(-8) + " 0x" + value_string + "\n");
995         } catch (ex) {
996                 print("\n Trouble reading address 0x" + d2h(ctt_registers[i]) + ". Skipping register.\n");
997         }
999 print("Data collection complete.");
1001 file.close();
1002 debugSessionDAP.target.disconnect();
1003 print("Created file " + filename);