Skip to content

Commit

Permalink
Add matchlib_toolkit submodule and clean-up Catapult SystemC flow
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriele-tombesi authored and jzuckerman committed Feb 3, 2023
1 parent adc5613 commit cbc8d68
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@
[submodule "soft/ariane/opensbi"]
path = soft/ariane/opensbi
url = https://github.com/sld-columbia/opensbi.git
[submodule "accelerators/catapult_hls/common/matchlib_toolkit"]
path = accelerators/catapult_hls/common/matchlib_toolkit
url = https://github.com/hlslibs/matchlib_toolkit.git
1 change: 1 addition & 0 deletions accelerators/catapult_hls/common/matchlib_toolkit
Submodule matchlib_toolkit added at e4c854
26 changes: 16 additions & 10 deletions accelerators/catapult_hls/common/systemc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@ INCDIR += -I../inc
INCDIR += -I../inc/mem_bank/
INCDIR += -I../../../common/inc
INCDIR += -I../../../common/inc/core/systems
INCDIR += -I$(SYSTEMC)/include
INCDIR += -I$(CATAPULT_HOME)/shared/include
INCDIR += -I$(CATAPULT_HOME)/shared/pkgs/matchlib/cmod/include
INCDIR += -I$(BOOST_HOME)/include

INCDIR += -I../../../common/matchlib_toolkit/include
INCDIR += -I../../../common/matchlib_toolkit/examples/systemc-2.3.3/include
INCDIR += -I../../../common/matchlib_toolkit/examples/systemc-2.3.3/src
INCDIR += -I../../../common/matchlib_toolkit/examples/matchlib_connections/include
INCDIR += -I../../../common/matchlib_toolkit/examples/matchlib/cmod/include
INCDIR += -I../../../common/matchlib_toolkit/examples/preprocessor/include
INCDIR += -I../../../common/matchlib_toolkit/examples/rapidjson/include
INCDIR += -I../../../common/matchlib_toolkit/examples/ac_types/include
INCDIR += -I../../../common/matchlib_toolkit/examples/ac_math/include
INCDIR += -I../../../common/matchlib_toolkit/examples/ac_simutils/include


CXXFLAGS ?=
Expand All @@ -36,7 +43,6 @@ CXXFLAGS += -DDMA_WIDTH=$(DMA_WIDTH)
CXXFLAGS += -DCLOCK_PERIOD=10000
CXXFLAGS += -D__CUSTOM_SIM__
CXXFLAGS += -D__MATCHLIB_CONNECTIONS__
#CXXFLAGS += -D__MNTR_AC_SHARED__
CXXFLAGS += -DHLS_CATAPULT

CXXFLAGS += -DCONNECTIONS_ACCURATE_SIM -DSC_INCLUDE_DYNAMIC_PROCESSES -DCONNECTIONS_NAMING_ORIGINAL
Expand All @@ -46,10 +52,12 @@ CXXFLAGS += -Wno-unknown-pragmas
CXXFLAGS += -Wno-unused-variable
CXXFLAGS += -Wno-unused-label
CXXFLAGS += -Wall
#CXXFLAGS += -DDMA_SINGLE_PROCESS


SYSTEMC_HOME=../../../common/matchlib_toolkit/examples/systemc-2.3.3

LDLIBS :=
LDLIBS += -L$(CATAPULT_HOME)/shared/lib
LDLIBS += -L$(SYSTEMC_HOME)/lib -L$(SYSTEMC_HOME)/lib-linux64

LDFLAGS :=
LDFLAGS += -lsystemc
Expand All @@ -63,11 +71,9 @@ VPATH += ../tb/tests
VPATH += ../inc
VPATH += ../src
VPATH += ../../../common/inc
#VPATH += $(ESP_ROOT)/accelerators/catapult_hls/common/inc/core/systems

SRCS ?=
SRCS += $(foreach s, $(wildcard ../src/*.cpp) $(wildcard ../tb/*.cpp), $(shell basename $(s)))
#SRCS += $(foreach s, $(wildcard $(ESP_ROOT)/accelerators/catapult_hls/common/inc/core/systems/*.cpp), $(shell basename $(s)))

OBJS := $(SRCS:.cpp=.o)
-include $(OBJS:.o=.d)
Expand All @@ -89,7 +95,7 @@ $(TARGET): $(OBJS)
$(QUIET_CXX)$(CXX) $(CXXFLAGS) ${INCDIR} -c $< -o $@

run: $(TARGET)
$(QUIET_RUN) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(SYSTEMC)/lib-linux64 ./$< $(RUN_ARGS)
$(QUIET_RUN) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(SYSTEMC_HOME)/lib-linux64 ./$< $(RUN_ARGS)

clean:
$(QUIET_CLEAN)rm -f *.o *.d *.txt *.vcd $(TARGET)
Expand Down
7 changes: 0 additions & 7 deletions tools/accgen/accgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,6 @@ fi

### Generate skeleton for unit testbench
if [ "$FLOW" == "catapult_hls" ]; then
cd $ACC_DIR/hw/inc
# accelerator_specs.hpp
sed -i "s/\/\* <<--mem-footprint-->> \*\//${memory_footprint}/g" ${LOWER}_specs.hpp
sed -i "/\/\* <<--defines-->> \*\//a #define DATA_WIDTH $data_width" ${LOWER}_specs.hpp
sed -i "/\/\* <<--defines-->> \*\//a #define PLM_IN_WORD $in_word" ${LOWER}_specs.hpp
sed -i "/\/\* <<--defines-->> \*\//a #define PLM_OUT_WORD $out_word" ${LOWER}_specs.hpp

cd $ACC_DIR/hw/tb
# testbench.hpp
sed -i "s/\/\* <<--data_out_size-->> \*\//${data_out_size_expr}/g" testbench.hpp
Expand Down
4 changes: 2 additions & 2 deletions utils/make/accelerators.mk
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ $(CATAPULTHLS_ACC-hls): %-hls : %-wdir
fi;
@echo "$(@:-hls=)" >> $(ESP_ROOT)/tech/$(TECHLIB)/acc/installed.log

$(CATAPULTHLS_ACC-sim): %-hls : %-wdir
$(CATAPULTHLS_ACC-sim): %-sim : %-wdir
$(QUIET_INFO)echo "Running RTL simulation for available implementations of $(@:-hls=)"
$(QUIET_MAKE)ACCELERATOR=$(@:-sim=) TECH=$(TECHLIB) ESP_ROOT=$(ESP_ROOT) make -C $(CATAPULTHLS_ACC_PATH)/$(@:-sim=)/hw/hls-work-$(TECHLIB) sim | tee $(HLS_LOGS)/$(@:-hls=)_hls.log
$(QUIET_RUN)ACCELERATOR=$(@:-sim=) TECH=$(TECHLIB) ESP_ROOT=$(ESP_ROOT) make -C $(CATAPULTHLS_ACC_PATH)/$(@:-sim=)/hw/hls-work-$(TECHLIB) sim | tee $(HLS_LOGS)/$(@:-hls=)_hls.log

$(CATAPULTHLS_ACC-clean): %-clean : %-wdir
$(QUIET_CLEAN)ACCELERATOR=$(@:-clean=) TECH=$(TECHLIB) ESP_ROOT=$(ESP_ROOT) make -C $(CATAPULTHLS_ACC_PATH)/$(@:-clean=)/hw/hls-work-$(TECHLIB) clean
Expand Down

0 comments on commit cbc8d68

Please sign in to comment.