X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=fhi_lib%2Ftest%2Ftest_xran%2FMakefile;fp=fhi_lib%2Ftest%2Ftest_xran%2FMakefile;h=ebe415ef52c164aaa3a4e62e8252a4fe1547aec8;hp=d5709b87c14cfe7ee542bee1deaf7b91fa530760;hb=2de97529a4c5a1922214ba0e6f0fb84cacbd0bc7;hpb=81a09690b36b3a4e89b4dae34f30933de13f7f90 diff --git a/fhi_lib/test/test_xran/Makefile b/fhi_lib/test/test_xran/Makefile index d5709b8..ebe415e 100644 --- a/fhi_lib/test/test_xran/Makefile +++ b/fhi_lib/test/test_xran/Makefile @@ -1,6 +1,6 @@ #/****************************************************************************** #* -#* Copyright (c) 2019 Intel. +#* Copyright (c) 2020 Intel. #* #* Licensed under the Apache License, Version 2.0 (the "License"); #* you may not use this file except in compliance with the License. @@ -50,7 +50,9 @@ endif RTE_TARGET ?= x86_64-native-linuxapp-icc -RTE_INC := $(RTE_SDK)/$(RTE_TARGET)/include +RTE_LIBS = $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --static --libs libdpdk) +RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk) + # Where to find user code. COMMON_TEST_DIR = $(XRAN_DIR)/test/common @@ -64,7 +66,7 @@ USER_API = $(XRAN_DIR)/lib/api CPPFLAGS += -isystem $(GTEST_ROOT)/include # Flags passed to the C++ compiler. -CXXFLAGS += -g -std=gnu++11 -Wall -Wextra -pthread -I$(USER_API) -I$(USER_DIR) -I$(USER_ETH) -I$(MLOG_DIR)/source -I $(COMMON_TEST_DIR) -I$(RTE_INC) +CXXFLAGS += -g -std=c++14 -Wall -Wextra -pthread -mcmodel=large -I$(USER_API) -I$(USER_DIR) -I$(USER_ETH) -I$(MLOG_DIR)/source -I $(COMMON_TEST_DIR) -I$(RTE_INC) # All tests produced by this Makefile. Remember to add new tests you # created to the list. @@ -75,9 +77,6 @@ TESTS = unittests GTEST_HEADERS = $(GTEST_ROOT)/include/gtest/*.h \ $(GTEST_ROOT)/include/gtest/internal/*.h -#RTE_LIBS = -L$(RTE_SDK)/$(RTE_TARGET)/lib -Wl,--whole-archive -Wl,-lrte_mempool_ring -Wl,-lrte_pci -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_net -Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_kni -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_jobstats -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,-lrte_vhost -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lrte_ethdev -Wl,-lrte_cryptodev -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_fm10k -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_null -Wl,-lrte_pdump -Wl,-lrt -Wl,-lm -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive -RTE_LIBS = -L$(RTE_SDK)/$(RTE_TARGET)/lib -Wl,-lrte_flow_classify -Wl,--whole-archive -Wl,-lrte_pipeline -Wl,--no-whole-archive -Wl,--whole-archive -Wl,-lrte_table -Wl,--no-whole-archive -Wl,--whole-archive -Wl,-lrte_port -Wl,--no-whole-archive -Wl,-lrte_pdump -Wl,-lrte_distributor -Wl,-lrte_ip_frag -Wl,-lrte_meter -Wl,-lrte_lpm -Wl,--whole-archive -Wl,-lrte_acl -Wl,--no-whole-archive -Wl,-lrte_jobstats -Wl,-lrte_metrics -Wl,-lrte_bitratestats -Wl,-lrte_latencystats -Wl,-lrte_power -Wl,-lrte_efd -Wl,-lrte_bpf -Wl,--whole-archive -Wl,-lrte_cfgfile -Wl,-lrte_gro -Wl,-lrte_gso -Wl,-lrte_hash -Wl,-lrte_member -Wl,-lrte_vhost -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_net -Wl,-lrte_ethdev -Wl,-lrte_bbdev -Wl,-lrte_cryptodev -Wl,-lrte_security -Wl,-lrte_compressdev -Wl,-lrte_eventdev -Wl,-lrte_rawdev -Wl,-lrte_timer -Wl,-lrte_mempool -Wl,-lrte_mempool_ring -Wl,-lrte_ring -Wl,-lrte_pci -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_reorder -Wl,-lrte_sched -Wl,-lrte_kni -Wl,-lrte_common_octeontx -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_bus_dpaa -Wl,-lrte_common_dpaax -Wl,-lrte_stack -Wl,-lrte_bus_fslmc -Wl,-lrte_mempool_bucket -Wl,-lrte_mempool_stack -Wl,-lrte_mempool_dpaa -Wl,-lrte_mempool_dpaa2 -Wl,-lrte_pmd_af_packet -Wl,-lrte_pmd_ark -Wl,-lrte_pmd_iavf -Wl,-lrte_pmd_avp -Wl,-lrte_pmd_axgbe -Wl,-lrte_pmd_bnxt -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_cxgbe -Wl,-lrte_pmd_dpaa -Wl,-lrte_pmd_dpaa2 -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ena -Wl,-lrte_pmd_enic -Wl,-lrte_pmd_fm10k -Wl,-lrte_pmd_failsafe -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_kni -Wl,-lrte_pmd_lio -Wl,-lrte_pmd_nfp -Wl,-lrte_pmd_null -Wl,-lrte_pmd_qede -Wl,-lrte_pmd_ring -Wl,-lrte_pmd_softnic -Wl,-lrte_pmd_tap -Wl,-lrte_pmd_thunderx_nicvf -Wl,-lrte_pmd_vdev_netvsc -Wl,-lrte_pmd_virtio -Wl,-lrte_pmd_vhost -Wl,-lrte_pmd_ifc -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_bus_vmbus -Wl,-lrte_pmd_netvsc -Wl,-lrte_pmd_bbdev_null -Wl,-lrte_pmd_null_crypto -Wl,-lrte_pmd_crypto_scheduler -Wl,-lrte_pmd_dpaa2_sec -Wl,-lrte_pmd_dpaa_sec -Wl,-lrte_pmd_virtio_crypto -Wl,-lrte_pmd_octeontx_zip -Wl,-lrte_pmd_qat -Wl,-lrte_pmd_skeleton_event -Wl,-lrte_pmd_sw_event -Wl,-lrte_pmd_octeontx_ssovf -Wl,-lrte_pmd_dpaa_event -Wl,-lrte_pmd_dpaa2_event -Wl,-lrte_mempool_octeontx -Wl,-lrte_pmd_octeontx -Wl,-lrte_pmd_opdl_event -Wl,-lrte_rawdev_skeleton -Wl,-lrte_rawdev_dpaa2_cmdif -Wl,-lrte_rawdev_dpaa2_qdma -Wl,-lrte_bus_ifpga -Wl,--no-whole-archive -Wl,-lrt -Wl,-lm -Wl,-lnuma -Wl,-ldl -Wl, - CFLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \ -fdata-sections \ -ffunction-sections \ @@ -85,23 +84,29 @@ CFLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \ -Wall \ -Wimplicit-function-declaration \ -wd1786 \ - -I$(USER_DIR) -I$(USER_API) -I$(USER_API) -I$(USER_DIR) -I$(USER_ETH) -I$(MLOG_DIR)/source -I$(RTE_INC) + -mcmodel=large \ + -I$(USER_API) -I$(USER_DIR) -I$(USER_ETH) -I$(MLOG_DIR)/source -I$(RTE_INC) C_SRC = \ - $(USER_ETH)/ethdi.c \ - $(USER_ETH)/ethernet.c \ - $(USER_DIR)/xran_up_api.c \ - $(USER_DIR)/xran_sync_api.c \ - $(USER_DIR)/xran_timer.c \ - $(USER_DIR)/xran_cp_api.c \ - $(USER_DIR)/xran_transport.c \ - $(USER_DIR)/xran_common.c \ - $(USER_DIR)/xran_ul_tables.c \ - $(USER_DIR)/xran_frame_struct.c \ + $(USER_ETH)/ethdi.c \ + $(USER_ETH)/ethernet.c \ + $(USER_DIR)/xran_up_api.c \ + $(USER_DIR)/xran_sync_api.c \ + $(USER_DIR)/xran_timer.c \ + $(USER_DIR)/xran_cp_api.c \ + $(USER_DIR)/xran_transport.c \ + $(USER_DIR)/xran_common.c \ + $(USER_DIR)/xran_ul_tables.c \ + $(USER_DIR)/xran_frame_struct.c \ $(USER_DIR)/xran_app_frag.c \ - $(USER_DIR)/xran_main.c - -# $(USER_DIR)/xran_compression.c + $(USER_DIR)/xran_dev.c \ + $(USER_DIR)/xran_rx_proc.c \ + $(USER_DIR)/xran_tx_proc.c \ + $(USER_DIR)/xran_cp_proc.c \ + $(USER_DIR)/xran_cb_proc.c \ + $(USER_DIR)/xran_mem_mgr.c \ + $(USER_DIR)/xran_main.c \ + $(USER_DIR)/xran_delay_measurement.c CC_SRC = \ $(COMMON_TEST_DIR)/xranlib_unit_test_main.cc \ @@ -110,8 +115,10 @@ CC_SRC = \ prach_functional.cc \ prach_performance.cc \ u_plane_functional.cc \ + u_plane_performance.cc \ init_sys_functional.cc \ compander_functional.cc \ + mod_compression_unit_test.cc \ unittests.cc # u_plane_performance.cc \ @@ -122,44 +129,125 @@ CPP_SRC = $(COMMON_TEST_DIR)/common.cpp \ $(USER_DIR)/xran_bfp_cplane8.cpp \ $(USER_DIR)/xran_bfp_cplane16.cpp \ $(USER_DIR)/xran_bfp_cplane32.cpp \ - $(USER_DIR)/xran_bfp_cplane64.cpp + $(USER_DIR)/xran_bfp_cplane64.cpp \ + $(USER_DIR)/xran_bfp_uplane_9b16rb.cpp \ + $(USER_DIR)/xran_bfp_uplane.cpp \ + $(USER_DIR)/xran_mod_compression.cpp + +CPP_SRC_SNC = $(USER_DIR)/xran_compression_snc.cpp \ + $(USER_DIR)/xran_bfp_cplane8_snc.cpp \ + $(USER_DIR)/xran_bfp_cplane16_snc.cpp \ + $(USER_DIR)/xran_bfp_cplane32_snc.cpp \ + $(USER_DIR)/xran_bfp_cplane64_snc.cpp \ + $(USER_DIR)/xran_bfp_uplane_snc.cpp + C_OBJS := $(patsubst %.c,%.o,$(C_SRC)) CC_OBJS := $(patsubst %.cc,%.o,$(CC_SRC)) CPP_OBJS := $(patsubst %.cpp,%.o,$(CPP_SRC)) +CPP_SNC_OBJS := $(patsubst %.cpp,%.o,$(CPP_SRC_SNC)) + +CPPFLAGS += -I$(USER_DIR) -I$(USER_API) + +#-qopt-report=5 -qopt-matmul -qopt-report-phase=all +CPP_COMP := -O3 -DNDEBUG -xcore-avx512 -fPIE -restrict -fasm-blocks +CPP_COMP_SNC := -O3 -DNDEBUG -march=icelake-server -fPIE -restrict -fasm-blocks -CPPFLAGS += -I$(USER_DIR) -I$(USER_API) +CPP_COMP := $(CPP_COMP) +CPP_COMP_SNC := $(CPP_COMP_SNC) + +ifeq ($(GEN_ASM), 1) +CPP_ASMS := $(patsubst %.cpp,%.asm,$(CPP_SRC)) +CPP_SNC_ASMS := $(patsubst %.cpp,%.asm,$(CPP_SRC_SNC)) +CPP_COMP += -qopt-report=5 -qopt-matmul -qopt-report-phase=all +CPP_COMP_SNC += -qopt-report=5 -qopt-matmul -qopt-report-phase=all +endif + +PROJECT_DEP_FILE := $(TESTS).dep + +ifeq ($(wildcard $(PROJECT_DEP_FILE)),$(PROJECT_DEP_FILE)) +GENERATE_DEPS := +else +C_DEPS := $(addprefix __dep__,$(subst ../,__up__,$(C_SRC))) +CC_DEPS := $(addprefix __dep__,$(subst ../,__up__,$(CC_SRC))) +CPP_DEPS := $(addprefix __dep__,$(subst ../,__up__,$(CPP_SRC))) +CPP_SNC_DEPS := $(addprefix __dep__,$(subst ../,__up__,$(CPP_SRC_SNC))) +GENERATE_DEPS := generate_deps +endif -CPP_COMP = -O3 -xcore-avx512 -restrict -g -fasm-blocks # House-keeping build targets. -all : echo_start_build $(TESTS) +all : echo_start_build $(GENERATE_DEPS) $(TESTS) clean : @echo [CLEAN] - rm -f $(TESTS) *.o $(COMMON_TEST_DIR)/*.o $(USER_DIR)/*.o $(USER_ETH)/*.o + @$(RM) -f $(TESTS) *.o $(COMMON_TEST_DIR)/*.o $(USER_DIR)/*.o $(USER_ETH)/*.o \ + *.asm $(COMMON_TEST_DIR)/*.asm $(USER_DIR)/*.asm $(USER_ETH)/*.asm \ + *.asm $(COMMON_TEST_DIR)/*.asm2 $(USER_DIR)/*.asm2 $(USER_ETH)/*.asm2 \ + *.optrpt $(COMMON_TEST_DIR)/*.optrpt $(USER_DIR)/*.optrpt $(USER_ETH)/*.optrpt;\ + $(RM) $(PROJECT_DEP_FILE) -.PHONY: xclean +.PHONY: xclean xclean: clean +.PHONY : clear_dep +clear_dep: + @$(RM) $(PROJECT_DEP_FILE) + @echo [DEP] $(PROJECT_DEP_FILE) + +$(C_DEPS) : + @$(CC) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(patsubst %.c,%.o,$(subst __up__,../,$(subst __dep__,,$@))) $(CFLAGS) >> $(PROJECT_DEP_FILE) + +$(CC_DEPS) : + @$(CC) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(patsubst %.cc,%.o,$(subst __up__,../,$(subst __dep__,,$@))) $(CPPFLAGS) $(CXXFLAGS) >> $(PROJECT_DEP_FILE) + +$(CPP_DEPS) : + @$(CPP) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(patsubst %.cpp,%.o,$(subst __up__,../,$(subst __dep__,,$@))) $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP) >> $(PROJECT_DEP_FILE) + +$(CPP_SNC_DEPS) : + @$(CPP) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(patsubst %.cpp,%.o,$(subst __up__,../,$(subst __dep__,,$@))) $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP_SNC) >> $(PROJECT_DEP_FILE) + +.PHONY : generate_deps +generate_deps : clear_dep $(C_DEPS) $(CC_DEPS) $(CPP_DEPS) $(CPP_SNC_DEPS) + +ifeq ($(wildcard $(PROJECT_DEP_FILE)),$(PROJECT_DEP_FILE)) + +include $(PROJECT_DEP_FILE) + +endif + .PHONY : echo_start_build echo_start_build : @echo Build Tests with @echo $(USER_DIR) @echo $(USER_API) -$(CC_OBJS) : +$(CC_OBJS) : $(CC_SRC) @echo "[CC] $@" @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o"$@" $(patsubst %.o,%.cc,$@) -$(CPP_OBJS) : +$(CPP_ASMS) : + @echo "[CPP->ASM] $@" + @$(CXX) -S $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP) -fsource-asm -save-temps -o"$@" $(patsubst %.asm,%.cpp,$@) + @cat $@ | grep -v '^..LN' |grep -v ' .loc' > $@2 + +$(CPP_OBJS) : $(CPP_ASMS) @echo "[CPP] $@" @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP) -o"$@" $(patsubst %.o,%.cpp,$@) +$(CPP_SNC_ASMS) : + @echo "[CPP-SNC->ASM] $@" + @$(CXX) -S $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP_SNC) -fsource-asm -save-temps -o"$@" $(patsubst %.asm,%.cpp,$@) + @cat $@ | grep -v '^..LN' |grep -v ' .loc' > $@2 + +$(CPP_SNC_OBJS) : $(CPP_SNC_ASMS) + @echo "[CPP-SNC] $@" + @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CPP_COMP_SNC) -o"$@" $(patsubst %.o,%.cpp,$@) + $(C_OBJS) : @echo "[C] $@" @$(CC) -c $(CFLAGS) -o"$@" $(patsubst %.o,%.c,$@) -unittests : $(CC_OBJS) $(CPP_OBJS) $(C_OBJS) $(GTEST_ROOT)/libgtest.a +$(TESTS) : $(CC_OBJS) $(CPP_OBJS) $(CPP_SNC_OBJS) $(C_OBJS) $(GTEST_ROOT)/libgtest.a @echo "[LD] $@" $(CXX) $(CPPFLAGS) $(CXXFLAGS) -L$(MLOG_DIR)/bin -Wl, $(RTE_LIBS) -lpthread -lnuma $^ -o $@