Permalink
Browse files

Renamed nero* operations to jtag*; added jtagOpen() & jtagClose()

  • Loading branch information...
1 parent c6c8d81 commit b66d9ae951176bcaf409719529a1c0e898925d8d makestuff committed Mar 19, 2013
Showing with 167 additions and 184 deletions.
  1. +13 −13 csvfplay.c
  2. +12 −4 libfpgalink.h
  3. +3 −5 private.h
  4. +139 −162 prog.c
View
@@ -63,7 +63,7 @@ FLStatus csvfPlay(struct FLContext *handle, const uint8 *csvfData, const char **
uint8 *tdiAll;
const uint8 *ptr = csvfData;
- fStatus = neroClockFSM(handle, 0x0000001F, 6, error); // Reset TAP, goto Run-Test/Idle
+ fStatus = jtagClockFSM(handle, 0x0000001F, 6, error); // Reset TAP, goto Run-Test/Idle
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
thisByte = *ptr++;
@@ -101,7 +101,7 @@ FLStatus csvfPlay(struct FLContext *handle, const uint8 *csvfData, const char **
break;
case XSIR:
- fStatus = neroClockFSM(handle, 0x00000003, 4, error); // -> Shift-IR
+ fStatus = jtagClockFSM(handle, 0x00000003, 4, error); // -> Shift-IR
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
numBits = *ptr++;
#ifdef DEBUG
@@ -119,12 +119,12 @@ FLStatus csvfPlay(struct FLContext *handle, const uint8 *csvfData, const char **
#ifdef DEBUG
printf(")\n");
#endif
- fStatus = neroShift(handle, numBits, tdiData, NULL, true, error); // -> Exit1-DR
+ fStatus = jtagShift(handle, numBits, tdiData, NULL, true, error); // -> Exit1-DR
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
- fStatus = neroClockFSM(handle, 0x00000001, 2, error); // -> Run-Test/Idle
+ fStatus = jtagClockFSM(handle, 0x00000001, 2, error); // -> Run-Test/Idle
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
if ( xruntest ) {
- fStatus = neroClocks(handle, xruntest, error);
+ fStatus = jtagClocks(handle, xruntest, error);
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
}
break;
@@ -153,14 +153,14 @@ FLStatus csvfPlay(struct FLContext *handle, const uint8 *csvfData, const char **
numBytes = bitsToBytes(xsdrSize);
i = 0;
do {
- fStatus = neroClockFSM(handle, 0x00000001, 3, error); // -> Shift-DR
+ fStatus = jtagClockFSM(handle, 0x00000001, 3, error); // -> Shift-DR
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
- fStatus = neroShift(handle, xsdrSize, tdiData, tdoData, true, error); // -> Exit1-DR
+ fStatus = jtagShift(handle, xsdrSize, tdiData, tdoData, true, error); // -> Exit1-DR
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
- fStatus = neroClockFSM(handle, 0x0000001A, 6, error); // -> Run-Test/Idle
+ fStatus = jtagClockFSM(handle, 0x0000001A, 6, error); // -> Run-Test/Idle
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
if ( xruntest ) {
- fStatus = neroClocks(handle, xruntest, error);
+ fStatus = jtagClocks(handle, xruntest, error);
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
}
i++;
@@ -189,21 +189,21 @@ FLStatus csvfPlay(struct FLContext *handle, const uint8 *csvfData, const char **
// TODO: Need to print actual TDO data too
printf("XSDR(%08X)\n", xsdrSize);
#endif
- fStatus = neroClockFSM(handle, 0x00000001, 3, error); // -> Shift-DR
+ fStatus = jtagClockFSM(handle, 0x00000001, 3, error); // -> Shift-DR
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
numBytes = bitsToBytes(xsdrSize);
tdiAll = malloc(numBytes);
tdiPtr = tdiAll;
while ( numBytes-- ) {
*tdiPtr++ = *ptr++;
}
- fStatus = neroShift(handle, xsdrSize, tdiAll, NULL, true, error); // -> Exit1-DR
+ fStatus = jtagShift(handle, xsdrSize, tdiAll, NULL, true, error); // -> Exit1-DR
free(tdiAll);
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
- fStatus = neroClockFSM(handle, 0x00000001, 2, error); // -> Run-Test/Idle
+ fStatus = jtagClockFSM(handle, 0x00000001, 2, error); // -> Run-Test/Idle
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
if ( xruntest ) {
- fStatus = neroClocks(handle, xruntest, error);
+ fStatus = jtagClocks(handle, xruntest, error);
CHECK_STATUS(fStatus, "csvfPlay()", fStatus);
}
break;
View
@@ -693,26 +693,34 @@ extern "C" {
struct FLContext *handle, const char *portConfig, const char **error
) WARN_UNUSED_RESULT;
- // Special values for inData parameter of neroShift() declared below
+ // Special values for inData parameter of jtagShift() declared below
#define ZEROS (const uint8*)NULL
#define ONES (ZEROS - 1)
+ DLLEXPORT(FLStatus) jtagOpen(
+ struct FLContext *handle, const char *portConfig, uint32 index, const char **error
+ ) WARN_UNUSED_RESULT;
+
+ DLLEXPORT(FLStatus) jtagClose(
+ struct FLContext *handle, const char **error
+ ) WARN_UNUSED_RESULT;
+
// Shift "numBits" bits from "inData" into TDI, at the same time shifting the same number of
// bits from TDO into "outData". If "isLast" is true, leave Shift-DR state on final bit. If you
// want inData to be all zeros or all ones, you can use ZEROS or ONES respectively. This is more
// efficient than physically sending an array containing all zeros or all 0xFFs.
- DLLEXPORT(FLStatus) neroShift(
+ DLLEXPORT(FLStatus) jtagShift(
struct FLContext *handle, uint32 numBits, const uint8 *inData, uint8 *outData, bool isLast,
const char **error
) WARN_UNUSED_RESULT;
// Clock "transitionCount" bits from "bitPattern" into TMS, starting with the LSB.
- DLLEXPORT(FLStatus) neroClockFSM(
+ DLLEXPORT(FLStatus) jtagClockFSM(
struct FLContext *handle, uint32 bitPattern, uint8 transitionCount, const char **error
) WARN_UNUSED_RESULT;
// Toggle TCK "numClocks" times.
- DLLEXPORT(FLStatus) neroClocks(
+ DLLEXPORT(FLStatus) jtagClocks(
struct FLContext *handle, uint32 numClocks, const char **error
) WARN_UNUSED_RESULT;
//@}
View
@@ -42,11 +42,9 @@ extern "C" {
bool isNeroCapable;
uint8 progOutEP;
uint8 progInEP;
- //uint16 endpointSize;
- //uint8 masks[4];
- //uint8 ports[4];
- //bool usesCustomPorts;
-
+ uint8 maskList[5];
+ uint8 ddrList[5];
+ uint8 portList[5];
};
// Write some raw bytes to the FL. Sync problems (requiring power-cycle to clear) will
Oops, something went wrong.

0 comments on commit b66d9ae

Please sign in to comment.