rapidstream-org / rapidstream-tapa

RapidStream-TAPA compiles task-parallel HLS program into high-frequency FPGA accelerators.
https://tapa.rtfd.io
MIT License
149 stars 30 forks source link

Resource utilization check #130

Open enes1994 opened 1 year ago

enes1994 commented 1 year ago

Environment

estimated_resources

I am trying to see the total utilization of the resources(number of FFs,BRAMs etc.) with hw_emu target with vitis analyzer. But as you can see in the picture I cant see any data. Here what I use in my cmake file to build the system:

cmake_minimum_required(VERSION 3.16.3)

set(CMAKE_CXX_STANDARD 17)
project(vadd)

set(PLATFORM
    xilinx_u280_xdma_201920_3
    CACHE STRING "Target FPGA platform")

set(TOP vadd)

set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wno-write-strings")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") 

find_package(gflags REQUIRED)

find_package(Vitis)

include(${CMAKE_CURRENT_SOURCE_DIR}/tapa/cmake/apps.cmake)

include(${CMAKE_CURRENT_SOURCE_DIR}/tapa/cmake/TAPACCConfig.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/tapa/cmake/FindSphinx.cmake)

find_package(TAPA REQUIRED)
find_package(SDx REQUIRED)
add_executable(vadd)

target_sources(vadd PRIVATE host.cpp vadd.cpp)

target_link_libraries(vadd PRIVATE ${TAPA} gflags)
target_link_libraries(vadd PRIVATE tapa::tapa)

target_include_directories(vadd PUBLIC ${Vitis_INCLUDE_DIRS})
include(cmake/CMakeXilinx.cmake)

if(NOT PROJECT_NAME)
  project(tapa-apps-vadd)
endif()

add_test(NAME vadd COMMAND vadd)

if(SDx_FOUND)
  add_tapa_target(
    vadd-hw-xo
    ${TAPA_ARGS}
    INPUT ${CMAKE_CURRENT_SOURCE_DIR}/vadd.cpp
    TOP VecAdd
    CONNECTIVITY ${CMAKE_CURRENT_SOURCE_DIR}/connectivity.ini
    CONSTRAINT ${CMAKE_CURRENT_BINARY_DIR}/constraint.tcl
    PLATFORM ${PLATFORM}
  )

  add_xocc_hw_link_targets(
    ${CMAKE_CURRENT_BINARY_DIR}
    --config=${CMAKE_CURRENT_SOURCE_DIR}/connectivity.ini
    --vivado.synth.jobs 8
    --vivado.prop=run.impl_1.STEPS.OPT_DESIGN.TCL.PRE=${CMAKE_CURRENT_BINARY_DIR}/constraint.tcl
    INPUT vadd-hw-xo
    HW_EMU_XCLBIN hw_emu_xclbin
    HW_XCLBIN hw_xclbin
  )

  add_custom_target(
    vadd-cosim
    COMMAND $<TARGET_FILE:vadd>
            --bitstream=$<TARGET_PROPERTY:${hw_emu_xclbin},FILE_NAME>
    DEPENDS vadd ${hw_emu_xclbin}
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

  add_custom_target(
    vadd-hw
    COMMAND $<TARGET_FILE:vadd>
            --bitstream=$<TARGET_PROPERTY:${hw_xclbin},FILE_NAME>
    DEPENDS vadd ${hw_xclbin}
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

  add_test(NAME vadd-hw COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}
                                    --target vadd-hw)
endif()

Are there any way to do it like we do it with vitis hls?

Thanks in advance

Blaok commented 1 year ago

Sadly, there is no GUI for resource utilization yet. I couldn't find a proper interface to attach the resource utilization information to RTL kernels in Vitis/Vivado either.

If you just want to have some ideas about the resource utilization of your design, there is a text report, available under TAPA's work directory, named report.yaml. It is not as fancy as the Vitis analyzer GUI, but should be sufficiently readable for debugging purposes.