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 package ti.sdo.ipc.gates;
38
39 import xdc.runtime.Error;
40 import xdc.runtime.Assert;
41 import xdc.runtime.IGateProvider;
42 import xdc.runtime.Diags;
43 import xdc.runtime.Log;
44
45 import ti.sdo.ipc.Ipc;
46
47 import ti.sdo.ipc.interfaces.IGateMPSupport;
48
49 /*!
50 * ======== GateAAMonitor ========
51 * Multiprocessor gate that utilizes an atomic access monitor (AAM)
52 */
53 @InstanceInitError
54
55 module GateAAMonitor inherits IGateMPSupport
56 {
57 /*! @_nodoc */
58 metaonly struct BasicView {
59 Ptr sharedAddr;
60 UInt nested;
61 String enteredBy;
62 }
63
64 /*!
65 * ======== rovViewInfo ========
66 * @_nodoc
67 */
68 @Facet
69 metaonly config xdc.rov.ViewInfo.Instance rovViewInfo =
70 xdc.rov.ViewInfo.create({
71 viewMap: [
72 ['Basic',
73 {
74 type: xdc.rov.ViewInfo.INSTANCE,
75 viewInitFxn: 'viewInitBasic',
76 structName: 'BasicView'
77 }
78 ],
79 ]
80 });
81
82 /*!
83 * ======== A_invSharedAddr ========
84 * Assert raised when supplied sharedAddr is invalid
85 *
86 * C6472 requires that shared region 0 be placed in SL2 memory and that
87 * all GateMP instances be allocated from region 0. The gate itself may
88 * be used to protect the contents of any shared region.
89 */
90 config Assert.Id A_invSharedAddr = {
91 msg: "A_invSharedAddr: Address must be in shared L2 address space"
92 };
93
94 /*!
95 * ======== numInstances ========
96 * Maximum number of instances supported by the GateAAMonitor module
97 */
98 config UInt numInstances = 32;
99
100 instance:
101
102
103 internal:
104
105 /*! Get the lock */
106 @DirectCall
107 UInt getLock(Ptr sharedAddr);
108
109 /*! L1D cache line size is 64 */
110 const UInt CACHELINE_SIZE = 64;
111
112 /*!
113 * Range of SL2 RAM on TMS320TCI6486. Used for ensuring sharedAddr is
114 * valid
115 */
116 const Ptr SL2_RANGE_BASE = 0x00200000;
117 const Ptr SL2_RANGE_MAX = 0x002bffff;
118
119 struct Instance_State {
120 volatile UInt32* sharedAddr;
121 UInt nested;
122 IGateProvider.Handle localGate;
123 };
124 }
125 126 127
128