2 /*
3 * Copyright (C) 2004-2014 Texas Instruments Incorporated - http://www.ti.com/
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 //
37 //
38 // ACP alpha codes
39 //
40 //
41 //
43 #ifndef _ACP_A
44 #define _ACP_A
46 // phi functions
48 #define ACP_PHI_ECHO 0x00
49 #define ACP_PHI_ARITHMETIC 0x01
50 #define ACP_PHI_ALLOC 0x02
51 #define ACP_PHI_FREE 0x03
52 #define ACP_PHI_SLEEP 0x04
53 #define ACP_PHI_STAT 0x05
55 // arithmetic phi function (1) symbol definitions
57 #define ACP_OP 0x80
59 #define ACP_OP_IDENTITY 0x00
60 #define ACP_OP_ADD 0x01
61 #define ACP_OP_SADD 0x02
62 #define ACP_OP_AND 0x03
63 #define ACP_OP_ANDNOT 0x04
64 #define ACP_OP_OR 0x05
65 #define ACP_OP_ORNOT 0x06
66 #define ACP_OP_FLDWRT 0x07
68 #define ACP_OP_SADD16 0x42
70 #define ACP_EQ 0x80
72 #define ACP_EQ_IDENTITY (ACP_EQ+ACP_OP_IDENTITY)
73 #define ACP_EQ_ADD (ACP_EQ+ACP_OP_ADD)
74 #define ACP_EQ_SADD (ACP_EQ+ACP_OP_SADD)
75 #define ACP_EQ_AND (ACP_EQ+ACP_OP_AND)
76 #define ACP_EQ_ANDNOT (ACP_EQ+ACP_OP_ANDNOT)
77 #define ACP_EQ_OR (ACP_EQ+ACP_OP_OR)
78 #define ACP_EQ_ORNOT (ACP_EQ+ACP_OP_ORNOT)
79 #define ACP_EQ_FLDWRT (ACP_EQ+ACP_OP_FLDWRT)
81 #define ACP_EQ_SADD16 (ACP_EQ+ACP_OP_SADD16)
83 // arithmetic alpha code symbol definitions
85 #define writeACPBinaryOp(OP,XX,YY) \
86 0xc90c, /* alpha[12] */ \
87 0xcdf1,(XX)&0xffff, /* args[1] = XX (LSW) */ \
88 0xcdf9,((XX)>>16)&0xffff, /* args[1] = XX (MSW) */ \
89 0xcdf2,(YY)&0xffff, /* args[2] = YY (LSW) */ \
90 0xcdfa,((YY)>>16)&0xffff, /* args[2] = YY (MSW) */ \
91 0xc801,0x1800+(OP), /* args[1] OP= args[2] */ \
92 /* *args[1] OP= args[2] */ \
93 0xcdf0,0xc100 /* args[0] = 0xffffc100 */
95 #define writeACPOpIdentity(XX,YY) writeACPBinaryOp(ACP_OP_IDENTITY,XX,YY)
96 #define writeACPOpAdd(XX,YY) writeACPBinaryOp(ACP_OP_ADD,XX,YY)
97 #define writeACPOpSatAdd(XX,YY) writeACPBinaryOp(ACP_OP_SADD,XX,YY)
98 #define writeACPOpAnd(XX,YY) writeACPBinaryOp(ACP_OP_AND,XX,YY)
99 #define writeACPOpAndNot(XX,YY) writeACPBinaryOp(ACP_OP_ANDNOT,XX,YY)
100 #define writeACPOpOr(XX,YY) writeACPBinaryOp(ACP_OP_OR,XX,YY)
101 #define writeACPOpOrNot(XX,YY) writeACPBinaryOp(ACP_OP_ORNOT,XX,YY)
103 #define writeACPOpSatAdd16(XX,YY) writeACPBinaryOp(ACP_OP_SADD16,XX,YY)
105 #define writeACPEqIdentity(XX,YY) writeACPBinaryOp(ACP_EQ_IDENTITY,XX,YY)
106 #define writeACPEqAdd(XX,YY) writeACPBinaryOp(ACP_EQ_ADD,XX,YY)
107 #define writeACPEqSatAdd(XX,YY) writeACPBinaryOp(ACP_EQ_SADD,XX,YY)
108 #define writeACPEqAnd(XX,YY) writeACPBinaryOp(ACP_EQ_AND,XX,YY)
109 #define writeACPEqAndNot(XX,YY) writeACPBinaryOp(ACP_EQ_ANDNOT,XX,YY)
110 #define writeACPEqOr(XX,YY) writeACPBinaryOp(ACP_EQ_OR,XX,YY)
111 #define writeACPEqOrNot(XX,YY) writeACPBinaryOp(ACP_EQ_ORNOT,XX,YY)
112 #define writeACPEqFldWrt(XX,YY) writeACPBinaryOp(ACP_EQ_FLDWRT,XX,YY)
114 #define writeACPEqSatAdd16(XX,YY) writeACPBinaryOp(ACP_EQ_SADD16,XX,YY)
116 // comparison code (xi) symbol definitions
118 #define ACP_XI_TRUE 0
119 #define ACP_XI_FALSE 1
120 #define ACP_XI_EQ 2
121 #define ACP_XI_NE 3
122 #define ACP_XI_GE 4
123 #define ACP_XI_GT 5
124 #define ACP_XI_LE 6
125 #define ACP_XI_LT 7
126 #define ACP_XI_AND 8
127 #define ACP_XI_NOR 9
129 // memory statistics alpha code symbol definitions
131 #define ACP_SEG_IRAM 0
132 #define ACP_SEG_SDRAM 1
133 #define ACP_SEG_L3RAM 2
135 #define ACP_STAT_SIZE 0
136 #define ACP_STAT_USED 1
137 #define ACP_STAT_LENGTH 2
138 #define ACP_STAT_FREE 3
140 #define readACPStat(XX,YY) \
141 0xcdf0,ACP_SEG_##XX, \
142 /* Type 5-24X Write: arg[0] = ACP_SEG_* -- response=null */ \
143 0xc800+ACP_PHI_STAT,0x0d00+ACP_STAT_##YY \
144 /* Type 0 Write: IACP_stat( arg[0], (arg[1] = ACP_STAT_*) */ \
145 /* -- response=2 words (binary data: LSW, MSW of requested statistic) */
147 #define readACPStatIRAMSize readACPStat(IRAM,SIZE)
148 #define readACPStatIRAMUsed readACPStat(IRAM,USED)
149 #define readACPStatIRAMLength readACPStat(IRAM,LENGTH)
150 #define readACPStatIRAMFree readACPStat(IRAM,FREE)
152 #define readACPStatSDRAMSize readACPStat(SDRAM,SIZE)
153 #define readACPStatSDRAMUsed readACPStat(SDRAM,USED)
154 #define readACPStatSDRAMLength readACPStat(SDRAM,LENGTH)
155 #define readACPStatSDRAMFree readACPStat(SDRAM,FREE)
157 #define readACPStatL3RAMSize readACPStat(L3RAM,SIZE)
158 #define readACPStatL3RAMUsed readACPStat(L3RAM,USED)
159 #define readACPStatL3RAMLength readACPStat(L3RAM,LENGTH)
160 #define readACPStatL3RAMFree readACPStat(L3RAM,FREE)
162 // await alpha code symbol definitions
164 #endif /* _ACP_A */