Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Add bug-fixed version of quantized convolution IP with kn2row and tiling #130

Merged
merged 46 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c6ca754
Turned off a8w1_conv and change the name of comparison for qconv_with…
Dec 17, 2018
1fe2228
Change some build configuration.
Nov 5, 2018
90187a2
Enable conv_kn2row_tiling IP to work with multiple out_c and in_c
Nov 9, 2018
4514b8c
Implement quantized convolution with kn2row and tiling
Nov 9, 2018
97af0f5
Remove debug codes like print statements
Nov 9, 2018
e9637a8
Setup intel HLS codes and Fix typo
Nov 9, 2018
242f18f
Refactor codes with clang-format(that doesn\'t follow LM c++ coding s…
Nov 13, 2018
59e1075
Update clang-format setting to automatically keep consistency with st…
Nov 14, 2018
c666612
Add intel HLS implementation of qconv_kn2row_tiling without any optim…
Nov 16, 2018
f7b9931
Change the conv_kn2row_tiling computation order.
Nov 16, 2018
b33686a
Add optimization to qconv_kn2row_tiling in intelHLS
Nov 19, 2018
1f0ed02
A optimization that ic=2, oc=8 and loop coalasced andin_buf is implem…
Nov 27, 2018
06778d6
Fix threshold bus and some parameters
Nov 29, 2018
b842066
implement no-mc_ic4-oc8_in-buf-line-bram_90MHz_hls-100MHz
Dec 3, 2018
be25048
Move BRAM memories into function's glow scope
Dec 4, 2018
5cf679f
Completed HLS compile, synthesis, fit and pass the timing analysis
Dec 27, 2018
75c7efc
Change the frequency when compiling
Jan 16, 2019
7de3ba7
Fix threshold skipping bug on IP
Jan 25, 2019
0538b95
Fix the frequency for HLS and fix threshold skipping result when the …
Jan 25, 2019
505a85e
Add synthesized IP that quantized convolution with kn2row and tiling
Jan 25, 2019
f191d56
Merge branch 'master' into add_qconv_kn2row_tiling
Jan 28, 2019
28ace4d
Merge branch 'master' into add_qconv_kn2row_tiling
Feb 5, 2019
9703b39
Turned off a8w1_conv and change the name of comparison for qconv_with…
Dec 17, 2018
3b63c2a
Change some build configuration.
Nov 5, 2018
5ee50d2
Enable conv_kn2row_tiling IP to work with multiple out_c and in_c
Nov 9, 2018
848399c
Implement quantized convolution with kn2row and tiling
Nov 9, 2018
daa5e48
Remove debug codes like print statements
Nov 9, 2018
65a7f13
Setup intel HLS codes and Fix typo
Nov 9, 2018
e89ed74
Refactor codes with clang-format(that doesn\'t follow LM c++ coding s…
Nov 13, 2018
c4abdcd
Update clang-format setting to automatically keep consistency with st…
Nov 14, 2018
4f2885b
Add intel HLS implementation of qconv_kn2row_tiling without any optim…
Nov 16, 2018
feb6119
Change the conv_kn2row_tiling computation order.
Nov 16, 2018
5316ff2
Add optimization to qconv_kn2row_tiling in intelHLS
Nov 19, 2018
b721831
A optimization that ic=2, oc=8 and loop coalasced andin_buf is implem…
Nov 27, 2018
ce6771e
Fix threshold bus and some parameters
Nov 29, 2018
a653e7a
implement no-mc_ic4-oc8_in-buf-line-bram_90MHz_hls-100MHz
Dec 3, 2018
25abb4d
Move BRAM memories into function's glow scope
Dec 4, 2018
1f05ba1
Completed HLS compile, synthesis, fit and pass the timing analysis
Dec 27, 2018
4484f75
Change the frequency when compiling
Jan 16, 2019
69d14c3
Fix threshold skipping bug on IP
Jan 25, 2019
be4a8d0
Fix the frequency for HLS and fix threshold skipping result when the …
Jan 25, 2019
1f3fa17
Add synthesized IP that quantized convolution with kn2row and tiling
Jan 25, 2019
b036984
Merge branch 'add_qconv_kn2row_tiling' of ssh://github.com/tkclimb/bl…
Feb 15, 2019
aa81e2f
Update hw_path
Feb 15, 2019
6312c77
Fixed the conflicts with the master and merge
Feb 15, 2019
944cc1e
Update pre kernel reorder and driver for de10-nano
Feb 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions dlk/backends/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
BasedOnStyle: 'Google'
AccessModifierOffset: -2
AlignEscapedNewlinesLeft: true
AlignConsecutiveAssignments: false
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: 'None'
BreakBeforeBraces: 'Mozilla'
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerBinding: true
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: 'None'
PointerAlignment: 'Left'
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: 'ControlStatements'
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
Standard: 'Cpp03'
TabWidth: 2
UseTab: 'Never'
18 changes: 12 additions & 6 deletions dlk/backends/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.1)
project(conv_sample CXX)
project(dlk_backends CXX)


set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")

get_filename_component(ROOT_DIR ${CMAKE_SOURCE_DIR} ABSOLUTE)
get_filename_component(INTEL_HLS_DIR "${SRC_DIR}/intel_hls" ABSOLUTE)
Expand All @@ -29,25 +27,33 @@ elseif(UNIX AND NOT APPLE)
get_filename_component(INTEL_HLS_LIB_DIR "$ENV{HLS_INSTALL_DIR}/host/linux64/lib/" ABSOLUTE)
endif()


include_directories(${INCLUDE_DIR})
# link_directories(${HLS_LIB_DIR})

file(GLOB_RECURSE TB_SRC "${TB_DIR}/*.cpp")
file(GLOB_RECURSE CPP_SRC "${CPP_DIR}/*.cpp")
file(GLOB_RECURSE INTEL_HLS_SRC "${INTEL_HLS_DIR}/*.cpp")
set(SRC ${TB_SRC} ${CPP_SRC})

enable_testing()
add_executable(x86 ${SRC})
target_compile_options(x86 PRIVATE -std=c++0x
-O0
-Wall
-Wextra
-Werror
-Wno-unknown-pragmas
-Wno-unused-function
-Wno-unused-parameter
-Wno-unused-variable
-Wno-sign-compare)
-Wno-sign-compare
-fno-omit-frame-pointer
-fsanitize=address)
target_link_libraries(x86
-fsanitize=address
)
add_test(NAME x86_test
COMMAND x86 random
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})


if(UNIX AND NOT APPLE)
Expand Down
12 changes: 4 additions & 8 deletions dlk/backends/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
DEVICE := 5CSEBA6U23I7
CLOCK := 50MHz
CLOCK := 75MHz

CXX :=
# COMPONENTS := --component intel_hls_a8w1_qconv_with_kn2row_impl,intel_hls_qconv_with_kn2row_impl
# COMPONENTS := --component intel_hls_qconv_with_kn2row_impl
# COMPONENTS := --component intel_hls_apply_thresholds_impl
COMPONENTS := --component intel_hls_qconv_with_kn2row_impl,intel_hls_apply_thresholds_impl
# COMPONENTS := --component intel_hls_a8w1_qconv_with_kn2row_impl
COMPONENTS := --component intel_hls_qconv_kn2row_tiling_impl

SRC_DIR := ./src
TB_DIR := $(SRC_DIR)/tb
Expand Down Expand Up @@ -52,13 +48,13 @@ clean:


x86: CXX = g++
x86: FLAGS += $(INCLUDE) -O3 -std=c++0x -g
x86: FLAGS += $(INCLUDE) -O0 -std=c++0x -g

arm: CXX = arm-linux-gnueabihf-g++
arm: FLAGS += $(INCLUDE) -static -s -std=c++0x -O3

fpga: CXX = arm-linux-gnueabihf-g++
fpga: FLAGS += $(INCLUDE) -static -s -std=c++0x -O3 -D_DE10_NANO_
fpga: FLAGS += $(INCLUDE) -static -std=c++0x -s -O3 -D_DE10_NANO_

sim: CXX = i++
sim: FLAGS += -march=x86-64 $(INTEL_HLS_INCLUDE) -lm $(COMPONENTS) -D_INTEL_HLS_
Expand Down
25 changes: 0 additions & 25 deletions dlk/backends/docker/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions dlk/backends/docker/init.sh

This file was deleted.

10 changes: 5 additions & 5 deletions dlk/backends/include/common/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ limitations under the License.
==============================================================================*/

#pragma once
#include <iostream>
#include <cmath>
#include <assert.h>
#include <cmath>
#include <cstring>
#include <iostream>
#include "common/type_info.h"

#include "params/conv.h"
#include "params/gemm.h"

#define IP_CSR_ADDR 0xFF200000
#define A8W1_IP_CSR_ADDR 0xFF200100
#define IN_DATA_ADDR 0x20000000
#define IN_DATA_ADDR 0x20000000
#define OUT0_DATA_ADDR 0x2C000000
#define OUT1_DATA_ADDR 0x32000000
#define OUT_DATA_ADDR OUT0_DATA_ADDR
#define K_DATA_ADDR 0x38000000
#define THRESHOLDS_ADDR 0x3F00000
#define K_DATA_ADDR 0x38000000
#define THRESHOLDS_ADDR 0x3F000000

This file was deleted.

Loading