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