/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/linuxBuild.sh
File deleted
/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/mlab_xvcd.cpp
13,10 → 13,8
// 1.02 2012_12 Error handling and debugged
// 1.03 2012_12 Release version ready to publish
// 1.04 2013_04 Socket Bind Error with explanation (multiple instance of XVC Server)
// 1.05 2013_04 Test FTDI cable during wait for Accept (to stop the server immediately when cable is disconnected)
// 1.06 2013_04 Added support for Linux (thanks to Martin Poviser)
// 1.07 2013_04 Rewritten Host Address function for Linux (function gethostbyname returns 127.0.1.1 on Debian systems)
// Solved compatibility problems on Linux (FT_SetLatncyTimer requires delay, udev problem with ftdi_sio driver)
// 1.05 2013-04 Test FTDI cable during wait for Accept (to stop the server immediately when cable is disconnected)
// 1.06 2013-04 Added support for Linux (thanks to Martin Poviser)
//
//
// Purpose:
85,6 → 83,7
//
// Possible improvements:
//
// Linux version (not fully functional yet).
// External definition of JTAG pins.
// Enable Socket Number (to be able to run multiple XVC Servers), now it is constant XVC_TCP_PORT (should be only a default)
 
119,9 → 118,6
#include <errno.h>
#include <unistd.h>
#include <netdb.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
 
#endif
 
469,13 → 465,10
}
#endif
 
// Display HostName
// Display HostName and Address
char sMyName[255];
gethostname(sMyName, sizeof(sMyName));
printf(" Host Name %s\n", sMyName);
 
// Display Address
#ifdef WIN32
hostent * pHostInfo;
pHostInfo = gethostbyname(sMyName);
printf(" Network Name %s\n", pHostInfo->h_name);
488,34 → 481,7
}
printf("%d\n", (unsigned char)pHostInfo->h_addr_list[0][pHostInfo->h_length-1]);
}
#else
int TempSocket;
struct ifreq ifreqs[20];
struct ifconf ic;
 
ic.ifc_len = sizeof ifreqs;
ic.ifc_req = ifreqs;
 
TempSocket = socket(AF_INET, SOCK_DGRAM, 0);
if (TempSocket < 0) {
perror("socket");
return -2;
}
 
if (ioctl(TempSocket, SIOCGIFCONF, &ic) < 0) {
perror("SIOCGIFCONF");
return -2;
}
 
for (int i = 0; i < ic.ifc_len/sizeof(struct ifreq); ++i)
{
if (ifreqs[i].ifr_name[0]!='l')// remove lo
printf(" Host Address %s: %s\n",
ifreqs[i].ifr_name,
inet_ntoa(((struct sockaddr_in*)&ifreqs[i].ifr_addr)->sin_addr));
}
#endif
 
// Create Protocol Structure
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/mlab_xvcd.h
1,7 → 1,7
// Program Version
// ---------------
 
#define VERSION "1.07" // Program version
#define VERSION "1.06" // Program version
#define YEAR "2013" // Year of the program
 
// JTAG Port Definitions
/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/BIN/10-MLAB-XVC-FTDI.rules
File deleted
/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/BIN/mlab_xvcd.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/BIN/mlab_xvcd_i386
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/CPLD_FPGA/XILINX_XVC/XVC_SOFTWARE/XVC_1x/mlab_xvcd_port_FTDI.cpp
1,16 → 1,7
// Include FTDI library
#include "mlab_xvcd_port_FTDI.h"
 
#ifdef WIN32
 
#include <windows.h> // Windows Console Application (Sleep)
 
#else
 
#include <unistd.h> // sleep
 
#endif
 
// JTAG Output Pin Mask
#define IO_OUTPUT_MASK (PORT_TCK|PORT_TDI|PORT_TMS|PORT_LED) // Mask for all Output Pins
 
294,14 → 285,6
fprintf(stderr, "FTDI: Set USB Latency Timer Failed %d\n", ftStatus);
}
 
// Fix (without this delay the next FT_Read hang for ever)
// My Linux i5 notebook requires at least 2500us
#ifdef WIN32
Sleep(10); //ms
#else
usleep(10000); //us
#endif
 
printf("\n");
return 0;
}
310,8 → 293,9
// Enable or Disable Activity LED
void jtagSetLED(bool LedEnable)
{
 
// DBUS Connected LED (BitBang Mode)
LedMask = LedEnable ? (0xFF & PORT_LED) : 0; // Set mask for jtagScan function
LedMask = LedEnable ? (PORT_LED & 0xFF) : 0; // Set mask for jtagScan function
if (PORT_LED & 0xFF)
{
// Set / Reset LED Pin
321,6 → 305,7
unsigned char Dummy;
FT_Write(ftHandle, &DataOut, 1, &BytesWritten ); // Send 1 byte
FT_Read (ftHandle, &Dummy, 1, &BytesReceived); // Read 1 byte
//printf("[PinStatus %x DataOut %x]", PinStatus, DataOut);
}
 
// CBUS Connected LED (BitBang Mode) 1 and 0 state of the port