26 "[UNKNOWN TYPE 0]",
"TYPE1",
"TYPE2",
"[UNKNOWN TYPE 3]",
"[UNKNOWN TYPE 4]",
27 "[UNKNOWN TYPE 5]",
"[UNKNOWN TYPE 6]",
"[UNKNOWN TYPE 7]"
31 "NOP",
"READ",
"WRITE",
"RESERVED"
35 "CRC",
"FARMAJ",
"FARMIN",
"FDRI",
"FDRO",
"CMD",
"CTL",
"MASK",
"STAT",
"LOUT",
"COR1",
36 "COR2",
"PWRDN_REG",
"FLR",
"IDCODE",
"CWDT",
"HC_OPT_REG",
"[UNUSED REGISTER 17]",
"CSBO",
37 "GENERAL1",
"GENERAL2",
"GENERAL3",
"GENERAL4",
"GENERAL5",
"MODE_REG",
"PU_GWE",
"PU_GTS",
38 "MFWR",
"CCLK_FREQ",
"SEU_OPT",
"EXP_SIGN",
"RDBK_SIGN",
"BOOSTS",
"EYE_MASK",
"CBC_REG"
42 "NULL",
"WCFG",
"MFW",
"LFRM",
"RCFG",
"START",
"[UNKNOWN COMMAND 6]",
"RCRC",
"AGHIGH",
43 "[UNKNOWN COMMAND 9]",
"GRESTORE",
"SHUTDOWN",
"[UNKNOWN COMMAND 12]",
"DESYNC",
"IPROG"
46 #define VALUES (const char*[])
50 {0x0003, 0,
"StartupClk",
"SSCLKSRC", 0,
53 VALUES{
"Cclk",
"UserClk",
"JtagClk",
"TCK", 0}},
54 {0x0004, 2,
"DriveDone",
"DRIVE_DONE", 0,
58 {0x0008, 3,
"DonePipe",
"DONE_PIPE", 0,
62 {0x0010, 4,
"CRC_Bypass",
"CRC_BYPASS", 0,
66 {0x1000, 15,
"Drive_Awake",
"DRIVE_AWAKE", 0,
76 {0x0007, 0,
"GWE_cycle",
"GWE_CYCLE", 6,
79 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
80 {0x0038, 3,
"GTS_cycle",
"GTS_CYCLE", 5,
83 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
84 {0x01c0, 6,
"LCK_cycle",
"LOCK_CYCLE", 7,
87 VALUES{
"1",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"NoWait", 0}},
88 {0x0E00, 9,
"DONE_cycle",
"DONE_CYCLE", 4,
91 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
92 {0x8000, 15,
"Reset_on_err",
"RESET_ON_ERROR", 0,
95 VALUES{
"Disable",
"Enable", 0}},
102 {0x0001, 0,
"CRC_error",
"CRC_ERROR", 0,
106 {0x0002, 1,
"ID_error",
"ID_ERROR", 0,
110 {0x0004, 2,
"DCM_locked",
"DCM_LOCK", 0,
114 {0x0008, 3,
"GTS_CFG",
"GTS_CFG_B", 0,
118 {0x0010, 4,
"GWE",
"GWE", 0,
122 {0x0020, 5,
"GWHIGH",
"GWHIGH_B", 0,
126 {0x0040, 6,
"DEC_ERROR",
"DEC_ERROR", 0,
130 {0x0080, 7,
"PART_SECURED",
"PART_SECURED", 0,
134 {0x0100, 8,
"HSWAPEN",
"HSWAPEN", 0,
138 {0x0800, 9,
"Mode",
"MODE", 0,
141 VALUES{
"MasterSerial",
"SlaveSelectMap32",
"[UNDEFINED 2]",
"MasterSelectMap",
142 "[UNDEFINED 3]",
"JTAG",
"SlaveSelectMap8",
"[UNDEFINED 6]",
"SlaveSerial", 0}},
143 {0x1000, 12,
"INIT",
"INIT_B", 0,
146 VALUES{
"Deasserted",
"Asserted", 0}},
147 {0x2000, 13,
"Done",
"DONE", 0,
150 VALUES{
"Deasserted",
"Asserted", 0}},
151 {0x4000, 14,
"IN_PWRDN",
"IN_PWRDN", 0,
155 {0x4000, 15,
"SWWD_Strikeout",
"SWWD_strikeout", 0,
168 {0x0002, 1,
"CRC_EXTSTAT_DISABLE",
"CRC_EXTSTAT_DISABLE", 0,
172 {0x0004, 2,
"USE_EFUSE_KEY",
"USE_EFUSE_KEY", 0,
176 {0x0008, 3,
"Persist",
"PERSIST", 0,
180 {0x0030, 4,
"Security",
"SBITS", 0,
184 VALUES{
"None",
"Level1",
"Level2",
"Level2", 0}},
185 {0x0040, 6,
"DEC",
"DEC", 0,
194 {0x0001, 0,
"RESERVED",
"RESERVED", 0,
VALUES{
"Protected",
"Writable", 0}},
195 {0x0002, 1,
"CRC_EXTSTAT_DISABLE",
"CRC_EXTSTAT_DISABLE", 0,
196 VALUES{
"Protected",
"Writable", 0}},
197 {0x0004, 2,
"USE_EFUSE_KEY",
"USE_EFUSE_KEY", 0,
VALUES{
"Protected",
"Writable", 0}},
198 {0x0008, 3,
"Persist",
"PERSIST", 0,
VALUES{
"Protected",
"Writable", 0}},
199 {0x0030, 4,
"Security",
"SBITS", 0,
200 VALUES{
"Protected",
"[UNKNOWN 1]",
"[UNKNOWN 2]",
"Writable", 0}},
201 {0x0040, 6,
"DEC",
"DEC", 0,
VALUES{
"Protected",
"Writable", 0}},
207 {0x0001, 0,
"KEEP_SCLK",
"KEEP_SCLK", 1,
212 {0x0004, 2,
"EN_PWRDN",
"EN_PWRDN", 0,
216 {0x0010, 4,
"EN_PGSR",
"EN_PGSR", 0,
221 {0x0020, 5,
"FILTER",
"FILTER_B", 0,
225 {0x4000, 14,
"EN_EYES",
"EN_EYES", 0,
228 VALUES{
"Disable",
"Enable", 0}},
234 {0x0040, 6,
"INIT_SKIP",
"INIT_SKIP", 0,
243 {0x0080, 0,
"BOOTVSEL",
"BOOTVSEL", 0,
246 VALUES{
"[READ ONLY]", 0}},
247 {0x0400, 8,
"BOOTMODE",
"BOOTMODE", 1,
251 {0x1000, 11,
"BUSWIDTH",
"BUSWIDTH", 0,
254 VALUES{
"0",
"1",
"2", 0}},
255 {0x2000, 13,
"NEW_MODE",
"NEW_MODE", 0,
264 {0x0001, 0,
"VALID_0",
"VALID_O", 0,
268 {0x0002, 1,
"FALLBACK_O",
"FALLBACK_0", 0,
272 {0x0008, 3,
"WTO_ERROR_0",
"WTO_ERROR_0", 0,
276 {0x0010, 4,
"ID_ERROR_0",
"ID_ERROR_0", 0,
280 {0x0020, 5,
"CRC_ERROR_0",
"CRC_ERROR_0", 0,
284 {0x0040, 6,
"VALID_1",
"VALID_1", 0,
288 {0x0080, 7,
"FALLBACK_1",
"FALLBACK_1", 0,
292 {0x0200, 9,
"WTO_ERROR_1",
"WTO_ERROR_1", 0,
296 {0x0400, 10,
"ID_ERROR_1",
"ID_ERROR_1", 0,
300 {0x0800, 11,
"CRC_ERROR_1",
"CRC_ERROR_1", 0,
309 {0x0001, 0,
"SEU_ENABLE",
"SEU_ENABLE", 0,
312 VALUES{
"DISABLE",
"ENABLE", 0}},
313 {0x0002, 1,
"GLUT_MASK",
"GLUT_MASK", 1,
316 VALUES{
"Unmask",
"Mask LUTRAM/SRL", 0}},
317 {0x0008, 3,
"SEU_RUN_ON_ERR",
"SEU_RUN_ON_ERR", 0,
320 VALUES{
"Halt",
"Run", 0}},
321 {0x0010, 4,
"SEU_FREQ",
"SEU_FREQ", 0,
331 const Subfield* subfields;
345 for(
uint16_t field = 0; subfields[field].mMask != 0; field++) {
346 const Subfield& subfield = subfields[field];
347 if(inSubfield != subfield.mBitgenName && inSubfield != subfield.mConfigGuideName)
349 const char** ptr = subfield.
mValues;
350 for(
uint32_t i = 0; *ptr != 0; i++, ptr++) {
351 if(inSetting == *ptr)
return (i << subfield.mShift) & subfield.mMask;
static const char * sCommandName[eCommandCount]
Configuration command names.
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
static const Subfield sCOR2[]
Configuration Options Register 2 (COR2) subfields.
static const Subfield sCTL[]
Control Register 0 (CTL0) subfields.
static const Subfield sMODE_REG[]
Mode Register (Mode) subfields.
Header for the Spartan6 class.
boost::uint32_t uint32_t
Imported type name.
static uint16_t makeSubfield(ERegister inRegister, const std::string &inSubfield, const std::string &inSetting)
Return the masked value for a subfield of the specified register.
static const char * sRegisterName[eRegisterCount]
Configuration register names.
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
static const Subfield sHC_OPT_REG[]
HC_OPT_REG Register (PWRDN_REG) subfields.
static const Subfield sSEU_OPT[]
SEU_OPT Register (SEU_OPT) subfields.
static const Subfield sCOR1[]
Configuration Options Register 1 (COR1) subfields.
ERegister
Configuration register enumeration.
static const Subfield sBOOSTS[]
BOOSTS Register (BOOSTS) subfields.
static const Subfield sSTAT[]
Status Register (STAT) subfields.
boost::uint16_t uint16_t
Imported type name.
static const Subfield sPWRDN_REG[]
Suspend Register (PWRDN_REG) subfields.
const char ** mValues
The allowable subfield values.