-
Get the de1soc_sharedonly hardware tamplate for terasic's BSP. Rename it to
de1soc_sharedonly_io
-
Modify the name to
de1soc_sharedonly_io
in board_spec.xml file -
File ->Open project in Quartus,browse to top.qpf file and ->open
-
Tools->Qsys, open the system.qsys file
-
Double click the “acl_iface [acl_iface_system.qsys]” in Hierarchy Table
-
Search the PIO in the IP catalog table, and double click the PIO component
-
Set the parameter of PIO.With,Direction,bit-operate,interrupt and Edge capture. For output only,
-
Rename
pio_0
toled_pio
, and connect theled_pio
topipe_stage_host_ctrl
. clk and reset are the same as pipe_stage_host_ctrl, led_pio'ss1
connect to pipe_stage_host_ctrl'sm0
.double click theDouble-click-to
of led_pio inExport
to export the external_connection Port. And set an valid address. Save without generating HDL -
Double click the
system [system.qsys]
in Hierarchy Table , Then doube click the led_pio's Export to export theacl_iface_led_pio_external_connection
andGenerate HDL
-
Get the port description in file
de1soc_sharedonly_io/system/system_inst.v
, and add it tothe_system
in top.v.acl_iface_led_pio_external_connection_export (<connected-to-acl_iface_led_pio_external_connection_export>)
-
Add
ledr
andhex0
output in top.v and connect to led_pio port. Remove thefpga_led_output
pins. -
Remove
fpga_led_output
and add theledr
andhex0
set_location in top.qsf -
set acl_iface_region form
LL_ENABLED OFF
toLL_ENABLED ON
in top.qsf
set_global_assignment -name LL_ENABLED ON -section_id acl_iface_region
- Git clone the linux-socfpga
git clone -b socfpga-opencl_3.18 --depth=10 https://github.com/thinkoco/linux-socfpga.git
cd linux-socfpga
-
Modify the device tree source file(
linux-socfpga/arch/arm/boot/dts/socfpga_cyclone5_de1soc_x2go.dts
),update socfpga.dtb
make socfpga_cyclone5_de1soc_x2go.dtb
- Build opencl kernel
aoc device/camera_sobel.cl -o bin/camera_sobel.aocx --board de1soc_sharedonly_io -v --report
- Generate hps_0.h
sopc-create-header-files ./system.sopcinfo --single hps_0.h --module acl_iface_hps
-
code in de1soc_sw_io, and build it on PC
-
aocl program and run host
aocl program /dev/acl0 cemera_sobel.aocx
./led_pio