Skip to content

Commit

Permalink
Update parameters automation
Browse files Browse the repository at this point in the history
  • Loading branch information
HongshiTan committed Aug 30, 2020
1 parent c512fd2 commit 3cb16d4
Show file tree
Hide file tree
Showing 31 changed files with 948 additions and 229 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -21,4 +21,5 @@ csr
tmp_fpga_top
tmp_para
code_gen
para_gen
para_gen
makefile_gen
44 changes: 3 additions & 41 deletions Makefile
@@ -1,44 +1,6 @@
SHELL := /bin/bash
COMMON_REPO = ./
ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO))
UTILS_PATH = ./utils
include ThunderGP.mk

include $(UTILS_PATH)/help.mk
include $(UTILS_PATH)/utils.mk
.PHONY: all clean exe hwemuprepare

TARGETS := hw
TARGET := $(TARGETS)
DEVICES := xilinx_vcu1525_xdma_201830_1
# device list:
# xilinx_vcu1525_xdma_201830_1
# xilinx_u200_xdma_201830_2
# xilinx_u250_xdma_201830_2

DEVICE := $(DEVICES)

.PHONY:all clean emconfig exe
all:
ifndef app
$(error app is undefined)
else
APP = $(app)
APPCONFIG = ./application/$(APP)

include $(APPCONFIG)/config.mk
include $(APPCONFIG)/build.mk
include ./application/common.mk

CODE_GEN_PATH=./libfpga/generator
include $(CODE_GEN_PATH)/parser.mk


all: code_gen $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig
exe: cleanexe $(EXECUTABLE)

include ./application/common_gs_kernel.mk
include ./application/common_apply_kernel.mk

include $(UTILS_PATH)/bitstream.mk
include $(UTILS_PATH)/clean.mk

endif
include utils/main.mk
17 changes: 17 additions & 0 deletions ThunderGP.mk
@@ -0,0 +1,17 @@
TARGETS := hw
# emu or acc:
# hw
# hw_emu

APP :=
# pass in by app=

TARGET_BANDWIDTH := 77
# target memory bandwidth in GB/s
# max: 77GB/s

DEVICES := xilinx_u250_xdma_201830_2
# device list:
# xilinx_vcu1525_xdma_201830_1
# xilinx_u200_xdma_201830_2
# xilinx_u250_xdma_201830_2
23 changes: 9 additions & 14 deletions application/common.mk
Expand Up @@ -52,7 +52,9 @@ endif


# Host compiler global settings
CXXFLAGS := $(opencl_CXXFLAGS) -Wall
CXXFLAGS := $(AUTOGEN_CFLAG)

CXXFLAGS += $(opencl_CXXFLAGS) -Wall
CXXFLAGS += -I/$(XILINX_SDX)/Vivado_HLS/include/ -O3 -g -fmessage-length=0 -std=c++14 -Wno-deprecated-declarations
CXXFLAGS += -I ./
CXXFLAGS += -I ./libfpga
Expand All @@ -62,16 +64,20 @@ CXXFLAGS += -I ./libgraph/scheduler
CXXFLAGS += -I ./libgraph/verification
CXXFLAGS += -I $(APPCONFIG)
CXXFLAGS += -I ./application
CXXFLAGS += -I tmp_para

# Host linker flags
LDFLAGS := $(opencl_LDFLAGS)
LDFLAGS += -lrt -lstdc++ -lxilinxopencl



CLFLAGS := $(AUTOGEN_CFLAG)

ifeq ($(TARGET),$(filter $(TARGET), hw_emu))
CLFLAGS = -g -t $(TARGET)
CLFLAGS += -g -t $(TARGET)
else
CLFLAGS = -t $(TARGET)
CLFLAGS += -t $(TARGET)
endif

# Kernel compiler global settings
Expand Down Expand Up @@ -102,23 +108,12 @@ LDFLAGS += $(xcl_CXXFLAGS)
HOST_SRCS += $(xcl_SRCS)


GENFLAGS := -I ./libgraph

#############################################################################
# #
# Specific Build Configuration #
# #
#############################################################################

ifeq ($(strip $(HAVE_FULL_SLR)), $(strip $(VAR_TRUE)))
CXXFLAGS += -DSUB_PARTITION_NUM=4
CLFLAGS += -DSUB_PARTITION_NUM=4
GENFLAGS += -DSUB_PARTITION_NUM=4
else
CXXFLAGS += -DSUB_PARTITION_NUM=1
CLFLAGS += -DSUB_PARTITION_NUM=1
GENFLAGS += -DSUB_PARTITION_NUM=1
endif

ifeq ($(strip $(HAVE_APPLY)), $(strip $(VAR_TRUE)))
CXXFLAGS += -DHAVE_APPLY=1
Expand Down
36 changes: 0 additions & 36 deletions application/common_apply_kernel.mk

This file was deleted.

64 changes: 0 additions & 64 deletions application/common_gs_kernel.mk

This file was deleted.

3 changes: 1 addition & 2 deletions application/global_config.h
Expand Up @@ -12,8 +12,7 @@ typedef int prop_t;
#endif


#define BLK_SIZE (512*1024)
#define MAX_VERTICES_IN_ONE_PARTITION (BLK_SIZE)
#define MAX_VERTICES_IN_ONE_PARTITION (PARTITION_SIZE)
#define ENDFLAG 0xffffffff


Expand Down
12 changes: 12 additions & 0 deletions application/para_check.h
@@ -0,0 +1,12 @@
#ifndef __PARA_CHECK__
#define __PARA_CHECK__

#ifndef SUB_PARTITION_NUM
#error "SUB_PARTITION_NUM is not define! please check the ThunderGP para_gen."
#endif

#ifndef PARTITION_SIZE
#error "PARTITION_SIZE is not define! please check the ThunderGP para_gen."
#endif

#endif /* __PARA_CHECK__ */
20 changes: 10 additions & 10 deletions libfpga/common/apply_top.cpp
Expand Up @@ -10,9 +10,9 @@
extern "C" {
void vertexApply(
uint16 *vertexProp,
#pragma THUNDERGP INTERFACE_ARG tmpVertexProp
#pragma THUNDERGP MSLR_INTERFACE_ARG tmpVertexProp
uint16 *tmpVertexProp#%d#,
#pragma THUNDERGP INTERFACE_ARG newVertexProp
#pragma THUNDERGP MSLR_INTERFACE_ARG newVertexProp
uint16 *newVertexProp#%d#,
#if HAVE_APPLY_OUTDEG
uint16 *outDegree,
Expand All @@ -25,20 +25,20 @@ extern "C" {
{


#pragma THUNDERGP INTERFACE_HLS_ATTR tmpVertexProp
#pragma THUNDERGP MSLR_INTERFACE_ATTR tmpVertexProp

#pragma THUNDERGP INTERFACE_HLS_ATTR newVertexProp
#pragma THUNDERGP MSLR_INTERFACE_ATTR newVertexProp

#pragma THUNDERGP INTERFACE_HLS_INSTANCE tmpVertexProp
#pragma THUNDERGP MSLR_INTERFACE_INSTANCE tmpVertexProp
#pragma HLS INTERFACE m_axi port=tmpVertexProp#%d# offset=slave bundle=gmem#%d# max_read_burst_length=64 num_write_outstanding=4

#pragma THUNDERGP INTERFACE_HLS_INSTANCE tmpVertexProp
#pragma THUNDERGP MSLR_INTERFACE_INSTANCE tmpVertexProp
#pragma HLS INTERFACE s_axilite port=tmpVertexProp#%d# bundle=control

#pragma THUNDERGP INTERFACE_HLS_INSTANCE newVertexProp
#pragma THUNDERGP MSLR_INTERFACE_INSTANCE newVertexProp
#pragma HLS INTERFACE m_axi port=newVertexProp#%d# offset=slave bundle=gmem#%d# max_read_burst_length=64 num_write_outstanding=4

#pragma THUNDERGP INTERFACE_HLS_INSTANCE newVertexProp
#pragma THUNDERGP MSLR_INTERFACE_INSTANCE newVertexProp
#pragma HLS INTERFACE s_axilite port=newVertexProp#%d# bundle=control


Expand Down Expand Up @@ -92,7 +92,7 @@ extern "C" {
burstReadLite(addrOffset, vertexNum, vertexProp, vertexPropStream);


#pragma THUNDERGP INTERFACE_HLS_INSTANCE tmpVertexProp
#pragma THUNDERGP MSLR_INTERFACE_INSTANCE tmpVertexProp
burstReadLite(0, vertexNum, tmpVertexProp#%d#, tmpVertexPropArray[#%d#]);

for (int i = 0; i < SUB_PARTITION_NUM; i++)
Expand All @@ -117,7 +117,7 @@ extern "C" {
newVertexPropArray);


#pragma THUNDERGP INTERFACE_HLS_INSTANCE newVertexProp
#pragma THUNDERGP MSLR_INTERFACE_INSTANCE newVertexProp
writeBackLite(vertexNum, newVertexProp#%d# + (addrOffset >> 4), newVertexPropArray[#%d#]);

}
Expand Down

0 comments on commit 3cb16d4

Please sign in to comment.