FPGARelated.com
Forums

Open-source CableServer for Impact on sourceforge.net

Started by zcsi...@gmail.com September 6, 2006
Hi All,

Here is a open-source CableServer replacement for Xilinx Impact.
Currently Parallel III and Altera ByteBlaster are supported, but any
3rd party programmer cable can be implemented easily and can be used
from Impact. This open-source implementation can be used as a
Programmer Cable SDK for Impact.

I've tested only Impact 8.2, if anybody has any problem with 7.1,
please let me know!

Impact and Xilinx CableServer communication are very pooly written.
There is no error recovery at all. If server stops, Impact GUI will
crash. To avoid this you must disconnect server from GUI using
Output/Cavble disconnect menu.

http://sourceforge.net/projects/xilprg
http://sourceforge.net/project/showfiles.php?group_id=175344&package_id=203209

Regards,

Zoltan

zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote:
> Hi All,
> Here is a open-source CableServer replacement for Xilinx Impact. > Currently Parallel III and Altera ByteBlaster are supported, but any > 3rd party programmer cable can be implemented easily and can be used > from Impact. This open-source implementation can be used as a > Programmer Cable SDK for Impact.
> I've tested only Impact 8.2, if anybody has any problem with 7.1, > please let me know!
> Impact and Xilinx CableServer communication are very pooly written. > There is no error recovery at all. If server stops, Impact GUI will > crash. To avoid this you must disconnect server from GUI using > Output/Cavble disconnect menu.
> http://sourceforge.net/projects/xilprg > http://sourceforge.net/project/showfiles.php?\
group_id=175344&package_id=203209 I am trying to run cblsrv on Linux (Suse10.0) with a dlc5 clone (selfmade). Impact with windrvr recognizes the chain. cblsrv -d3 -cdlc5:/dev/parport0 -p 2000 doesn't find the chain. Obviosly PARPORT_DIRECT needs to get undefined with PARPORT_PPDEV --- cblsrv-0.1/src/parport.h~ 2006-09-06 07:36:08.000000000 +0200 +++ cblsrv-0.1/src/parport.h 2006-09-06 10:35:16.000000000 +0200 @@ -50,6 +50,7 @@ // Define this if you want to support parport access by /dev/parportX #if !defined(WIN32) && !defined(__CYGWIN__) +#undef PARPORT_DIRECT #define PARPORT_PPDEV #endif Running as root with direct io works. After the patch, running with PARPORT_PPDEV and reading the ID results in a crash of cblsrc: Program received signal SIGSEGV, Segmentation fault. 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 306 tdi_byte = *pw++; (gdb) p pw $1 = (u8 *) 0x8070000 <Address 0x8070000 out of bounds> (gdb) bt #0 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 #1 0x0804aedb in cable::write (this=0x804f008, mode=64, wbuff=@0xbf8fea68, cmp_rbuff=@0xbf8fea50) at cable.cpp:345 #2 0x080499db in do_cmd_write () at cblsrv.cpp:258 #3 0x08049f26 in do_msg_commands () at cblsrv.cpp:447 #4 0x0804a35a in client_connection () at cblsrv.cpp:584 #5 0x0804a53a in main (argc=5, argv=0xbf8feb84) at cblsrv.cpp:800 num-bit seems a little off. Any ideas? Otherwise I'll try to debug in the next days. B.t.w.: Do you have some smaller test client. Starting impact and clicking a zillion time to get to some point in the jtag handling is tedious... -- Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Uwe Bonnes schrieb:

> zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote: > > Hi All, > > > Here is a open-source CableServer replacement for Xilinx Impact. > > Currently Parallel III and Altera ByteBlaster are supported, but any > > 3rd party programmer cable can be implemented easily and can be used > > from Impact. This open-source implementation can be used as a > > Programmer Cable SDK for Impact. > > > I've tested only Impact 8.2, if anybody has any problem with 7.1, > > please let me know! > > > Impact and Xilinx CableServer communication are very pooly written. > > There is no error recovery at all. If server stops, Impact GUI will > > crash. To avoid this you must disconnect server from GUI using > > Output/Cavble disconnect menu. > > > http://sourceforge.net/projects/xilprg > > http://sourceforge.net/project/showfiles.php?\ > group_id=175344&package_id=203209 > I am trying to run cblsrv on Linux (Suse10.0) with a dlc5 clone (selfmade). > Impact with windrvr recognizes the chain. > cblsrv -d3 -cdlc5:/dev/parport0 -p 2000 doesn't find the chain. > Obviosly PARPORT_DIRECT needs to get undefined with PARPORT_PPDEV > --- cblsrv-0.1/src/parport.h~ 2006-09-06 07:36:08.000000000 +0200 > +++ cblsrv-0.1/src/parport.h 2006-09-06 10:35:16.000000000 +0200 > @@ -50,6 +50,7 @@ > > // Define this if you want to support parport access by /dev/parportX > #if !defined(WIN32) && !defined(__CYGWIN__) > +#undef PARPORT_DIRECT > #define PARPORT_PPDEV > #endif > > Running as root with direct io works. > > After the patch, running with PARPORT_PPDEV and reading the ID results in a > crash of cblsrc: > > Program received signal SIGSEGV, Segmentation fault. > 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > 306 tdi_byte = *pw++; > (gdb) p pw > $1 = (u8 *) 0x8070000 <Address 0x8070000 out of bounds> > (gdb) bt > #0 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > #1 0x0804aedb in cable::write (this=0x804f008, mode=64, wbuff=@0xbf8fea68, > cmp_rbuff=@0xbf8fea50) at cable.cpp:345 > #2 0x080499db in do_cmd_write () at cblsrv.cpp:258 > #3 0x08049f26 in do_msg_commands () at cblsrv.cpp:447 > #4 0x0804a35a in client_connection () at cblsrv.cpp:584 > #5 0x0804a53a in main (argc=5, argv=0xbf8feb84) at cblsrv.cpp:800 > > num-bit seems a little off. > > Any ideas? Otherwise I'll try to debug in the next days. > > B.t.w.: Do you have some smaller test client. Starting impact and clicking a > zillion time to get to some point in the jtag handling is tedious... > > > -- > Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de > > Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt > --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
there is no other test client as impact yet. I assume there will be since the cableserver protocol is now "open" :) Antti PS the cblsrv works perfectly on WinXP!
On Linux the only test I did was using VmWare with direct I/O access
(actually ppdev didn't work for me, it said PPEXCL  failed).

Did you try to use with DIRECT_IO?

There is a cablehost directory under src. You can patch that to connect
to server and send some messages. I've used it to connet tit to the
Xilinx CableServer and figure out what the different write modes meant

Zoltan

PS:
This weeken I'll try to more Linux testing.

Uwe Bonnes wrote:
> zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote: > > Hi All, > > > Here is a open-source CableServer replacement for Xilinx Impact. > > Currently Parallel III and Altera ByteBlaster are supported, but any > > 3rd party programmer cable can be implemented easily and can be used > > from Impact. This open-source implementation can be used as a > > Programmer Cable SDK for Impact. > > > I've tested only Impact 8.2, if anybody has any problem with 7.1, > > please let me know! > > > Impact and Xilinx CableServer communication are very pooly written. > > There is no error recovery at all. If server stops, Impact GUI will > > crash. To avoid this you must disconnect server from GUI using > > Output/Cavble disconnect menu. > > > http://sourceforge.net/projects/xilprg > > http://sourceforge.net/project/showfiles.php?\ > group_id=175344&package_id=203209 > I am trying to run cblsrv on Linux (Suse10.0) with a dlc5 clone (selfmade). > Impact with windrvr recognizes the chain. > cblsrv -d3 -cdlc5:/dev/parport0 -p 2000 doesn't find the chain. > Obviosly PARPORT_DIRECT needs to get undefined with PARPORT_PPDEV > --- cblsrv-0.1/src/parport.h~ 2006-09-06 07:36:08.000000000 +0200 > +++ cblsrv-0.1/src/parport.h 2006-09-06 10:35:16.000000000 +0200 > @@ -50,6 +50,7 @@ > > // Define this if you want to support parport access by /dev/parportX > #if !defined(WIN32) && !defined(__CYGWIN__) > +#undef PARPORT_DIRECT > #define PARPORT_PPDEV > #endif > > Running as root with direct io works. > > After the patch, running with PARPORT_PPDEV and reading the ID results in a > crash of cblsrc: > > Program received signal SIGSEGV, Segmentation fault. > 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > 306 tdi_byte = *pw++; > (gdb) p pw > $1 = (u8 *) 0x8070000 <Address 0x8070000 out of bounds> > (gdb) bt > #0 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > #1 0x0804aedb in cable::write (this=0x804f008, mode=64, wbuff=@0xbf8fea68, > cmp_rbuff=@0xbf8fea50) at cable.cpp:345 > #2 0x080499db in do_cmd_write () at cblsrv.cpp:258 > #3 0x08049f26 in do_msg_commands () at cblsrv.cpp:447 > #4 0x0804a35a in client_connection () at cblsrv.cpp:584 > #5 0x0804a53a in main (argc=5, argv=0xbf8feb84) at cblsrv.cpp:800 > > num-bit seems a little off. > > Any ideas? Otherwise I'll try to debug in the next days. > > B.t.w.: Do you have some smaller test client. Starting impact and clicking a > zillion time to get to some point in the jtag handling is tedious... > > > -- > Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de > > Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt > --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>>Running as root with direct io works.
ok, you tried it :) I guess you have a little-endian environment (because directio works). The current version is definetely not big-endian friendly. Uwe Bonnes wrote:
> zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote: > > Hi All, > > > Here is a open-source CableServer replacement for Xilinx Impact. > > Currently Parallel III and Altera ByteBlaster are supported, but any > > 3rd party programmer cable can be implemented easily and can be used > > from Impact. This open-source implementation can be used as a > > Programmer Cable SDK for Impact. > > > I've tested only Impact 8.2, if anybody has any problem with 7.1, > > please let me know! > > > Impact and Xilinx CableServer communication are very pooly written. > > There is no error recovery at all. If server stops, Impact GUI will > > crash. To avoid this you must disconnect server from GUI using > > Output/Cavble disconnect menu. > > > http://sourceforge.net/projects/xilprg > > http://sourceforge.net/project/showfiles.php?\ > group_id=175344&package_id=203209 > I am trying to run cblsrv on Linux (Suse10.0) with a dlc5 clone (selfmade). > Impact with windrvr recognizes the chain. > cblsrv -d3 -cdlc5:/dev/parport0 -p 2000 doesn't find the chain. > Obviosly PARPORT_DIRECT needs to get undefined with PARPORT_PPDEV > --- cblsrv-0.1/src/parport.h~ 2006-09-06 07:36:08.000000000 +0200 > +++ cblsrv-0.1/src/parport.h 2006-09-06 10:35:16.000000000 +0200 > @@ -50,6 +50,7 @@ > > // Define this if you want to support parport access by /dev/parportX > #if !defined(WIN32) && !defined(__CYGWIN__) > +#undef PARPORT_DIRECT > #define PARPORT_PPDEV > #endif > > Running as root with direct io works. > > After the patch, running with PARPORT_PPDEV and reading the ID results in a > crash of cblsrc: > > Program received signal SIGSEGV, Segmentation fault. > 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > 306 tdi_byte = *pw++; > (gdb) p pw > $1 = (u8 *) 0x8070000 <Address 0x8070000 out of bounds> > (gdb) bt > #0 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > #1 0x0804aedb in cable::write (this=0x804f008, mode=64, wbuff=@0xbf8fea68, > cmp_rbuff=@0xbf8fea50) at cable.cpp:345 > #2 0x080499db in do_cmd_write () at cblsrv.cpp:258 > #3 0x08049f26 in do_msg_commands () at cblsrv.cpp:447 > #4 0x0804a35a in client_connection () at cblsrv.cpp:584 > #5 0x0804a53a in main (argc=5, argv=0xbf8feb84) at cblsrv.cpp:800 > > num-bit seems a little off. > > Any ideas? Otherwise I'll try to debug in the next days. > > B.t.w.: Do you have some smaller test client. Starting impact and clicking a > zillion time to get to some point in the jtag handling is tedious... > > > -- > Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de > > Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt > --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
I think I found the problem.

in parport::get_status:

-return ioctl(fd, PPRSTATUS);
+{
+        u8 data = 0;
+        ioctl(fd, PPRSTATUS, &data);
+        return data;
+}

Let me know if it helps!

Zoltan

Uwe Bonnes wrote:
> zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote: > > Hi All, > > > Here is a open-source CableServer replacement for Xilinx Impact. > > Currently Parallel III and Altera ByteBlaster are supported, but any > > 3rd party programmer cable can be implemented easily and can be used > > from Impact. This open-source implementation can be used as a > > Programmer Cable SDK for Impact. > > > I've tested only Impact 8.2, if anybody has any problem with 7.1, > > please let me know! > > > Impact and Xilinx CableServer communication are very pooly written. > > There is no error recovery at all. If server stops, Impact GUI will > > crash. To avoid this you must disconnect server from GUI using > > Output/Cavble disconnect menu. > > > http://sourceforge.net/projects/xilprg > > http://sourceforge.net/project/showfiles.php?\ > group_id=175344&package_id=203209 > I am trying to run cblsrv on Linux (Suse10.0) with a dlc5 clone (selfmade). > Impact with windrvr recognizes the chain. > cblsrv -d3 -cdlc5:/dev/parport0 -p 2000 doesn't find the chain. > Obviosly PARPORT_DIRECT needs to get undefined with PARPORT_PPDEV > --- cblsrv-0.1/src/parport.h~ 2006-09-06 07:36:08.000000000 +0200 > +++ cblsrv-0.1/src/parport.h 2006-09-06 10:35:16.000000000 +0200 > @@ -50,6 +50,7 @@ > > // Define this if you want to support parport access by /dev/parportX > #if !defined(WIN32) && !defined(__CYGWIN__) > +#undef PARPORT_DIRECT > #define PARPORT_PPDEV > #endif > > Running as root with direct io works. > > After the patch, running with PARPORT_PPDEV and reading the ID results in a > crash of cblsrc: > > Program received signal SIGSEGV, Segmentation fault. > 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > 306 tdi_byte = *pw++; > (gdb) p pw > $1 = (u8 *) 0x8070000 <Address 0x8070000 out of bounds> > (gdb) bt > #0 0x0804b478 in parport::shift (this=0x804f008, num_bits=-806384672, > wbuff=0x804f178, rbuff=0x804f168, last=0) at parport.cpp:306 > #1 0x0804aedb in cable::write (this=0x804f008, mode=64, wbuff=@0xbf8fea68, > cmp_rbuff=@0xbf8fea50) at cable.cpp:345 > #2 0x080499db in do_cmd_write () at cblsrv.cpp:258 > #3 0x08049f26 in do_msg_commands () at cblsrv.cpp:447 > #4 0x0804a35a in client_connection () at cblsrv.cpp:584 > #5 0x0804a53a in main (argc=5, argv=0xbf8feb84) at cblsrv.cpp:800 > > num-bit seems a little off. > > Any ideas? Otherwise I'll try to debug in the next days. > > B.t.w.: Do you have some smaller test client. Starting impact and clicking a > zillion time to get to some point in the jtag handling is tedious... > > > -- > Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de > > Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt > --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote:
> On Linux the only test I did was using VmWare with direct I/O access > (actually ppdev didn't work for me, it said PPEXCL failed).
Well, you probably don't need PPEXCL. The man page says: "Most device drivers don't need exclusive access to the port. It's only provided in case it is really needed, for example for devices where access to the port is required for extensive periods of time (many seconds)." And testing for failure for an ioctl is better done like ioctl(...) !=0
> Did you try to use with DIRECT_IO?
Running cblsrv as root (and having windrvr6 still loaded) worked. However after unloading the windrvr6 module, I couldn't get things to work.
> There is a cablehost directory under src. You can patch that to connect > to server and send some messages. I've used it to connet tit to the > Xilinx CableServer and figure out what the different write modes meant
cablehost is for win32...
> PS: > This weeken I'll try to more Linux testing.
Fine -- Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Uwe,

Did you have a chance to try my patch?

> Well, you probably don't need PPEXCL. The man page says:
I had the impression if you write CONTROL you need it. DLC5 doesn't writes CONTROL, but Altera ByteBlaster does. In my vmware environment I removed PPEXCL and it works for me (of course with the patch)
> ioctl(...) !=0
I've already fixed them. Next week probably I'll finish the Digilent USB JTAG cable support in cblsrv, and will make a new release with the patches. Zoltan Uwe Bonnes wrote:
> zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote: > > On Linux the only test I did was using VmWare with direct I/O access > > (actually ppdev didn't work for me, it said PPEXCL failed). > > Well, you probably don't need PPEXCL. The man page says: > > "Most device drivers don't need exclusive access to the port. It's only > provided in case it is really needed, for example for devices where access > to the port is required for extensive periods of time (many seconds)." > > And testing for failure for an ioctl is better done like > ioctl(...) !=0 > > > Did you try to use with DIRECT_IO? > > Running cblsrv as root (and having windrvr6 still loaded) worked. However > after unloading the windrvr6 module, I couldn't get things to work. > > > There is a cablehost directory under src. You can patch that to connect > > to server and send some messages. I've used it to connet tit to the > > Xilinx CableServer and figure out what the different write modes meant > > cablehost is for win32... > > > PS: > > This weeken I'll try to more Linux testing. > > Fine > -- > Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de > > Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt > --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote:
> Uwe,
> Did you have a chance to try my patch?
The patches seem right, but the whole thing doesn't work when the windrvr6 module is unloaded. Bye -- Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
I've tested Impact without windriver and was working. Unfortunately I
have no access to Impact running on Linux :(

Zoltan

Uwe Bonnes wrote:
> zcsizmadia@gmail.com <zcsizmadia@gmail.com> wrote: > > Uwe, > > > Did you have a chance to try my patch? > > The patches seem right, but the whole thing doesn't work when the windrvr6 > module is unloaded. > > Bye > -- > Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de > > Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt > --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------