Code Monkey home page Code Monkey logo

xkisp's Introduction

Introduction

xkISP is an open source image signal processor (ISP) based on Xilinx development tools. xkISP is jointly developed by VIP Lab of Fudan university and DAMO CTL lab of Alibaba. Up to now, xkISP supports to process 12-bit raw image data of any resolution. The entire pipeline includes 17 function modules shown in the following: The official on-line forum of xkISP project is: http://openasic.org/

输入图片说明

File Structure

openISP
├─fpga
│      host.cpp
│      top.cpp
│      top.h
│      xcl2.cpp
│      xcl2.h
│
├─src
│    isp_top.h
│    file_define.h
│    "*module*".cpp
│    "*module*".h
│    ...
│
├─tb
│     tb_"*module*".cpp
│    ...
│
├─tcl
│      Makefile
│      "*module*".tcl
│      "*module*"_directives.tcl
│    ...
│
├─tv
│     Makefile
│     hls_param.txt
│     input.raw
│     isp
│     readme_for_tv
├─  LICENSE
├─  setup_env.sh
└─  README.md

fpga contains code files for top level integration verification. src contains source code files which are the single module of the xk-isp project and head files(file_define.h) for single module test. tb contains code files for verificating the function consistency with Cmodel(tv/isp) in the module level. tcl contains the scripts for execuating the code files in the tb("module".tcl) and adding the pragma command for the code files in the src ("module"_directives.tcl). Makefile in the tcl is used for module level verification. tv contains the files for generating the test vectors. You can read the readme_for_tv for more details. setup_env.sh is used to designate the development tools. (Vitis HLS or Vivado)

Usage

Clone this repo:

git clone xxx.git

cd xk-isp

Environment setup

Modify setup_env.sh to add the installed vivado or vitis hls path under the current system. Then complete the environment setup.

source setup_env.sh

Test vector generate

Before starting the project, we need use xk-isp Cmodel ispto generate test vectors. These is an test image input.rawand default configuration hls_param.txt in tv.

cd tv

./isp -i input.raw -c hls_param.txt

If you want to use your own image, please modify makefile

./isp -i "your test image" -c "your configuration"

Note:the configuration is fixed in each module level verification. You should modify the verification code files( tb_"*module*".cpp in tb) to match the configuration of Cmodel. We will modify the verification code files to read configuration file in the future update.

module level verification

For module level verification, you can use the script Makefile in the tcl. Of course, you can modify the Makefileas needed

cd tcl

make

Top level integration verification

For top level integration verification, you can use the vitis GUI. The example is shown as follows: 1.Create a new project using the vitis. Import top.h and top.cpp under kernels and host.cpp, top.h, xcl2.cpp, xcl2.hpp under host platform(x86).

输入图片说明

输入图片说明

2.Set top file Under the kernel directory, double-click .prj to enter its configuration interface, click 输入图片说明 and set the “isp_top” function as the top level.

输入图片说明

3.Set test images path and configuration parameters Enter the host.cpp

  • image path Modify the "TOP_SRC1" and "TOP_DST1" to your image paths.
  • image resolution "IMAGE_HEIGHT" and "IMAGE_WIDTH" determine the input image height and witdh. "upper_left_x", "upper_left_y" , "lower_right_x*" ,"lower_right_y" determine the pixel positions of the upper left and lower right corners of the cropped image. "CROP_HEIGHT" and "CROP_WIDTH" determine the output image height and width. They need to be matched with "upper_left_x", "upper_left_y" , "lower_right_x*" ,"lower_right_y"
  • module configuration You can find them in the host.cpp

4.Compile and run Click the settings 输入图片说明 in the Assistant window to select the target we compile ("emulation-SW", "emulation-HW", "HW")

输入图片说明

输入图片说明

Click build 输入图片说明 in the Assistant window to compile. Click run 输入图片说明 to execute the project.

xkisp's People

Contributors

fafa0810 avatar farmer88 avatar openasic-org avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xkisp's Issues

求解答

你好,请问在LSC算法里的rgian等的值是怎么计算出来的,并且gian值数量是1317这和将图像划分为1216的方块有关系吗?

make error

I'm using ubuntu22.04 with vivado_hls2021.1
when make in tcl some error catched like this:


/tools/Xilinx/Vitis_HLS/2021.1/include/mpfr.h:721:34: error: ‘mpfr_srcptr’ was not declared in this scope
 __MPFR_DECLSPEC mpfr_exp_t mpfr_custom_get_exp  _MPFR_PROTO ((mpfr_srcptr));
                                  ^~~~~~~~~~~
/tools/Xilinx/Vitis_HLS/2021.1/include/mpfr.h:725:28: error: ‘mpfr_srcptr’ was not declared in this scope
 __MPFR_DECLSPEC int    mpfr_custom_get_kind   _MPFR_PROTO ((mpfr_srcptr));
                            ^~~~~~~~~~~
In file included from /tools/Xilinx/Vitis_HLS/2021.1/include/hls_fpo.h:189:0,
                 from /tools/Xilinx/Vitis_HLS/2021.1/include/hls_half_fpo.h:64,
                 from /tools/Xilinx/Vitis_HLS/2021.1/include/hls_half.h:71,
                 from /tools/Xilinx/Vitis_HLS/2021.1/include/etc/ap_private.h:91,
                 from /tools/Xilinx/Vitis_HLS/2021.1/include/ap_common.h:653,
                 from /tools/Xilinx/Vitis_HLS/2021.1/include/ap_int.h:55,
                 from /home/yang/Documents/github/ISP/xkISP/tb/../src/top.h:19,
                 from /home/yang/Documents/github/ISP/xkISP/tb/../src/tpg.h:4,
                 from /home/yang/Documents/github/ISP/xkISP/tb/tb_tpg.cpp:1:
/tools/Xilinx/Vitis_HLS/2021.1/include/floating_point_v7_0_bitacc_cmodel.h:246:45: error: ‘mpfr_srcptr’ has not been declared
 __XIP_FPO_DLL xip_fpo_exc_t xip_fpo_set_fr      (xip_fpo_ptr, mpfr_srcptr);
                                             ^~~~~~~~~~~
/tools/Xilinx/Vitis_HLS/2021.1/include/floating_point_v7_0_bitacc_cmodel.h:247:53: error: ‘mpfr_srcptr’ has not been declared
 __XIP_FPO_DLL xip_fpo_exc_t xip_fpo_fix_set_fr  (xip_fpo_fix_ptr, mpfr_srcptr);
                                                     ^~~~~~~~~~~
make[1]: *** [cosim.tv.mk:62: obj/tb_tpg.cpp_pre.cpp.tb.o] Error 1
ERROR: [COSIM 212-317] C++ compile error.
ERROR: [COSIM 212-321] EXE file generate failed.
ERROR: [COSIM 212-321] EXE file generate failed.
ERROR: [COSIM 212-331] Aborting co-simulation: C simulation failed, compilation errors.
ERROR: [COSIM 212-5] *** C/RTL co-simulation file generation failed. ***
ERROR: [COSIM 212-4] *** C/RTL co-simulation finished: FAIL ***
INFO: [HLS 200-111] Finished Command cosim_design CPU user time: 5.72 seconds. CPU system time: 0.46 seconds. Elapsed time: 6.2 seconds; current allocated memory: 375.555 MB.
command 'ap_source' returned error code
    while executing
"source "./script.tcl""
    (file "tpg.tcl" line 10)
    invoked from within
"source tpg.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source $arg] "

INFO: [HLS 200-112] Total CPU user time: 16.81 seconds. Total CPU system time: 1.63 seconds. Total elapsed time: 17.61 seconds; peak allocated memory: 373.383 MB.
INFO: [Common 17-206] Exiting vitis_hls at Mon Jun 27 23:19:59 2022...
make: *** [Makefile:13:tpg] 错误 1

Xilink board implmentation verify

Hi, Sir;
May I get an FPGA board/Xilink from your support to verify the code in FPGA/Xlink Board?
Or I could upload your code into the Lattice FPGA board such as model No. is LIFCL-40-VIP-SI-PCBA.
Please give me your advice as soon as possible.
thanks

best regards
ben

【求解答】

/tv/isp,这个可执行文件的运行速度相当快,甚至包括了文件的读取和写入。可是自己编译产生的可执行文件,即使是单个模块运行速度也不快。我想问问项目里自带的isp是怎么得到的?

Try code on catapult : hls_stream undefined

Run the catapullt script and get ERROR:
such as "cannot find ap_init.h / hls_stream.h"

I can convert ap_init.h to ac_init in catapult. But how to convert hls_stream.h ?

isp.exe

请问下isp.exe是怎么编译生成的谢谢

绿平衡

绿平衡模块算法有没有具体的原理,查找表和移位那一块看文档看的不是很懂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.