24 #ifndef P33C_DSP_SFR_ABSTRACTION_H
25 #define P33C_DSP_SFR_ABSTRACTION_H
43 #define REG_CORCON_UNUSED_MSK 0b0100000000000000
44 #define REG_CORCON_VALID_DATA_WRITE_MSK 0b1011100011110011
45 #define REG_CORCON_VALID_DATA_READ_MSK 0b1011111111111111
47 #define REG_CORCON_VAR_VARIABLE 0b1000000000000000
48 #define REG_CORCON_VAR_FIXED 0b0000000000000000
51 CORCON_VAR_VARIABLE = 0b1,
52 CORCON_VAR_FIXED = 0b0
55 #define REG_CORCON_US_MIXED 0b0010000000000000 // DSP engine multiplies are mixed sign
56 #define REG_CORCON_US_UNSIGNED 0b0001000000000000 // DSP engine multiplies are unsigned
57 #define REG_CORCON_US_SIGNED 0b0000000000000000 // DSP engine multiplies are signed
60 CORCON_US_MIXED = 0b10,
61 CORCON_US_UNSIGNED = 0b01,
62 CORCON_US_SIGNED = 0b00
65 #define REG_CORCON_EDT_TERMINATE 0b0000100000000000
66 #define REG_CORCON_EDT_RUN 0b0000000000000000
69 CORCON_EDT_TERMINATE = 0b1,
73 #define REG_CORCON_DL_7 0b0000011100000000 // Seven DO loops are active
74 #define REG_CORCON_DL_6 0b0000011100000000 // Six DO loops are active
75 #define REG_CORCON_DL_5 0b0000011100000000 // Five DO loops are active
76 #define REG_CORCON_DL_4 0b0000011100000000 // Four DO loops are active
77 #define REG_CORCON_DL_3 0b0000011100000000 // Three DO loops are active
78 #define REG_CORCON_DL_2 0b0000011100000000 // Two DO loops are active
79 #define REG_CORCON_DL_1 0b0000011100000000 // One DO loops are active
80 #define REG_CORCON_DL_0 0b0000011100000000 // Zero DO loops are active
93 #define REG_CORCON_SATA_ON 0b0000000010000000 // Accumulator A saturation is enabled
94 #define REG_CORCON_SATA_OFF 0b0000000000000000 // Accumulator A saturation is disabled
101 #define REG_CORCON_SATB_ON 0b0000000001000000 // Accumulator B saturation is enabled
102 #define REG_CORCON_SATB_OFF 0b0000000000000000 // Accumulator B saturation is disabled
105 CORCON_SATB_ON = 0b1,
106 CORCON_SATB_OFF = 0b0
109 #define REG_CORCON_SATDW_ON 0b0000000000100000 // Data Space write saturation is enabled
110 #define REG_CORCON_SATDW_OFF 0b0000000000000000 // Data Space write saturation is disabled
113 CORCON_SATDW_ON = 0b1,
114 CORCON_SATDW_OFF = 0b0
117 #define REG_CORCON_ACCSAT_931 0b0000000000010000 // 9.31 saturation (super saturation)
118 #define REG_CORCON_ACCSAT_131 0b0000000000000000 // 1.31 saturation (normal saturation)
121 CORCON_ACCSAT_931 = 0b1,
122 CORCON_ACCSAT_131 = 0b0
125 #define REG_CORCON_IPL3_STAT_GT7 0b0000000000001000
126 #define REG_CORCON_IPL3_STAT_LT7 0b0000000000000000
129 CORCON_IPL3_STAT_GT7 = 0b1,
130 CORCON_IPL3_STAT_LT7 = 0b0
131 } CORCON_IPL3_STAT_e;
133 #define REG_CORCON_SFA_ACTIVE 0b0000000000000100 // Stack frame is active; W14 and W15 address 0x0000 to 0xFFFF, regardless of DSRPAG
134 #define REG_CORCON_SFA_INACTIVE 0b0000000000000000 // Stack frame is not active; W14 and W15 address the base Data Space
137 CORCON_SFA_ACTIVE = 0b1,
138 CORCON_SFA_INACTIVE = 0b0
141 #define REG_CORCON_RND_BIASED 0b0000000000000010 // Biased (conventional) rounding is enabled
142 #define REG_CORCON_RND_UNBIASED 0b0000000000000000 // Unbiased (convergent) rounding is enabled
145 CORCON_RND_BIASED = 0b1,
146 CORCON_RND_UNBIASED = 0b0
149 #define REG_CORCON_IF_INTEGER 0b0000000000000001 // Integer mode is enabled for DSP multiply
150 #define REG_CORCON_IF_FRACTIONAL 0b0000000000000000 // Fractional mode is enabled for DSP multiply
153 CORCON_IF_INTEGER = 0b1,
154 CORCON_IF_FRACTIONAL = 0b0
161 volatile CORCON_IF_e
IF : 1;
162 volatile CORCON_RND_e
RND : 1;
163 volatile CORCON_SFA_e
SFA : 1;
164 volatile CORCON_IPL3_STAT_e
IPL3 : 1;
167 volatile CORCON_SATB_e
SATB : 1;
168 volatile CORCON_SATA_e
SATA : 1;
170 volatile CORCON_DL_STAT_e
DL : 3;
171 volatile CORCON_EDT_e
EDT : 1;
172 volatile CORCON_US_e
US : 2;
174 volatile CORCON_VAR_e
VAR : 1;
175 } __attribute__((packed)) bits;