Creating an FPGA accelerator in 15 minutes

A forum for documenting the Parallella and Epiphany . (Not Q&A!)

Creating an FPGA accelerator in 15 minutes

Postby aolofsson » Thu Jan 21, 2016 8:50 pm

I finally got around to creating an FPGA "sandbox" example for parallella.

Completely scripted. As long as you have Vivado installed, just edit the verilog code and build with one command. No dependency on Xilinx proprietary IP generator. No need to open the GUI.

https://www.parallella.org/2016/01/21/c ... 5-minutes/
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Creating an FPGA accelerator in 15 minutes

Postby theover » Mon Jan 25, 2016 11:02 pm

I've downloaded the git project, ran the supplied commands after correcting the first "cd" command, and after a minute or so, there were errors in the build. Also, I understand this project makes use of the constructs usually used for the Epiphany chip, but is there an example how to address the resulting accelerator from C/Linux, and if so, is that instead of the Epiphany or, in addition to ?

T.V.
theover
 
Posts: 174
Joined: Mon Dec 17, 2012 4:50 pm

Re: Creating an FPGA accelerator in 15 minutes

Postby aolofsson » Mon Jan 25, 2016 11:19 pm

-please report error here or file an issue?

-the software is linux. If youwant to runin user space with /dev/mem you will need to run as sudo.
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Creating an FPGA accelerator in 15 minutes

Postby Melkhior » Sun Aug 28, 2016 10:38 am

aolofsson wrote:-please report error here or file an issue?


Some missing files and vivado is outputing some errors :-(

I have Vivado 2015.2 Webpack with all the options (SDK is needed for bootgen; anything newer didn't work because of IP version issues ?)
If I:
1) go into "oh/src/parallella/fpga/parallella_base" and run ./build.sh;
2) go into "oh/src/parallella/fpga/headless_e16_z7010" and run ./build.sh.
I get a file "parallella_e16_headless_gpiose_7010.bit.bin" that works fine when cat'ed in /dev/xdevcfg or as a replacement /boot/parallella.bit.bin.
So I assume my setup is OK.

However for the accelerator...

1) there is no oh/src/accelerator/dv/build.sh or oh/src/accelerator/dv/run.sh;
2) there is no oh/src/accelerator/dv/tests/hello.emf but a test_basic.emf instead;
3) If I go into oh/src/accelerator/fpga and run ./build.sh, it finishes with:
Starting synth_design
Attempting to get a license for feature 'Synthesis' and/or device 'xc7z020'
INFO: [Common 17-349] Got license for feature 'Synthesis' and/or device 'xc7z020'
INFO: [Common 17-1223] The version limit for your license is '2015.11' and will expire in -272 days. A version limit expiration means that, although you may be able to continue to use the current version of tools or IP with this license, you will not be eligible for any updates or new releases.
ERROR: [Synth 8-2841] use of undefined macro CFG_ASIC [oh/src/accelerator/fpga/system.srcs/sources_1/ipshared/www.parallella.org/axi_accelerator_v1_0/e04ae5f4/src/oh_memory_dp.v:36]
ERROR: [Synth 8-2715] syntax error near ; [oh/src/accelerator/fpga/system.srcs/sources_1/ipshared/www.parallella.org/axi_accelerator_v1_0/e04ae5f4/src/oh_memory_dp.v:36]
ERROR: [Synth 8-1031] ASIC is not declared [oh/src/accelerator/fpga/system.srcs/sources_1/ipshared/www.parallella.org/axi_accelerator_v1_0/e04ae5f4/src/oh_memory_dp.v:39]
INFO: [Synth 8-2350] module oh_memory_dp ignored due to previous errors [oh/src/accelerator/fpga/system.srcs/sources_1/ipshared/www.parallella.org/axi_accelerator_v1_0/e04ae5f4/src/oh_memory_dp.v:8]
Failed to read verilog 'oh/src/accelerator/fpga/system.srcs/sources_1/ipshared/www.parallella.org/axi_accelerator_v1_0/e04ae5f4/src/oh_memory_dp.v'
INFO: [Common 17-83] Releasing license: Synthesis
7 Infos, 1 Warnings, 0 Critical Warnings and 4 Errors encountered.
synth_design failed
ERROR: [Common 17-69] Command failed: Synthesis failed - please see the console or run log file for details
INFO: [Common 17-206] Exiting Vivado at Sun Aug 28 12:06:58 2016...
[Sun Aug 28 12:06:59 2016] synth_1 finished
wait_on_run: Time (s): cpu = 00:00:00.10 ; elapsed = 00:00:12 . Memory (MB): peak = 1102.562 ; gain = 0.000 ; free physical = 10451 ; free virtual = 12417
## launch_runs impl_1
ERROR: [Common 17-70] Application Exception: Failed to launch run 'impl_1' due to failures in the following run(s):
synth_1
These failed run(s) need to be reset prior to launching 'impl_1' again.


while executing
"source ../../common/fpga/system_build.tcl"
(file "run.tcl" line 12)
INFO: [Common 17-206] Exiting Vivado at Sun Aug 28 12:06:59 2016...
[ERROR] : Bitstream parsing error !!! Unsupported BIT file
cp: cannot stat `system_wrapper.bit.bin': No such file or directory


So obviously no bistream. Also, it references a Zynq 7020 and I have a Zynq 7010 in my desktop parallella. I don't know how to fix either issue.

Also, if I get it to work, will this new bitstream support the Epiphany chip? That why I'm using this and not the Kirill project. I want to run the parallel bits of the algorithm(s) on the Epiphany and the sequential bits of the FPGA. With the help of the Yanidubin tutorials I manage to make it work a while ago, but that was with the ISE using an older version of the code.

Any help or suggestion appreciated.
Melkhior
 
Posts: 39
Joined: Sat Nov 08, 2014 12:19 pm

Re: Creating an FPGA accelerator in 15 minutes

Postby peteasa » Wed Aug 31, 2016 6:43 am

Hi @Melkhior,
Not run the sample but I have seen some of the issues.
undefined macro CFG_ASIC

When simulating CFG_ASIC is supplied on the command line see for example scripts/build.sh has -DCFG_ASIC=0
Code: Select all
iverilog -g2005\
 -DTARGET_SIM=1\
 -DCFG_ASIC=0\
 $DUT\
 $OH_HOME/symlinks/dv/dv_top.v\
 -y .\
 -y $OH_HOME/symlinks/hdl\
 -y $OH_HOME/symlinks/dv\
 -I $OH_HOME/symlinks/hdl\
 -o dut.bin\

When building the bit stream the same thing is done for vivado via tcl scripts see https://github.com/parallella/oh/pull/9 ... ddcfb01128. the key bit is to add the options in system_params.tcl (see https://github.com/parallella/oh/blob/m ... ms.tcl#L28) as an example, then the common/fpga/system_build.tcl script will pick that up with the command
Code: Select all
set_property -name {STEPS.SYNTH_DESIGN.ARGS.MORE OPTIONS} -value $oh_synthesis_options -objects [get_runs synth_1]

That will also fix the other two errors.. should be quite a simple fix for you.

And to redirect to a different zync chip have a look at https://github.com/parallella/oh/blob/m ... ams.tcl#L9. Just change that line and it should spring into life for you as a 7010 build.

Hope that helps

Peter.
User avatar
peteasa
 
Posts: 117
Joined: Fri Nov 21, 2014 7:04 pm

Re: Creating an FPGA accelerator in 15 minutes

Postby Melkhior » Wed Aug 31, 2016 12:47 pm

peteasa wrote:the key bit is to add the options in system_params.tcl


In this subdirectory it seems to be "run_params.tcl" instead ? (both exist in the subdirectory, but the "run.sh" script uses "run_params.tcl").

Hope that helps


Yes, thank you. I got the bitstream it seems, "parallella.bit.bin".
Unfortunately I won't be able to try the bitstream, as I've stupidly managed to fry my parallella :-(
(apparently, parallellas aren't water-proof...)

Cordially,
Melkhior
 
Posts: 39
Joined: Sat Nov 08, 2014 12:19 pm

Re: Creating an FPGA accelerator in 15 minutes

Postby cpantel » Thu Sep 06, 2018 1:07 am

Hello

I'm new, I had success with many of parallalla examples but now I'm stuck here, a little more than 15 minutes ;-)

I really really liked this computer, just had to say it. Let's continue...

First tried with 2015.2 up to the CFG_ASIC error on a just cloned source

Then used 2015.4 on a clean clone and got the CFG_ASIC as a warning, instructions for upgrading the version and finally another error:

....
CRITICAL WARNING: [HDL 9-870] Macro <CFG_ASIC> is not defined. [src/oh_memory_dp.v:36]
CRITICAL WARNING: [HDL 9-806] Syntax error near ";". [src/oh_memory_dp.v:36]
CRITICAL WARNING: [HDL 9-806] Syntax error near ";". [src/oh_dsync.v:18]
....
This script was generated using Vivado <2015.2> and is being run in <2015.4> of Vivado. Please run the script in Vivado <2015.2> then open the design in Vivado <2015.4>. Upgrade the design by running "Tools => Report => Report IP Status...", then run write_bd_tcl to create an updated script.
....
CRITICAL WARNING: [Project 1-486] Could not resolve non-primitive black box cell 'system' instantiated as 'system_i' [/github/oh_2015.2/src/accelerator/fpga/system.srcs/sources_1/bd/system/hdl/system_wrapper.v:16]
....
ERROR: [DRC 23-20] Rule violation (INBB-3) Black Box Instances - Cell 'system_i' of type 'system_i/system' has undefined contents and is considered a black box. The contents of this cell must be defined for opt_design to complete successfully.


I followed the instructions: run 2015.2, open with GUI, report ip status... write_bd_tcl, run 2015.4 and got the same errors.

Any hints?

Attached is the log of the last step:
first 2015.4 run -> no
2015.2 run -> no
GUI -> no
sed -i -e "s/2015.2/2015.4/" \
src/spi/fpga/system_bd.tcl \
src/parallella/fpga/headless_e16_z7010/system_bd.tcl \
src/parallella/fpga/headless_e16_z7020/system_bd.tcl \
src/parallella/fpga/sdr_fmcomms/system_bd.tcl \
src/gpio/fpga/system_bd.tcl \
src/accelerator/fpga/system_bd.tcl
second 2015.4 run -> YES
GUI
Attachments
log.txt
(53.39 KiB) Downloaded 27 times
cpantel
 
Posts: 2
Joined: Sat Sep 01, 2018 5:47 pm


Return to Quick Start Guides , Documentation, Examples (Start Here!)

Who is online

Users browsing this forum: No registered users and 0 guests