How to send C language code to FPGA via FPGAlink

124 views
Skip to first unread message

7ss...@gmail.com

unread,
Aug 15, 2016, 3:26:03 AM8/15/16
to FPGALink Users
I am new to FPGAlink, I am having a C language code than can generate random byte, 
I am using the libfpgalink-201216 version and I have looked README file located in folder examples/c, and this line of code makes me so confused:

./lin.x64/rel/c -i 1443:0005 -v 1443:0005 -p -s \
    -x ../../hdl/apps/makestuff/swled/cksum/vhdl/csvf/fx2all-nexys2-1200.csvf \
    -f /var/tmp/foo.dat

I have checked the rel folder, there is no c file exist, so I am wondering how i send my c code to FPGA vis FPGAlink?

Chris McClelland

unread,
Aug 15, 2016, 3:39:17 AM8/15/16
to fpgalin...@googlegroups.com
> How to send C language code to FPGA via FPGAlink
>
I don't know, I have never tried running C code on an FPGA. FPGALink doesn't care about the source language though; if your HLS tool can generate .xsvf files then FPGALink can load them.

> this line of code makes me so confused
>
That's not a line of code, it's a command-line, to be entered at your shell-prompt.


> there is no c file exist
>
The executable is missing because you haven't built it (i.e using "make") yet.


> I am using the libfpgalink-201216 version
>
That release is very old. You should upgrade to a more recent version. Try one of the quickstarts listed on the home-page.

Chris


--
You received this message because you are subscribed to the "FPGALink Users" mailgroup (see https://github.com/makestuff/libfpgalink/wiki/FPGALink).
 
To post to this group, send email to fpgalink-users@googlegroups.com
To unsubscribe from this group, send email to
fpgalink-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

7ss...@gmail.com

unread,
Aug 24, 2016, 11:03:37 PM8/24/16
to FPGALink Users
Hi Chris,
Thank you very much for your reply,
I am trying to install the 20140524 verison that is provided in the quickstarts for atlys board.
I got an error :
[j@debian vhdl]$ ../../../../../../apps/flcli/lin.x64/rel/flcli -v 1d50:602b:0002 -i 1443:0007
Attempting to open connection to FPGALink device 1d50:602b:0002...
Loading firmware into 1443:0007...
Awaiting renumeration....
Attempting to open connection to FPGLink device 1d50:602b:0002 again...
flOpen(): usbOpenDevice(): LIBUSB_ERROR_ACCESS
after i ran line 25 
I have tried to  create the file "/etc/udev/rules.d/10-local.rules" with these two lines as root as you suggested in other post, but it still not working:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1443", ATTR{idProduct}=="0007", GROUP="users", MODE="0660"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="602b", GROUP="users", MODE="0660"



Chris McClelland於 2016年8月15日星期一 UTC+10下午5時39分17秒寫道:
> How to send C language code to FPGA via FPGAlink
>
I don't know, I have never tried running C code on an FPGA. FPGALink doesn't care about the source language though; if your HLS tool can generate .xsvf files then FPGALink can load them.

> this line of code makes me so confused
>
That's not a line of code, it's a command-line, to be entered at your shell-prompt.

> there is no c file exist
>
The executable is missing because you haven't built it (i.e using "make") yet.

> I am using the libfpgalink-201216 version
>
That release is very old. You should upgrade to a more recent version. Try one of the quickstarts listed on the home-page.

Chris
On Mon, Aug 15, 2016 at 2:31 AM, <7ss...@gmail.com> wrote:
I am new to FPGAlink, I am having a C language code than can generate random byte, 
I am using the libfpgalink-201216 version and I have looked README file located in folder examples/c, and this line of code makes me so confused:

./lin.x64/rel/c -i 1443:0005 -v 1443:0005 -p -s \
    -x ../../hdl/apps/makestuff/swled/cksum/vhdl/csvf/fx2all-nexys2-1200.csvf \
    -f /var/tmp/foo.dat

I have checked the rel folder, there is no c file exist, so I am wondering how i send my c code to FPGA vis FPGAlink?

--
You received this message because you are subscribed to the "FPGALink Users" mailgroup (see https://github.com/makestuff/libfpgalink/wiki/FPGALink).
 
To post to this group, send email to fpgalin...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-user...@googlegroups.com.

7ss...@gmail.com

unread,
Aug 25, 2016, 12:50:27 AM8/25/16
to FPGALink Users
Hi Chris, 
Sorry again, there is another question which is about the C example, in the README file that you provided for the C language example, you mentioned about that I need to install the MakeStuff build infrastructure from http://bit.ly.makestuff, however, this website is not exist anymore, so i am wondering where I can download the MakeStuff build infrastructure?
Thank you 

Chris McClelland於 2016年8月15日星期一 UTC+10下午5時39分17秒寫道:
> How to send C language code to FPGA via FPGAlink
>
I don't know, I have never tried running C code on an FPGA. FPGALink doesn't care about the source language though; if your HLS tool can generate .xsvf files then FPGALink can load them.

> this line of code makes me so confused
>
That's not a line of code, it's a command-line, to be entered at your shell-prompt.

> there is no c file exist
>
The executable is missing because you haven't built it (i.e using "make") yet.

> I am using the libfpgalink-201216 version
>
That release is very old. You should upgrade to a more recent version. Try one of the quickstarts listed on the home-page.

Chris
On Mon, Aug 15, 2016 at 2:31 AM, <7ss...@gmail.com> wrote:
I am new to FPGAlink, I am having a C language code than can generate random byte, 
I am using the libfpgalink-201216 version and I have looked README file located in folder examples/c, and this line of code makes me so confused:

./lin.x64/rel/c -i 1443:0005 -v 1443:0005 -p -s \
    -x ../../hdl/apps/makestuff/swled/cksum/vhdl/csvf/fx2all-nexys2-1200.csvf \
    -f /var/tmp/foo.dat

I have checked the rel folder, there is no c file exist, so I am wondering how i send my c code to FPGA vis FPGAlink?

--
You received this message because you are subscribed to the "FPGALink Users" mailgroup (see https://github.com/makestuff/libfpgalink/wiki/FPGALink).
 
To post to this group, send email to fpgalin...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-user...@googlegroups.com.

Chris McClelland

unread,
Aug 28, 2016, 8:47:34 AM8/28/16
to fpgalin...@googlegroups.com
You already have the build infrastructure installed; it's the thing that builds FPGALink itself when you type "make deps". So once you've done that, building the C example is a simple matter of going to the examples/c directory and running "make".

End-to-end, thus:

$ mkdir $HOME/20151220
$ cd $HOME/20151220
$ wget -qO- http://tiny.cc/msbil | tar zxf -
$ cd makestuff/libs
$ ../scripts/msget.sh makestuff/libfpgalink/20151220
  :
$ cd libfpgalink/
$ make deps
  :
$ cd examples/c
$ make
  :
$ lin.x64/rel/c -h
FPGALink "C" Example Copyright (C) 2011-2013 Chris McClelland

Usage: lin.x64/rel/c [-h] [-i <VID:PID>] -v <VID:PID> [-d <portConfig>]
          [-q <jtagPort>] [-p <progConfig>] [-f <dataFile>]

Load FX2LP firmware, load the FPGA, interact with the FPGA.

  -i <VID:PID>    initial vendor and product ID of the FPGALink device
  -v <VID:PID>    renumerated vendor and product ID of the FPGALink device
  -d <portConfig> configure the ports
  -q <jtagPort>   scan the JTAG chain
  -p <progConfig> configuration and programming file
  -f <dataFile>   binary data to write to channel 0
  -h              print this help and exit
$

On the LIBUSB_ERROR_ACCESS problem, this is a problem of system administration, not of FPGALink itself. Each Linux distribution handles this in a slightly different way, so the fix is necessarily platform-specific. The only obvious thing I can think to ask is whether you're actually a member of the "users" group that you refer to in your udev rules, and whether you've restarted the udev service itself? Failing that, you'll need to do some research to debug why your udev rule is not being run. I suggest a google search like "troubleshooting udev rules usb linux".

Chris


To post to this group, send email to fpgalink-users@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages