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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
|
/* ============================================================================
* Copyright (c) Texas Instruments Incorporated 2008, 2009 2016
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* @file csl_xmcAux.h
*
* @brief
* API Auxilary header file for XMC CSL. It gives the definitions of the
* status query & control functions.
*
* \par
* ============================================================================
* @n (C) Copyright 2008, 2009, Texas Instruments, Inc.
* @n Use of this software is controlled by the terms and conditions found
* @n in the license agreement under which this software has been supplied.
* ===========================================================================
* \par
*/
#ifndef CSL_XMCAUX_H
#define CSL_XMCAUX_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ti/csl/csl_xmc.h>
/** @addtogroup CSL_XMC_FUNCTION
@{ */
/** ============================================================================
* @n@b CSL_XMC_setXMPAXH
*
* @b Description
* @n This function sets the contents of XMPAXH register indicated by the
* index here.
* please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0
* for details on the sample arguments and example values to set
* XMPAXH register as provided under table 7-2
*
* @b Arguments
@verbatim
index Index into the set of 16 registers (0-15)
mpaxh CSL_XMC_XMPAXH structure that needs to be set into the
register
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Corresponding XMPAXH register configured with the value passed.
*
* @b Writes
* @n XMC_XMPAXH_SEGSZ, XMC_XMPAXH_BADDR
*
* @b Example
* @verbatim
Uint32 index = 0;
CSL_XMC_XMPAXH mpaxh;
mpaxh.segSize = 4;
mpaxh.baseAddress = 0x1000;
CSL_XMC_setXMPAXH (index, &mpaxh);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_setXMPAXH
(
Uint32 index,
const CSL_XMC_XMPAXH* mpaxh
);
static inline void CSL_XMC_setXMPAXH
(
Uint32 index,
const CSL_XMC_XMPAXH* mpaxh
)
{
hXmc->XMPAX[index].XMPAXH = CSL_FMK(XMC_XMPAXH_SEGSZ, mpaxh->segSize) |
CSL_FMK(XMC_XMPAXH_BADDR, mpaxh->bAddr);
}
/** ============================================================================
* @n@b CSL_XMC_setXMPAXL
*
* @b Description
* @n This function sets the contents of XMPAXL register corresponding to the
* index specified.
* please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0
* for details on the sample arguments and example values to set
* XMPAXL register as provided under table 7-2
*
* @b Arguments
@verbatim
index Index into the set of 16 registers (0-15)
mpaxl CSL_XMC_XMPAXL structure that needs to be set into the
register
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n Corresponding XMPAXL register configured with the value passed.
*
* @b Writes
* @n XMC_XMPAXL_RADDR,
* XMC_XMPAXL_UX,
* XMC_XMPAXL_UW,
* XMC_XMPAXL_UR,
* XMC_XMPAXL_SX,
* XMC_XMPAXL_SW,
* XMC_XMPAXL_SR
*
* @b Example
* @verbatim
Uint32 index = 0;
CSL_XMC_XMPAXL mpaxl;
mpaxl.ux = 1;
mpaxl.uw = 1;
mpaxl.ur = 1;
mpaxl.sx = 1;
mpaxl.sw = 1;
mpaxl.sr = 1;
mpaxl.rAddr = 0x4000 ;
CSL_XMC_setXMPAXL (index, &mpaxl);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_setXMPAXL
(
Uint32 index,
const CSL_XMC_XMPAXL* mpaxl
);
static inline void CSL_XMC_setXMPAXL
(
Uint32 index,
const CSL_XMC_XMPAXL* mpaxl
)
{
Uint32 value = 0;
/* Configure the XMPAXL register specified by the index. */
CSL_FINS (value, XMC_XMPAXL_UX, mpaxl->ux);
CSL_FINS (value, XMC_XMPAXL_UW, mpaxl->uw);
CSL_FINS (value, XMC_XMPAXL_UR, mpaxl->ur);
CSL_FINS (value, XMC_XMPAXL_SX, mpaxl->sx);
CSL_FINS (value, XMC_XMPAXL_SW, mpaxl->sw);
CSL_FINS (value, XMC_XMPAXL_SR, mpaxl->sr);
CSL_FINS (value, XMC_XMPAXL_RADDR, mpaxl->rAddr);
hXmc->XMPAX[index].XMPAXL = value;
}
/** ============================================================================
* @n@b CSL_XMC_getXMPAXH
*
* @b Description
* @n This function gets the contents of XMPAXH register.
*
* please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0
* for details on the sample arguments and example values to set
* XMPAXH register as provided under table 7-2
*
* @b Arguments
@verbatim
index Index into the set of 16 XMPAXH registers
mpaxh CSL_XMC_XMPAXH structure that needs to be populated with
XMPAXH register contents.
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XMPAXH_SEGSZ, XMC_XMPAXH_BADDR
*
* @b Example
* @verbatim
Uint32 index = 0;
CSL_XMC_XMPAXH mpaxh;
CSL_XMC_getXMPAXH (index, &mpaxh);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_getXMPAXH
(
Uint32 index,
CSL_XMC_XMPAXH* mpaxh
);
static inline void CSL_XMC_getXMPAXH
(
Uint32 index,
CSL_XMC_XMPAXH* mpaxh
)
{
Uint32 value = hXmc->XMPAX[index].XMPAXH;
/* Retrieve contents of XMPAXH register specified by the index */
mpaxh->segSize = CSL_FEXT (value, XMC_XMPAXH_SEGSZ);
mpaxh->bAddr = CSL_FEXT (value, XMC_XMPAXH_BADDR);
}
/** ============================================================================
* @n@b CSL_XMC_getXMPAXL
*
* @b Description
* @n This function gets the contents of XMPAXL register.
*
* please see section 7.3 on MPAX unit http://www.ti.com/lit/sprugw0
* for details on the sample arguments and example values to set
* XMPAXL register as provided under table 7-2
*
* @b Arguments
@verbatim
index Index into the set of 16 registers
mpaxl CSL_XMC_XMPAXL structure that needs to be populated with
XMPAXL register contents.
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XMPAXL_RADDR,
* XMC_XMPAXL_UX,
* XMC_XMPAXL_UW,
* XMC_XMPAXL_UR,
* XMC_XMPAXL_SX,
* XMC_XMPAXL_SW,
* XMC_XMPAXL_SR
*
* @b Example
* @verbatim
Uint32 index = 0;
CSL_XMC_XMPAXL mpaxl;
CSL_XMC_getXMPAXL (index, &mpaxl);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_getXMPAXL (
Uint32 index,
CSL_XMC_XMPAXL * mpaxl
);
static inline void CSL_XMC_getXMPAXL (
Uint32 index,
CSL_XMC_XMPAXL * mpaxl
)
{
Uint32 value = hXmc->XMPAX[index].XMPAXL;
/* Retrieve contents of XMPAXL register using the index specified */
mpaxl->rAddr = CSL_FEXT (value, XMC_XMPAXL_RADDR);
mpaxl->sr = CSL_FEXT (value, XMC_XMPAXL_SR);
mpaxl->sw = CSL_FEXT (value, XMC_XMPAXL_SW);
mpaxl->sx = CSL_FEXT (value, XMC_XMPAXL_SX);
mpaxl->ur = CSL_FEXT (value, XMC_XMPAXL_UR);
mpaxl->uw = CSL_FEXT (value, XMC_XMPAXL_UW);
mpaxl->ux = CSL_FEXT (value, XMC_XMPAXL_UX);
}
/** ============================================================================
* @n@b CSL_XMC_getFaultAddress
*
* @b Description
* @n This function gets the access address causing the fault.
*
* @b Arguments
* @n None
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XMPFAR_FADDR
*
* @b Example
* @verbatim
Uint32 faultAddr;
faultAddr = CSL_XMC_getFaultAddress ();
@endverbatim
* =============================================================================
*/
static inline Uint32 CSL_XMC_getFaultAddress (void);
static inline Uint32 CSL_XMC_getFaultAddress (void)
{
return CSL_FEXT (hXmc->XMPFAR, XMC_XMPFAR_FADDR);
}
/** ============================================================================
* @n@b CSL_XMC_clearFault
*
* @b Description
* @n This function clears the fault information.
*
* @b Arguments
* @n None
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n XMPFCR register configured with the value passed. Fault
* address and status registers are cleared.
*
* @b Writes
* @n XMC_XMPFCR_MPFCLR=1
*
* @b Affects
* @n XMC_XMPFAR_FADDR=0,
* XMC_XMPFSR_LOCAL=0,
* XMC_XMPFSR_SR=0,
* XMC_XMPFSR_SX=0,
* XMC_XMPFSR_UR=0,
* XMC_XMPFSR_UW=0,
* XMC_XMPFSR_UW=0
*
* @b Example
* @verbatim
CSL_XMC_clearFault ();
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_clearFault (void);
static inline void CSL_XMC_clearFault (void)
{
hXmc->XMPFCR = CSL_FMK(XMC_XMPFCR_MPFCLR, (uint32_t)1U);
}
/** ============================================================================
* @n@b CSL_XMC_getFaultStatus
*
* @b Description
* @n This function gets the contents of Fault Status Register XMPFSR.
*
* @b Arguments
@verbatim
xmpfsr CSL_XMC_MPFSR structure that needs to be filled in from
XMPFSR register
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XMPFSR_LOCAL,
* XMC_XMPFSR_SR,
* XMC_XMPFSR_SX,
* XMC_XMPFSR_UR,
* XMC_XMPFSR_UW,
* XMC_XMPFSR_UW
*
* @b Example
* @verbatim
CSL_XMC_MPFSR xmpfsr;
CSL_XMC_getFaultStatus (&xmpfsr);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_getFaultStatus (CSL_XMC_MPFSR * xmpfsr);
static inline void CSL_XMC_getFaultStatus (CSL_XMC_MPFSR * xmpfsr)
{
Uint32 value = hXmc->XMPFSR;
xmpfsr->local = CSL_FEXT (value, XMC_XMPFSR_LOCAL);
xmpfsr->sr = CSL_FEXT (value, XMC_XMPFSR_SR);
xmpfsr->sw = CSL_FEXT (value, XMC_XMPFSR_SW);
xmpfsr->sx = CSL_FEXT (value, XMC_XMPFSR_SX);
xmpfsr->ur = CSL_FEXT (value, XMC_XMPFSR_UR);
xmpfsr->uw = CSL_FEXT (value, XMC_XMPFSR_UW);
xmpfsr->ux = CSL_FEXT (value, XMC_XMPFSR_UX);
}
/** ============================================================================
* @n@b CSL_XMC_invalidatePrefetchBuffer
*
* @b Description
* @n This function when called marks all slots in the data prefetch buffer and program
* prefetch buffer invalid by writing 1 in the XPFCMD register's INV bit.
*
* @b Arguments
* @n None
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n CSL_XMC_XPFCMD_INV bit set to 1 and data and program prefetch buffers are
* invalidated.
*
* @b Writes
* @n XMC_XPFCMD_INV=1
*
* @b Affects
* @n XMC_XPFADDR_DVH=0,
* XMC_XPFADDR_DVL=0
*
*
* @b Example
* @verbatim
*
CSL_XMC_invalidatePrefetchBuffer ();
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_invalidatePrefetchBuffer (void); /* for misra warnings */
static inline void CSL_XMC_invalidatePrefetchBuffer (void)
{
hXmc->XPFCMD = CSL_FMK(XMC_XPFCMD_INV, (uint32_t)1U);
}
/** ============================================================================
* @n@b CSL_XMC_loadAnalysisCounterEnable
*
* @b Description
* @n This function when called sets the 'ACENL' bit of the XPFCMD register, thus
* triggering a copy/load of ACEN bits (Analysis counter enable mode) into
* ACEN bits of XPFACS register.
*
* @b Arguments
* @n None
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n CSL_XMC_XPFCMD_ACENL bit set to 1 and ACEN bits value is loaded into the
* ACEN bits of XPFACS register.
*
* @b Writes
* @n XMC_XPFCMD_ACENL=1
*
* @b Affects
* @n XMC_XPFACS_ACEN
*
* @b Example
* @verbatim
*
CSL_XMC_loadAnalysisCounterEnable ();
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_loadAnalysisCounterEnable (void);
static inline void CSL_XMC_loadAnalysisCounterEnable (void)
{
hXmc->XPFCMD = CSL_FMK (XMC_XPFCMD_ACENL, (uint32_t)1U);
}
/** ============================================================================
* @n@b CSL_XMC_setAnalysisCounterEnableMode
*
* @b Description
* @n This function when called sets up the Event counting mode by writing to
* the 'ACEN' bits of the XPFCMD register.
*
* @b Arguments
@verbatim
acenMode Analyis counter mode.
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n CSL_XMC_XPFCMD_ACEN bits written with the Analysis counter mode specified.
*
* @b Writes
* @n XMC_XPFCMD_ACEN
*
* @b Example
* @verbatim
// Enable both program and data events
CSL_XMC_setAnalysisCounterEnableMode (CSL_XMC_ACEN_MODE_COUNT_ALL);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_setAnalysisCounterEnableMode (CSL_XMC_ACEN_MODE acenMode);
static inline void CSL_XMC_setAnalysisCounterEnableMode (CSL_XMC_ACEN_MODE acenMode)
{
uint32_t acen;
acen = CSL_FMK(XMC_XPFCMD_ACEN, acenMode);
acen |= CSL_FMK (XMC_XPFCMD_ACENL, (uint32_t)1U);
/* Set all the information for enabling the ACEN at one shot */
hXmc->XPFCMD = acen;
}
/** ============================================================================
* @n@b CSL_XMC_resetAnalysisCounters
*
* @b Description
* @n This function when called sets the 'ACRST' bit of the XPFCMD register, thus
* triggering a clear/reset operation on the prefetch analysis counter registers.
*
* @b Arguments
* @n None
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n CSL_XMC_XPFCMD_ACRST bit set to 1 and prefetch analysis counter registers
* are cleared.
*
* @b Writes
* @n XMC_XPFCMD_ACRST=1
*
* @b Affects
* @n XMC_XPFAC0_SENT=0,
* XMC_XPFAC1_CANCELED=0,
* XMC_XPFAC2_HIT=0,
* XMC_XPFAC3_MISS=0
*
*
* @b Example
* @verbatim
*
CSL_XMC_resetAnalysisCounters ();
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_resetAnalysisCounters (void);
static inline void CSL_XMC_resetAnalysisCounters (void)
{
hXmc->XPFCMD = CSL_FMK(XMC_XPFCMD_ACRST, (uint32_t)1U);
}
/** ============================================================================
* @n@b CSL_XMC_setPrefetchCommand
*
* @b Description
* @n This function sets up the contents of the XPFCMD register based on the
* inputs specified.
*
* @b Arguments
@verbatim
inv Invalidate Prefetch Buffer command flag. When set to 1,
data and program prefetch buffers are invalidated.
acEnLoad Analysis Counter Enable Load flag. When set to 1, the
Analysis Counter Enable mode is loaded into the XPFACS status
register.
acEnMode Analyis counter enable mode. Specifies the event counting mode
for the prefetcher.
acRst Analysis counter Reset flag. When set to 1, resets all
the prefetch event counters.
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n CSL_XMC_XPFCMD written with the settings specified.
*
* @b Writes
* @n XMC_XPFCMD_INV,
* XMC_XPFCMD_ACENL,
* XMC_XPFCMD_ACEN,
* XMC_XPFCMD_ACRST
*
* @b Example
* @verbatim
// Issue the following prefetch commands:
// - Dont invalidate prefetch buffers
// - Enable Analysis Counter Enable load
// - Enable both program and data event counting
// - Dont reset the prefetch counters
CSL_XMC_setPrefetchCommand (0, 1, CSL_XMC_ACEN_MODE_COUNT_ALL, 0);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_setPrefetchCommand
(
Uint8 inv,
Uint8 acEnLoad,
CSL_XMC_ACEN_MODE acenMode,
Uint8 acRst
);
static inline void CSL_XMC_setPrefetchCommand
(
Uint8 inv,
Uint8 acEnLoad,
CSL_XMC_ACEN_MODE acenMode,
Uint8 acRst
)
{
hXmc->XPFCMD = CSL_FMK (XMC_XPFCMD_INV, (Uint32)inv) |
CSL_FMK (XMC_XPFCMD_ACENL, (Uint32)acEnLoad) |
CSL_FMK (XMC_XPFCMD_ACEN, acenMode) |
CSL_FMK (XMC_XPFCMD_ACRST, (Uint32)acRst);
}
/** ============================================================================
* @n@b CSL_XMC_getAnalysisCounterEnableStatus
*
* @b Description
* @n This function returns the Analysis counter enable mode by reading the
* contents of 'ACEN' bits from the XPFACS register.
*
* @b Arguments
* @n None
*
* <b> Return Value </b> CSL_XMC_ACEN_MODE - Event counting mode
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n CSL_XMC_XPFACS_ACEN bits read and returned
*
* @b Reads
* @n XMC_XPFACS_ACEN
*
* @b Example
* @verbatim
CSL_XMC_ACEN_MODE acenMode;
// Read ACEN Mode Status
acenMode = CSL_XMC_getAnalysisCounterEnableStatus ();
if (acenMode == CSL_XMC_ACEN_MODE_COUNT_DISABLE)
{
...
}
@endverbatim
* =============================================================================
*/
static inline CSL_XMC_ACEN_MODE CSL_XMC_getAnalysisCounterEnableStatus (void);
static inline CSL_XMC_ACEN_MODE CSL_XMC_getAnalysisCounterEnableStatus (void)
{
return (CSL_XMC_ACEN_MODE) CSL_FEXT (hXmc->XPFACS, XMC_XPFACS_ACEN);
}
/** ============================================================================
* @n@b CSL_XMC_getNumPrefetchSent
*
* @b Description
* @n This function returns the contents of XPFAC0 register, i.e., the number
* of prefetch requests sent into the system.
*
* @b Arguments
* @n None
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XPFAC0_SENT
*
* @b Example
* @verbatim
Uint32 numPrefetchSent;
// Read Prefetch request sent count
numPrefetchSent = CSL_XMC_getNumPrefetchSent ();
@endverbatim
* =============================================================================
*/
static inline Uint32 CSL_XMC_getNumPrefetchSent (void);
static inline Uint32 CSL_XMC_getNumPrefetchSent (void)
{
return CSL_FEXT (hXmc->XPFAC0, XMC_XPFAC0_SENT);
}
/** ============================================================================
* @n@b CSL_XMC_getNumPrefetchCanceled
*
* @b Description
* @n This function returns the contents of XPFAC1 register, i.e., the number
* of prefetch requests canceled (prefetch requests that returned a non-zero
* rstatus or other error).
*
* @b Arguments
* @n None
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XPFAC1_CANCELED
*
* @b Example
* @verbatim
Uint32 numPrefetchCanceled;
// Read Prefetch request canceled
numPrefetchCanceled = CSL_XMC_getNumPrefetchCanceled ();
@endverbatim
* =============================================================================
*/
static inline Uint32 CSL_XMC_getNumPrefetchCanceled (void);
static inline Uint32 CSL_XMC_getNumPrefetchCanceled (void)
{
return CSL_FEXT (hXmc->XPFAC1, XMC_XPFAC1_CANCELED);
}
/** ============================================================================
* @n@b CSL_XMC_getNumPrefetchHits
*
* @b Description
* @n This function returns the contents of XPFAC2 register, i.e., the number
* of demand prefetch requests that resulted in a successful prefetch.
*
* @b Arguments
* @n None
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XPFAC2_HIT
*
* @b Example
* @verbatim
Uint32 numPrefetchHits;
// Read Number of Prefetch request hits
numPrefetchHits = CSL_XMC_getNumPrefetchHits ();
@endverbatim
* =============================================================================
*/
static inline Uint32 CSL_XMC_getNumPrefetchHits (void);
static inline Uint32 CSL_XMC_getNumPrefetchHits (void)
{
return CSL_FEXT (hXmc->XPFAC2, XMC_XPFAC2_HIT);
}
/** ============================================================================
* @n@b CSL_XMC_getNumPrefetchMisses
*
* @b Description
* @n This function returns the contents of XPFAC3 register, i.e., the number
* of prefetch requests that resulted in a miss and had to be submitted as
* a demand prefetch request into the system.
*
* @b Arguments
* @n None
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XPFAC3_MISS
*
* @b Example
* @verbatim
Uint32 numPrefetchMisses;
// Read Number of Prefetch request misses
numPrefetchMisses = CSL_XMC_getNumPrefetchMisses ();
@endverbatim
* =============================================================================
*/
static inline Uint32 CSL_XMC_getNumPrefetchMisses (void);
static inline Uint32 CSL_XMC_getNumPrefetchMisses (void)
{
return CSL_FEXT (hXmc->XPFAC3, XMC_XPFAC3_MISS);
}
/** ============================================================================
* @n@b CSL_XMC_getPrefetchAddress
*
* @b Description
* @n This function gets the contents of XPFADDR register.
*
* @b Arguments
@verbatim
index Index into the set of 8 registers
xpfaddr CSL_XMC_XPFADDR structure that needs to be filled from
XPFADDR register
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_XPFADDR_ADDR,
* XMC_XPFADDR_DIR,
* XMC_XPFADDR_DPH,
* XMC_XPFADDR_DVH,
* XMC_XPFADDR_AVH,
* XMC_XPFADDR_DPL,
* XMC_XPFADDR_DVL,
* XMC_XPFADDR_AVL
*
* @b Example
* @verbatim
Uint32 index = 0;
CSL_XMC_XPFADDR xpfaddr;
CSL_XMC_getPrefetchAddress (index, &xpfaddr);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_getPrefetchAddress
(
Uint32 index,
CSL_XMC_XPFADDR* xpfaddr
);
static inline void CSL_XMC_getPrefetchAddress
(
Uint32 index,
CSL_XMC_XPFADDR* xpfaddr
)
{
Uint32 value = hXmc->XPFADDR[index];
xpfaddr->addr = CSL_FEXT (value, XMC_XPFADDR_ADDR);
xpfaddr->dir = CSL_FEXT (value, XMC_XPFADDR_DIR);
xpfaddr->dph = CSL_FEXT (value, XMC_XPFADDR_DPH);
xpfaddr->dvh = CSL_FEXT (value, XMC_XPFADDR_DVH);
xpfaddr->avh = CSL_FEXT (value, XMC_XPFADDR_AVH);
xpfaddr->dpl = CSL_FEXT (value, XMC_XPFADDR_DPL);
xpfaddr->dvl = CSL_FEXT (value, XMC_XPFADDR_DVL);
xpfaddr->avl = CSL_FEXT (value, XMC_XPFADDR_AVL);
}
/** ============================================================================
* @n@b CSL_XMC_setMDMAPriority
*
* @b Description
* @n This function configures the priority of transaction submissions to
* Master DMA (MDMA).
*
* @b Arguments
@verbatim
priority Priority value to set for MDMA transactions.
@endverbatim
*
* <b> Return Value </b>
* @n None
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Writes
* @n XMC_MDMAARBX_PRI
*
* @b Example
* @verbatim
Uint32 priority = 4;
CSL_XMC_setMDMAPriority (priority);
@endverbatim
* =============================================================================
*/
static inline void CSL_XMC_setMDMAPriority (Uint32 priority);
static inline void CSL_XMC_setMDMAPriority (Uint32 priority)
{
CSL_FINS (hXmc->MDMAARBX, XMC_MDMAARBX_PRI, priority);
}
/** ============================================================================
* @n@b CSL_XMC_getMDMAPriority
*
* @b Description
* @n This function retrieves the priority of transaction submissions to
* Master DMA (MDMA).
*
* @b Arguments
* @n None
*
* <b> Return Value </b> Uint32
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n None
*
* @b Reads
* @n XMC_MDMAARBX_PRI
*
* @b Example
* @verbatim
Uint32 priority;
priority = CSL_XMC_getMDMAPriority ();
@endverbatim
* =============================================================================
*/
static inline Uint32 CSL_XMC_getMDMAPriority (void);
static inline Uint32 CSL_XMC_getMDMAPriority (void)
{
return CSL_FEXT (hXmc->MDMAARBX, XMC_MDMAARBX_PRI);
}
#ifdef __cplusplus
}
#endif
/* @} */
#endif /* CSL_XMCAUX_H */
|