kv260_custom_platform/device-tree-xlnx/vadd_xrt.dtbo
kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/package.build/package/vadd_xrt.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/vadd_xrt
kv260_custom_platform/kv260_custom_pkg/vadd_xrt_system/Hardware/binary_container_1.xclbin
xclOpen
open xclbin: No such file or directory
だった。error: invalid conversion from 'int' to 'xclVerbosityLevel'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: src/vadd_xrt.o: in function `main':
/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:64: undefined reference to `xclOpen'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:91: undefined reference to `xclLoadXclBin'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:105: undefined reference to `xclOpenContext'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:113: undefined reference to `xclAllocBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:119: undefined reference to `xclAllocBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:125: undefined reference to `xclAllocBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:132: undefined reference to `xclGetBOProperties'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:139: undefined reference to `xclGetBOProperties'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:146: undefined reference to `xclGetBOProperties'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:153: undefined reference to `xclMapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:159: undefined reference to `xclMapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:165: undefined reference to `xclMapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:180: undefined reference to `xclSyncBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:185: undefined reference to `xclSyncBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:193: undefined reference to `xclAllocBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:200: undefined reference to `xclMapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:221: undefined reference to `xclExecBuf'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:227: undefined reference to `xclExecWait'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:240: undefined reference to `xclSyncBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:257: undefined reference to `xclUnmapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:260: undefined reference to `xclUnmapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:263: undefined reference to `xclUnmapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:266: undefined reference to `xclUnmapBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:269: undefined reference to `xclFreeBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:272: undefined reference to `xclFreeBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:275: undefined reference to `xclFreeBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:278: undefined reference to `xclFreeBO'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:282: undefined reference to `xclCloseContext'
/media/masaaki/Ubuntu_Disk/tools/Xilinx/Vitis/2021.1/gnu/aarch64/lin/aarch64-linux/x86_64-petalinux-linux/usr/bin/aarch64-xilinx-linux/aarch64-xilinx-linux-ld.real: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_xrt/Hardware/../src/vadd_xrt.c:286: undefined reference to `xclClose'
makefile:55: recipe for target 'vadd_xrt' failed
collect2.real: error: ld returned 1 exit status
make: *** [vadd_xrt] Error 1
05:13:05 Build Finished (took 1s.121ms)
../src/vadd_xrt.c:64:32: error: invalid conversion from 'int' to 'xclVerbosityLevel' [-fpermissive]
これ試してみたい。”Vitis HLS で新しいパフォーマンス プラグマ (set_performance_directive) を使用して、よりスマートな構築が可能”
だそうです。 set_directive_performance参照When set_performance_directive is specified, the tool automatically applies pragmas or directives such as PIPELINE, UNROLL, or ARRAY_PARTITION to achieve the target_ti.
void krnl_vadd(const unsigned int *in1, // Read-Only Vector 1
const unsigned int *in2, // Read-Only Vector 2
unsigned int *out_r, // Output Result
int size // Size in integer
) {
<?xml version="1.0" encoding="UTF-8"?>
<project name="binary_container_1">
<platform vendor="xilinx" boardid="kv260" name="kv260_custom_platform" featureRomTime="0">
<version major="0" minor="0"/>
<description/>
<board name="xilinx.com:kv260:1.1" vendor="xilinx.com" fpga="XCK26-SFVC784-2LV-C">
<interfaces/>
<images>
<image name="vsom_kit.jpg" type="HDPI"/>
<image name="" type="MDPI"/>
<image name="" type="LDPI"/>
</images>
<id>
<vendor/>
<device/>
<subsystem/>
</id>
</board>
<build_flow/>
<host architecture="unknown"/>
<device name="fpga0" fpgaDevice="zynquplus:xck26:sfvc784:-2LV:c" addrWidth="0">
<core name="OCL_REGION_0" target="bitstream" type="clc_region" clockFreq="0MHz" numComputeUnits="60">
<kernelClocks>
<clock port="KERNEL_CLK" frequency="199.998000MHz"/>
<clock port="DATA_CLK" frequency="99.999000MHz"/>
</kernelClocks>
<kernel name="krnl_vadd" language="c" vlnv="xilinx.com:hls:krnl_vadd:1.0" preferredWorkGroupSizeMultiple="0" workGroupSize="1" debug="false" interrupt="true" hwControlProtocol="ap_ctrl_chain">
<module name="krnl_vadd">
<module name="krnl_vadd_Pipeline_read1" instName="grp_krnl_vadd_Pipeline_read1_fu_155" type="NonDataflowHS">
<rtlPort name="m_axi_gmem_AWVALID" object="gmem" protocol="m_axi"/>
<rtlPort name="sext_ln83" object="sext_ln83" protocol="ap_none"/>
<rtlPort name="trunc_ln83_1" object="trunc_ln83_1" protocol="ap_none"/>
<rtlPort name="v1_buffer_d0" object="v1_buffer" protocol="ap_memory"/>
</module>
<module name="krnl_vadd_Pipeline_vadd_writeC" instName="grp_krnl_vadd_Pipeline_vadd_writeC_fu_164" type="NonDataflowHS">
<rtlPort name="m_axi_gmem_AWVALID" object="gmem" protocol="m_axi"/>
<rtlPort name="sext_ln90_1" object="sext_ln90_1" protocol="ap_none"/>
<rtlPort name="sext_ln90" object="sext_ln90" protocol="ap_none"/>
<rtlPort name="trunc_ln83_1" object="trunc_ln83_1" protocol="ap_none"/>
<rtlPort name="v1_buffer_q0" object="v1_buffer" protocol="ap_memory"/>
</module>
</module>
<port name="M_AXI_GMEM" mode="master" range="0xFFFFFFFF" dataWidth="32" portType="addressable" base="0x0"/>
<port name="S_AXI_CONTROL" mode="slave" range="0x1000" dataWidth="32" portType="addressable" base="0x0"/>
<arg name="in1" addressQualifier="1" id="0" port="M_AXI_GMEM" size="0x8" offset="0x10" hostOffset="0x0" hostSize="0x8" type="void*"/>
<arg name="in2" addressQualifier="1" id="1" port="M_AXI_GMEM" size="0x8" offset="0x1C" hostOffset="0x0" hostSize="0x8" type="void*"/>
<arg name="out_r" addressQualifier="1" id="2" port="M_AXI_GMEM" size="0x8" offset="0x28" hostOffset="0x0" hostSize="0x8" type="void*"/>
<arg name="size" addressQualifier="0" id="3" port="S_AXI_CONTROL" size="0x4" offset="0x34" hostOffset="0x0" hostSize="0x4" type="unsigned int"/>
<compileWorkGroupSize x="1" y="1" z="1"/>
<maxWorkGroupSize x="1" y="1" z="1"/>
<string_table/>
<instance name="krnl_vadd_1">
<addrRemap base="0x0080010000" range="0x10000" port="S_AXI_CONTROL"/>
</instance>
<FIFOInformation/>
</kernel>
<connection srcType="core" srcInst="OCL_REGION_0" srcPort="ps8_0_axi_periph_M01_AXI" dstType="kernel" dstInst="krnl_vadd_1" dstPort="S_AXI_CONTROL"/>
<connection srcType="core" srcInst="OCL_REGION_0" srcPort="zynq_ultra_ps_e_0_S_AXI_HP0_FPD" dstType="kernel" dstInst="krnl_vadd_1" dstPort="M_AXI_GMEM"/>
</core>
</device>
</platform>
</project>
(base) masaaki@masaaki-H110M4-M01:/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/vadd_system/Hardware$ xclbinutil --info -i binary_container_1.xclbin
XRT Build Version: 2.6.655 (2020.1)
Build Date: 2020-05-22 12:05:03
Hash ID: 2d6bfe4ce91051d4e5b499d38fc493586dd4859a
------------------------------------------------------------------------------
Warning: The option '--output' has not been specified. All operations will
be done in memory with the exception of the '--dump-section' command.
------------------------------------------------------------------------------
Reading xclbin file into memory. File: binary_container_1.xclbin
==============================================================================
XRT Build Version: 2.6.655 (2020.1)
Build Date: 2020-05-22 12:05:03
Hash ID: 2d6bfe4ce91051d4e5b499d38fc493586dd4859a
==============================================================================
xclbin Information
------------------
Generated by: v++ (2021.1) on 2021-06-09-14:19:56
Version: 2.6.655
Kernels: krnl_vadd
Signature:
Content: Bitstream
UUID (xclbin): 2203f5a9-f92a-40ae-8eca-9f3bf7c1e011
Sections: BITSTREAM, MEM_TOPOLOGY, IP_LAYOUT, CONNECTIVITY,
BUILD_METADATA, EMBEDDED_METADATA, SYSTEM_METADATA
==============================================================================
Hardware Platform (Shell) Information
-------------------------------------
Vendor: xilinx
Board: kv260
Name: kv260_custom_platform
Version: 0.0
Generated Version: Vivado 2021.1 (SW Build: 3247384)
Created: Wed Apr 13 04:03:17 2022
FPGA Device: XCK26
Board Vendor: xilinx.com
Board Name: xilinx.com:kv260:1.1
Board Part: xilinx.com:kv260:part0:1.1
Platform VBNV: xilinx_kv260_kv260_custom_platform_0_0
Static UUID: 00000000-0000-0000-0000-000000000000
Feature ROM TimeStamp: 0
Clocks
------
No clock frequency data available.
Memory Configuration
--------------------
Name: HPC0
Index: 0
Type: MEM_DRAM
Base Address: 0x0
Address Size: 0x0
Bank Used: No
Name: HPC1
Index: 1
Type: MEM_DRAM
Base Address: 0x0
Address Size: 0x0
Bank Used: No
Name: HP0
Index: 2
Type: MEM_DRAM
Base Address: 0x0
Address Size: 0x80000000
Bank Used: Yes
Name: HP1
Index: 3
Type: MEM_DRAM
Base Address: 0x0
Address Size: 0x0
Bank Used: No
Name: HP2
Index: 4
Type: MEM_DRAM
Base Address: 0x0
Address Size: 0x0
Bank Used: No
Name: HP3
Index: 5
Type: MEM_DRAM
Base Address: 0x0
Address Size: 0x0
Bank Used: No
==============================================================================
Kernel: krnl_vadd
Definition
----------
Signature: krnl_vadd (void* in1, void* in2, void* out_r, unsigned int size)
Ports
-----
Port: M_AXI_GMEM
Mode: master
Range (bytes): 0xFFFFFFFF
Data Width: 32 bits
Port Type: addressable
Port: S_AXI_CONTROL
Mode: slave
Range (bytes): 0x1000
Data Width: 32 bits
Port Type: addressable
--------------------------
Instance: krnl_vadd_1
Base Address: 0x80010000
Argument: in1
Register Offset: 0x10
Port: M_AXI_GMEM
Memory: HP0 (MEM_DRAM)
Argument: in2
Register Offset: 0x1C
Port: M_AXI_GMEM
Memory: HP0 (MEM_DRAM)
Argument: out_r
Register Offset: 0x28
Port: M_AXI_GMEM
Memory: HP0 (MEM_DRAM)
Argument: size
Register Offset: 0x34
Port: S_AXI_CONTROL
Memory: <not applicable>
==============================================================================
Generated By
------------
Command: v++
Version: 2021.1 - 2021-06-09-14:19:56 (SW BUILD: 3246112)
Command Line: v++ --advanced.misc solution_name=link --advanced.param compiler.addOutputTypes=sd_card --config binary_container_1-link.cfg --connectivity.nk krnl_vadd:1:krnl_vadd_1 --input_files ../../vadd_kernels/Hardware/build/krnl_vadd.xo --link --log_dir binary_container_1.build/logs --messageDb binary_container_1.mdb --optimize 0 --output binary_container_1.xclbin --platform /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/kv260_custom/export/kv260_custom/kv260_custom.xpfm --remote_ip_cache /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/ip_cache --report_dir binary_container_1.build/reports --report_level 0 --save-temps --target hw --temp_dir binary_container_1.build
Options: --advanced.misc solution_name=link
--advanced.param compiler.addOutputTypes=sd_card
--config binary_container_1-link.cfg
--connectivity.nk krnl_vadd:1:krnl_vadd_1
--input_files ../../vadd_kernels/Hardware/build/krnl_vadd.xo
--link
--log_dir binary_container_1.build/logs
--messageDb binary_container_1.mdb
--optimize 0
--output binary_container_1.xclbin
--platform /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/kv260_custom/export/kv260_custom/kv260_custom.xpfm
--remote_ip_cache /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_pkg/ip_cache
--report_dir binary_container_1.build/reports
--report_level 0
--save-temps
--target hw
--temp_dir binary_container_1.build
==============================================================================
User Added Key Value Pairs
--------------------------
<empty>
==============================================================================
Leaving xclbinutil.
kv260_custom_platform/kv260_custom_pkg/sysroots/cortexa72-cortexa53-xilinx-linux/usr/src/debug/xrt/202110.2.11.0-r0/git/src/runtime_src/core/include/xclbin.h
kv260_custom_platform/device-tree-xlnx/square.dtbo
kv260_custom_platform/kv260_custom_pkg/square_system/Hardware/package.build/package/square.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/square/Hardware/square
kv260_custom_platform/kv260_custom_pkg/square_system/Hardware/binary_container_1.xclbin
// square.cpp
// 2019/12/11 by marsee
//
// Vitis_Accel_Examples/cpp_kernels/dataflow_stream/src/adder.cpp を参考にしています
// https://github.com/Xilinx/Vitis_Accel_Examples/blob/master/cpp_kernels/dataflow_stream/src/adder.cpp
// 2022/04/22 : square関数のINTERFACE指示子を削除した
#include <hls_stream.h>
static void read_dma(int *inm, hls::stream<int> &outs, int size){
LOOP_RDMA: for(int i=0; i<size; i++){
#pragma HLS PIPELINE II=1
#pragma HLS LOOP_TRIPCOUNT min=10 max=10
outs.write(inm[i]);
}
}
static void square_stream(hls::stream<int> &ins, hls::stream<int> &outs, int size){
LOOP_SQAURE_ST: for(int i=0; i<size; i++){
#pragma HLS PIPELINE II=1
#pragma HLS LOOP_TRIPCOUNT min=10 max=10
int tmp = ins.read();
outs.write(tmp * tmp);
}
}
static void write_dma(hls::stream<int> &ins, int *outm, int size){
LOOP_WDMA: for(int i=0; i<size; i++){
#pragma HLS PIPELINE II=1
#pragma HLS LOOP_TRIPCOUNT min=10 max=10
outm[i] = ins.read();
}
}
extern "C" {
void square(int *inm, int *outm, int size){
static hls::stream<int> ins;
static hls::stream<int> outs;
#pragma HLS STREAM variable = ins depth = 32
#pragma HLS STREAM variable = outs depth = 32
#pragma HLS dataflow
read_dma(inm, ins, size);
square_stream(ins, outs, size);
write_dma(outs, outm, size);
}
}
kv260_custom_platform/device-tree-xlnx/vadd.dtbo
kv260_custom_platform/kv260_custom_pkg/vadd_system/Hardware/package.build/package/vadd.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/vadd/Hardware/vadd
kv260_custom_platform/kv260_custom_pkg/vadd_system/Hardware/binary_container_1.xclbin
{
"shell_type" : "XRT_FLAT",
"num_slots": "1"
}
kv260_custom_platform/device-tree-xlnx/vadd.dtbo
kv260_custom_platform/kv260_custom_pkg/vadd_system/Hardware/package.build/package/vadd.bit.bin
kv260_custom_platform/kv260_custom_pkg/pfm/shell.json
kv260_custom_platform/kv260_custom_pkg/vadd/Hardware/vadd
kv260_custom_platform/kv260_custom_pkg/vadd_system/Hardware/binary_container_1.xclbin
zynqmp_fsbl.elf
pmufw.elf
bl31.elf
u-boot-dtb.elf (名前をu-boot.elfに変更する)
system.dtb
boot.scr (u-boot初期化用のスクリプト)
system.dtb (Linuxがシステム・セットアップを理解するために起動中に読み取るデバイス・ツリー・ブロブ)
(base) masaaki@masaaki-H110M4-M01:/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_plnx$ petalinux-build
[INFO] Sourcing buildtools
[INFO] Building project
[INFO] Sourcing build environment
[INFO] Generating workspace directory
INFO: bitbake petalinux-image-minimal
NOTE: Started PRServer with DBfile: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_plnx/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38761, PID: 13011
Loading cache: 100% | | ETA: --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:02:55
Parsing of 3478 .bb files complete (0 cached, 3478 parsed). 5113 targets, 269 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Fetching uninative binary shim file:///media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/kv260_custom_plnx/components/yocto/downloads/uninative/5ec5a9276046e7eceeac749a18b175667384e1f445cd4526300a41404d985a5b/x86_64-nativesdk-libc.tar.xz;sha256sum=5ec5a9276046e7eceeac749a18b175667384e1f445cd4526300a41404d985a5b (will check PREMIRRORS first)
Initialising tasks: 100% |#######################################| Time: 0:00:11
Checking sstate mirror object availability: 100% |###############| Time: 0:01:02
Sstate summary: Wanted 3436 Found 2863 Missed 573 Current 0 (83% match, 0% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 9672 tasks of which 7386 didn't need to be rerun and all succeeded.
INFO: Failed to copy built images to tftp dir: /tftpboot
[INFO] Successfully built project
(base) masaaki@masaaki-H110M4-M01:/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1$ petalinux-build
[INFO] Sourcing buildtools
[INFO] Building project
[INFO] Sourcing build environment
[INFO] Generating workspace directory
INFO: bitbake petalinux-image-minimal
NOTE: Started PRServer with DBfile: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 38273, PID: 26522
Loading cache: 100% | | ETA: --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:03:05
Parsing of 3478 .bb files complete (0 cached, 3478 parsed). 5113 targets, 273 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Fetching uninative binary shim file:///media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/components/yocto/downloads/uninative/5ec5a9276046e7eceeac749a18b175667384e1f445cd4526300a41404d985a5b/x86_64-nativesdk-libc.tar.xz;sha256sum=5ec5a9276046e7eceeac749a18b175667384e1f445cd4526300a41404d985a5b (will check PREMIRRORS first)
Initialising tasks: 100% |#######################################| Time: 0:00:11
Checking sstate mirror object availability: 100% |###############| Time: 0:01:31
Sstate summary: Wanted 3436 Found 2851 Missed 585 Current 0 (82% match, 0% complete)
NOTE: Executing Tasks
ERROR: fpga-manager-util-xilinx+gitAUTOINC+f2642103e9-r0 do_compile: Execution of '/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/tmp/work/zynqmp_generic-xilinx-linux/fpga-manager-util/xilinx+gitAUTOINC+f2642103e9-r0/temp/run.do_compile.7955' failed with exit code 1:
ls: cannot access '/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/tmp/work/zynqmp_generic-xilinx-linux/fpga-manager-util/xilinx+gitAUTOINC+f2642103e9-r0/recipe-sysroot/boot/bitstream/*.bit': No such file or directory
****** Xilinx Bootgen v2021.1
**** Build date : May 28 2021-21:36:22
** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.
[ERROR] : Unknown option on command line: *
WARNING: exit code 1 from a shell command.
ERROR: Logfile of failure stored in: /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/tmp/work/zynqmp_generic-xilinx-linux/fpga-manager-util/xilinx+gitAUTOINC+f2642103e9-r0/temp/log.do_compile.7955
Log data follows:
| DEBUG: Executing shell function do_compile
| ls: cannot access '/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/tmp/work/zynqmp_generic-xilinx-linux/fpga-manager-util/xilinx+gitAUTOINC+f2642103e9-r0/recipe-sysroot/boot/bitstream/*.bit': No such file or directory
|
|
| ****** Xilinx Bootgen v2021.1
| **** Build date : May 28 2021-21:36:22
| ** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.
|
| [ERROR] : Unknown option on command line: *
|
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/tmp/work/zynqmp_generic-xilinx-linux/fpga-manager-util/xilinx+gitAUTOINC+f2642103e9-r0/temp/run.do_compile.7955' failed with exit code 1:
| ls: cannot access '/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/tmp/work/zynqmp_generic-xilinx-linux/fpga-manager-util/xilinx+gitAUTOINC+f2642103e9-r0/recipe-sysroot/boot/bitstream/*.bit': No such file or directory
|
|
| ****** Xilinx Bootgen v2021.1
| **** Build date : May 28 2021-21:36:22
| ** Copyright 1986-2021 Xilinx, Inc. All Rights Reserved.
|
| [ERROR] : Unknown option on command line: *
|
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/components/yocto/layers/meta-xilinx-tools/recipes-bsp/fpga-manager-util/fpga-manager-util_1.0.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 8790 tasks of which 7234 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/components/yocto/layers/meta-xilinx-tools/recipes-bsp/fpga-manager-util/fpga-manager-util_1.0.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to build project. Check the /media/masaaki/Ubuntu_Disk/KRIA_KV260/2021.1/kv260_custom_platform/xilinx-k26-starterkit-2021.1/build/build.log file for more details...
v ++リンカはカーネル割り込み信号をこのフローティングintr信号にリンクするため、この警告は無視しても問題ありません。
ってもしかして、log4j のパッチしたからなのか?java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
するようにとのこと。(Vitis は eclipse ですよね。。。)eclipse.exe -clean
Display Options:
-help
Help -- display help message.
-debug -help
Help on Debug -- Displays help for
'Project less Debug in Vitis IDE support using prebuilt'.
-version
Display Version.
-wait
Wait for Vitis to complete.
Options:
-workspace <Workspace location>
Specify the Workspace directory for Vitis projects.
-debug <options>
launch vitis for debugging prebuilt binaries.
{-lp <repository_path>}
Add <repository_path> to the list of Driver/OS/Library search directories.
-eclipseargs <eclipse arguments>
Any other arguments that should be passed to Eclipse.
-vmargs <java vm arguments>
Any other arguments that should be passed to Java VM.
!SESSION 2022-04-07 04:07:17.365 -----------------------------------------------
eclipse.buildId=2021.1
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:18.413
!MESSAGE Bundle reference:file:com.xilinx.sdx.robot_1.0.0.202106100226.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:18.445
!MESSAGE Bundle reference:file:org.apache.log4j_1.2.15.v201012070815.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:18.487
!MESSAGE Bundle reference:file:org.eclipse.swtbot.generator_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:18.488
!MESSAGE Bundle reference:file:org.eclipse.swtbot.junit4_x_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:18.488
!MESSAGE Bundle reference:file:org.eclipse.swtbot.swt.finder_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:18.496
!MESSAGE Bundle reference:file:org.slf4j.impl.log4j12_1.7.2.v20131105-2200.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:07:25.803
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
at com.xilinx.sdk.utils.LogUtils.<clinit>(LogUtils.java:9)
at com.xilinx.sdk.utils.ToolAnalyticsHelper.<clinit>(ToolAnalyticsHelper.java:28)
at com.xilinx.ide.application.ui.Application.checkInstanceLocation(Application.java:221)
at com.xilinx.ide.application.ui.Application.start(Application.java:74)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager cannot be found by com.xilinx.sdk.utils_1.0.0.202106100226
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 17 more
!SESSION 2022-04-07 04:10:17.624 -----------------------------------------------
eclipse.buildId=2021.1
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:18.152
!MESSAGE Bundle reference:file:com.xilinx.sdx.robot_1.0.0.202106100226.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:18.158
!MESSAGE Bundle reference:file:org.apache.log4j_1.2.15.v201012070815.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:18.178
!MESSAGE Bundle reference:file:org.eclipse.swtbot.generator_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:18.178
!MESSAGE Bundle reference:file:org.eclipse.swtbot.junit4_x_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:18.178
!MESSAGE Bundle reference:file:org.eclipse.swtbot.swt.finder_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:18.185
!MESSAGE Bundle reference:file:org.slf4j.impl.log4j12_1.7.2.v20131105-2200.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:10:22.224
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
at com.xilinx.sdk.utils.LogUtils.<clinit>(LogUtils.java:9)
at com.xilinx.sdk.utils.ToolAnalyticsHelper.<clinit>(ToolAnalyticsHelper.java:28)
at com.xilinx.ide.application.ui.Application.checkInstanceLocation(Application.java:221)
at com.xilinx.ide.application.ui.Application.start(Application.java:74)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager cannot be found by com.xilinx.sdk.utils_1.0.0.202106100226
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 17 more
!SESSION 2022-04-07 04:18:28.262 -----------------------------------------------
eclipse.buildId=2021.1
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:18:28.698
!MESSAGE Bundle reference:file:com.xilinx.sdx.robot_1.0.0.202106100226.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:18:28.705
!MESSAGE Bundle reference:file:org.apache.log4j_1.2.15.v201012070815.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:18:28.728
!MESSAGE Bundle reference:file:org.eclipse.swtbot.generator_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:18:28.728
!MESSAGE Bundle reference:file:org.eclipse.swtbot.junit4_x_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:18:28.728
!MESSAGE Bundle reference:file:org.eclipse.swtbot.swt.finder_2.4.0.201604200752.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:18:28.744
!MESSAGE Bundle reference:file:org.slf4j.impl.log4j12_1.7.2.v20131105-2200.jar not found.
!ENTRY org.eclipse.osgi 4 0 2022-04-07 04:19:50.260
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
at com.xilinx.sdk.utils.LogUtils.<clinit>(LogUtils.java:9)
at com.xilinx.sdk.utils.ToolAnalyticsHelper.<clinit>(ToolAnalyticsHelper.java:28)
at com.xilinx.ide.application.ui.Application.checkInstanceLocation(Application.java:221)
at com.xilinx.ide.application.ui.Application.start(Application.java:74)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager cannot be found by com.xilinx.sdk.utils_1.0.0.202106100226
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 17 more
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from pynq import allocate, Overlay
img_filter = Overlay("./img_filt.bit")
dma = img_filter.axi_dma_0
median = img_filter.median_axis_RGB24_0
sobel = img_filter.sobel_axis_RGB24_0
image_path = "./test2.jpg"
original_image = Image.open(image_path)
canvas = plt.gcf()
size = canvas.get_size_inches()
canvas.set_size_inches(size*2)
width, height = original_image.size
print("Image size: {}x{} pixels.".format(width, height))
plt.figure(figsize=(12, 10));
_ = plt.imshow(original_image)
in_buffer = allocate(shape=(height, width, 3),
dtype=np.uint8, cacheable=1)
out_buffer = allocate(shape=(height, width, 3),
dtype=np.uint8, cacheable=1)
in_buffer[:] = np.array(original_image)
def run_kernel():
dma.sendchannel.transfer(in_buffer)
dma.recvchannel.transfer(out_buffer)
median.write(0x00,0x01) # start
sobel.write(0x00,0x01) # start
dma.sendchannel.wait()
dma.recvchannel.wait()
print(height)
print(width)
median.register_map.row_size = height
median.register_map.col_size = width
#median.register_map.function_r = 2 # ORG_IMGwAxiDma
median.register_map.function_r = 3 # MEDIANwAxiDma
sobel.register_map.row_size = height
sobel.register_map.col_size = width
#sobel.register_map.function_r = 2 # ORG_IMGwAxiDma
sobel.register_map.function_r = 3 # SOBELwAxiDma
run_kernel()
sobel_image = Image.fromarray(out_buffer)
print("Image size: {}x{} pixels.".format(width, height))
plt.figure(figsize=(12, 10));
_ = plt.imshow(sobel_image)
del in_buffer
del out_buffer
とmedian.register_map.function_r = 3 # MEDIANwAxiDma
でやってみた結果を示す。sobel.register_map.function_r = 3 # SOBELwAxiDma
とmedian.register_map.function_r = 2 # ORG_IMGwAxiDma
でやってみた結果を示す。sobel.register_map.function_r = 3 # SOBELwAxiDma
を定義した状態で C シミュレーションを行った。#define MEDIANwXilinxVideoStandard
とコメントアウトした状態で C シミュレーションを行ったところ、定義した状態と同じ結果を得た。//#define MEDIANwXilinxVideoStandard
// median_axis_RGB24.h
// 2022/04/02 by marsee
//
#ifndef __MEDIAN_AXIS_RGB24_H__
#define __MEDIAN_AXIS_RGB24_H__
#define ORG_IMGwAxiVdma 0
#define MEDIANwAxiVdma 1
#define ORG_IMGwAxiDma 2
#define MEDIANwAxiDma 3
#endif
// median_axis_RGB24.cpp
// 2022/04/02 by marsee
//
#include <stdint.h>
#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>
#include "median_axis_RGB24.h"
constexpr int size = 3;
void median_fil(ap_int<32> (&pix_mat)[size][size], ap_uint<24> &result);
ap_int<32> pixel_sort(ap_int<32> *y);
ap_int<32> separate_rgb(ap_int<32> rgb, ap_int<32> &r, ap_int<32> &b, ap_int<32> &g);
int median_axis_RGB24(hls::stream<ap_axiu<24,1,1,1> >& ins,
hls::stream<ap_axiu<24,1,1,1> >& outs, int32_t function,
int32_t row_size, int32_t col_size){
#pragma HLS INTERFACE mode=s_axilite port=col_size
#pragma HLS INTERFACE mode=s_axilite port=row_size
#pragma HLS INTERFACE mode=s_axilite port=function
#pragma HLS INTERFACE axis register_mode=both register port=outs
#pragma HLS INTERFACE axis register_mode=both register port=ins
#pragma HLS INTERFACE mode=s_axilite port=return
ap_axiu<24,1,1,1> pix;
ap_axiu<24,1,1,1> median;
ap_uint<24> val;
ap_int<32> line_buf[2][1920];
#pragma HLS array_partition variable=line_buf block factor=2 dim=1
ap_int<32> pix_mat[size][size];
#pragma HLS array_partition variable=pix_mat complete
LOOP_WAIT_USER : do { // user が 1になった時にフレームがスタートする
#pragma HLS LOOP_TRIPCOUNT min=1 max=1 avg=1
ins >> pix;
if(function==ORG_IMGwAxiDma || function==MEDIANwAxiDma)
break;
} while(pix.user == 0);
LOOP_Y: for(int y=0; y<row_size; y++){
#pragma HLS LOOP_TRIPCOUNT avg=600 max=1080 min=48
LOOP_X: for(int x=0; x<col_size; x++){
#pragma HLS LOOP_TRIPCOUNT avg=800 max=1920 min=64
#pragma HLS PIPELINE II=1
if (!(x==0 && y==0)) // 最初の入力はすでに入力されている
ins >> pix; // AXI4-Stream からの入力
LOOP_PIX_MAT_K: for(int k=0; k<3; k++){
LOOP_PIX_MAT_M: for(int m=0; m<2; m++){
pix_mat[k][m] = pix_mat[k][m+1];
}
}
pix_mat[0][2] = line_buf[0][x];
pix_mat[1][2] = line_buf[1][x];
ap_int<32> y_val = pix.data;
pix_mat[2][2] = y_val;
line_buf[0][x] = line_buf[1][x]; // 行の入れ替え
line_buf[1][x] = y_val;
median_fil(pix_mat, val);
median.data = val;
if(x<2 || y<2)
median.data = 0;
if(function==ORG_IMGwAxiVdma || function == MEDIANwAxiVdma){
if(x==0 && y==0) // 最初のピクセル
median.user = 1;
else
median.user = 0;
if(x == (col_size-1)) // 行の最後
median.last = 1;
else
median.last = 0;
}else{
median.user = 0;
median.last = pix.last;
}
median.keep = 0x7;
median.strb = 0x7;
if(function==MEDIANwAxiVdma || function==MEDIANwAxiDma)
outs << median;
else
outs << pix;
}
}
return(0);
}
// median filter
//
// x0y0 x1y0 x2y0
// x0y1 x1y1 x2y1
// x0y2 x1y2 x2y2
//
void median_fil(ap_int<32> (&pix_mat)[size][size], ap_uint<24> &result){
ap_int<32> pix_1d_r[9], pix_1d_b[9], pix_1d_g[9];
ap_int<32> y_r, y_b, y_g, y;
for(int i=0; i<9; i++){
separate_rgb(pix_mat[i/3][i%3], pix_1d_r[i], pix_1d_b[i], pix_1d_g[i]);
}
y_r = pixel_sort(pix_1d_r);
y_b = pixel_sort(pix_1d_b);
y_g = pixel_sort(pix_1d_g);
result = (y_r << 16) + (y_g << 8) + y_b;
}
// pixel_sort()
// bubble sort
// ”メジアン(中央値)、範囲(レンジ)、ヒストグラムを求める”参照
// https://cgengo.sakura.ne.jp/arg04.html
ap_int<32> pixel_sort(ap_int<32> *y){
#pragma HLS ARRAY_PARTITION variable=y dim=1 complete
ap_int<32> tmp;
for(int i=1; i<9; i++){
for(int j=0; j<9-i; j++){
if(y[j] < y[j+1]){
tmp = y[j];
y[j] = y[j+1];
y[j+1] = tmp;
}
}
}
return(y[4]);
}
// separate_rgb
// RGBを分離する
// RGBのフォーマットは、{R(8bits), B(8bits), G(8bits)}, 1pixel = 32bits
//
ap_int<32> separate_rgb(ap_int<32> rgb, ap_int<32> &r, ap_int<32> &b, ap_int<32> &g){
b = rgb & 0xff;
g = (rgb>>8) & 0xff;
r = (rgb>>16) & 0xff;
return(0);
}
// median_axis_RGB24_tb.cpp
// 2022/04/03 by marsee
// MEDIANwXilinxVideoStandard を define すると axi_vdma 用となり、コメントアウトすると axi_dma 用になる
//
#include <stdio.h>
#include <stdint.h>
#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>
#include "opencv2/opencv.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgcodecs/imgcodecs.hpp"
#include "median_axis_RGB24.h"
//#define MEDIANwXilinxVideoStandard
constexpr int size = 3;
int median_axis_RGB24(hls::stream<ap_axiu<24,1,1,1> >& ins,
hls::stream<ap_axiu<24,1,1,1> >& outs, int32_t function,
int32_t row_size, int32_t col_size);
int median_axis_RGB24_soft(hls::stream<ap_axiu<24,1,1,1> >& ins,
hls::stream<ap_axiu<24,1,1,1> >& outs, int32_t function,
int32_t row_size, int32_t col_size);
void median_fil_soft(ap_int<32> (&pix_mat)[size][size], ap_uint<24> &result);
ap_int<32> pixel_sort_soft(ap_int<32> *y);
ap_int<32> separate_rgb_soft(ap_int<32> rgb, ap_int<32> &r, ap_int<32> &b, ap_int<32> &g);
const char INPUT_JPG_FILE[] = "test2.jpg";
const char OUTPUT_JPG_FILE[] = "median.jpg";
const char ORG_OUT_JPG_FILE[] = "org.jpg";
int main(){
hls::stream<ap_axiu<24,1,1,1> > ins, ins2;
hls::stream<ap_axiu<24,1,1,1> > ins_soft;
hls::stream<ap_axiu<24,1,1,1> > outs, outs2;
hls::stream<ap_axiu<24,1,1,1> > outs_soft;
ap_axiu<24,1,1,1> pix;
ap_axiu<24,1,1,1> vals, vals_soft;
// JPG ファイルをMat に読み込む
cv::Mat img = cv::imread(INPUT_JPG_FILE);
// ピクセルを入れる領域の確保
std::vector<int32_t> rd_bmp(sizeof(int32_t)*img.cols*img.rows);
std::vector<int32_t> hw_median(sizeof(int32_t)*(img.cols)*(img.rows));
std::vector<int32_t> sw_median(sizeof(int32_t)*(img.cols)*(img.rows));
// rd_bmp にJPGのピクセルを代入
cv::Mat_<cv::Vec3b> dst_vec3b = cv::Mat_<cv::Vec3b>(img);
for (int y=0; y<img.rows; y++){
for (int x=0; x<img.cols; x++){
cv::Vec3b pixel;
pixel = dst_vec3b(y,x);
rd_bmp[y*img.cols+x] = (pixel[0] & 0xff) | ((pixel[1] & 0xff)<<8) | ((pixel[2] & 0xff)<<16); // RGB 8 bits
// blue - pixel[0]; green - pixel[1]; red - pixel[2];
}
}
#ifdef MEDIANwXilinxVideoStandard
// ins に入力データを用意する
for(int i=0; i<5; i++){ // dummy data
pix.user = 0;
pix.data = i;
pix.last = 0;
pix.user = 0;
pix.keep = 0x7;
pix.strb = 0x7;
ins << pix;
}
#endif
for(int j=0; j < img.rows; j++){
for(int i=0; i < img.cols; i++){
pix.data = (int32_t)rd_bmp[(j*img.cols)+i];
#ifdef MEDIANwXilinxVideoStandard
if (j==0 && i==0) // 最初のデータの時に TUSER を 1 にする
pix.user = 1;
else
pix.user = 0;
if (i == img.cols-1) // 行の最後でTLASTをアサートする
pix.last = 1;
else
pix.last = 0;
#else
if(j==img.rows-1 && i==img.cols-1)
pix.last = 1;
else
pix.last = 0;
pix.user = 0;
#endif
pix.keep = 0x7;
pix.strb = 0x7;
ins << pix;
ins2 << pix;
ins_soft << pix;
}
}
#ifdef MEDIANwXilinxVideoStandard
median_axis_RGB24(ins, outs, MEDIANwAxiVdma, img.rows, img.cols); // ハードウェアのメディアンフィルタ
median_axis_RGB24_soft(ins_soft, outs_soft, MEDIANwAxiVdma, img.rows, img.cols); // ソフトウェアのメディアンフィルタ
#else
median_axis_RGB24(ins, outs, MEDIANwAxiDma, img.rows, img.cols); // ハードウェアのメディアンフィルタ
median_axis_RGB24_soft(ins_soft, outs_soft, MEDIANwAxiDma, img.rows, img.cols); // ソフトウェアのメディアンフィルタ
#endif
// ハードウェアとソフトウェアのメディアンフィルタの値のチェック
for (int y=0; y<img.rows; y++){ // 結果の画像サイズはx-2, y-2
for (int x=0; x<img.cols; x++){
outs >> vals;
outs_soft >> vals_soft;
ap_uint<32> val = vals.data;
hw_median[y*img.cols+x] = (int32_t)val;
if (val != vals_soft.data){
printf("ERROR HW and SW results mismatch x = %ld, y = %ld, HW = %x, SW = %x\n",
x, y, val, vals_soft.data);
return(1);
}
}
}
printf("Success HW and SW results match\n");
const int median_row = img.rows;
const int median_cols = img.cols;
cv::Mat wbmpf(median_row, median_cols, CV_8UC3);
// wbmpf にmedian フィルタ処理後の画像を入力
cv::Mat_<cv::Vec3b> sob_vec3b = cv::Mat_<cv::Vec3b>(wbmpf);
for (int y=0; y<wbmpf.rows; y++){
for (int x=0; x<wbmpf.cols; x++){
cv::Vec3b pixel;
pixel = sob_vec3b(y,x);
int32_t rbg = hw_median[y*wbmpf.cols+x];
pixel[0] = ((rbg >> 8) & 0xff); // blue
pixel[1] = (rbg & 0xff); // green
pixel[2] = ((rbg >> 16) & 0xff); // red
sob_vec3b(y,x) = pixel;
}
}
// ハードウェアのメディアンフィルタの結果を jpg ファイルへ出力する
cv::imwrite(OUTPUT_JPG_FILE, wbmpf);
#ifdef MEDIANwXilinxVideoStandard
median_axis_RGB24(ins2, outs2, ORG_IMGwAxiVdma, img.rows, img.cols); // ハードウェアのメディアンフィルタ
#else
median_axis_RGB24(ins2, outs2, ORG_IMGwAxiDma, img.rows, img.cols); // ハードウェアのメディアンフィルタ
#endif
cv::Mat wbmpf2(median_row, median_cols, CV_8UC3);
// wbmpf2 に元画像を入力
sob_vec3b = cv::Mat_<cv::Vec3b>(wbmpf2);
for (int y=0; y<wbmpf.rows; y++){
for (int x=0; x<wbmpf.cols; x++){
cv::Vec3b pixel;
pixel = sob_vec3b(y,x);
outs2 >> vals;
int32_t val = vals.data;
pixel[0] = (val & 0xff); // blue
pixel[1] = ((val >> 8) & 0xff); // green
pixel[2] = ((val >> 16) & 0xff); // red
sob_vec3b(y,x) = pixel;
}
}
// 元画像を jpg ファイルへ出力する
cv::imwrite(ORG_OUT_JPG_FILE, wbmpf2);
return(0);
}
int median_axis_RGB24_soft(hls::stream<ap_axiu<24,1,1,1> >& ins,
hls::stream<ap_axiu<24,1,1,1> >& outs, int32_t function,
int32_t row_size, int32_t col_size){
ap_axiu<24,1,1,1> pix;
ap_axiu<24,1,1,1> median;
ap_uint<24> val;
ap_int<32> line_buf[2][1920];
ap_int<32> pix_mat[size][size];
LOOP_WAIT_USER : do { // user が 1になった時にフレームがスタートする
ins >> pix;
if(function==ORG_IMGwAxiDma || function==MEDIANwAxiDma)
break;
} while(pix.user == 0);
for(int y=0; y<row_size; y++){
for(int x=0; x<col_size; x++){
if (!(x==0 && y==0)) // 最初の入力はすでに入力されている
ins >> pix; // AXI4-Stream からの入力
LOOP_PIX_MAT_K: for(int k=0; k<3; k++){
LOOP_PIX_MAT_M: for(int m=0; m<2; m++){
pix_mat[k][m] = pix_mat[k][m+1];
}
}
pix_mat[0][2] = line_buf[0][x];
pix_mat[1][2] = line_buf[1][x];
ap_int<32> y_val = pix.data;
pix_mat[2][2] = y_val;
line_buf[0][x] = line_buf[1][x]; // 行の入れ替え
line_buf[1][x] = y_val;
median_fil_soft(pix_mat, val);
median.data = val;
if(x<2 || y<2)
median.data = 0;
if(function==ORG_IMGwAxiVdma || function == MEDIANwAxiVdma){
if(x==0 && y==0) // 最初のピクセル
median.user = 1;
else
median.user = 0;
if(x == (col_size-1)) // 行の最後
median.last = 1;
else
median.last = 0;
}else{
median.user = 0;
median.last = pix.last;
}
median.keep = 0x7;
median.strb = 0x7;
if(function==MEDIANwAxiVdma || function==MEDIANwAxiDma)
outs << median;
else
outs << pix;
}
}
return(0);
}
// median filter
//
// x0y0 x1y0 x2y0
// x0y1 x1y1 x2y1
// x0y2 x1y2 x2y2
//
void median_fil_soft(ap_int<32> (&pix_mat)[size][size], ap_uint<24> &result){
ap_int<32> pix_1d_r[9], pix_1d_b[9], pix_1d_g[9];
ap_int<32> y_r, y_b, y_g, y;
for(int i=0; i<9; i++){
separate_rgb_soft(pix_mat[i/3][i%3], pix_1d_r[i], pix_1d_b[i], pix_1d_g[i]);
}
y_r = pixel_sort_soft(pix_1d_r);
y_b = pixel_sort_soft(pix_1d_b);
y_g = pixel_sort_soft(pix_1d_g);
result = (y_r << 16) + (y_g << 8) + y_b;
}
// pixel_sort()
// bubble sort
// ”メジアン(中央値)、範囲(レンジ)、ヒストグラムを求める”参照
// https://cgengo.sakura.ne.jp/arg04.html
ap_int<32> pixel_sort_soft(ap_int<32> *y){
#pragma HLS ARRAY_PARTITION variable=y dim=1 complete
ap_int<32> tmp;
for(int i=1; i<9; i++){
for(int j=0; j<9-i; j++){
if(y[j] < y[j+1]){
tmp = y[j];
y[j] = y[j+1];
y[j+1] = tmp;
}
}
}
return(y[4]);
}
// separate_rgb
// RGBを分離する
// RGBのフォーマットは、{R(8bits), B(8bits), G(8bits)}, 1pixel = 32bits
//
ap_int<32> separate_rgb_soft(ap_int<32> rgb, ap_int<32> &r, ap_int<32> &b, ap_int<32> &g){
b = rgb & 0xff;
g = (rgb>>8) & 0xff;
r = (rgb>>16) & 0xff;
return(0);
}
-I/usr/local/include
-L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_imgproc
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
- | - | - | - | - | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |