From 5118d0eeb284d442fb96379b977c2837e9a06e8e Mon Sep 17 00:00:00 2001 From: Dustin Richmond Date: Tue, 9 Feb 2016 10:06:31 -0800 Subject: [PATCH] Adding the applications we use to test before release --- c_c++/linux/x64/test_apps/Makefile | 27 ++ c_c++/linux/x64/test_apps/testutil.c | 509 +++++++++++++++++++++ c_c++/linux/x64/test_apps/testutil.c_multi | 160 +++++++ c_c++/linux/x64/test_apps/testutil.sh | 22 + c_c++/linux/x64/test_apps/timer.h | 8 + 5 files changed, 726 insertions(+) create mode 100644 c_c++/linux/x64/test_apps/Makefile create mode 100644 c_c++/linux/x64/test_apps/testutil.c create mode 100644 c_c++/linux/x64/test_apps/testutil.c_multi create mode 100755 c_c++/linux/x64/test_apps/testutil.sh create mode 100644 c_c++/linux/x64/test_apps/timer.h diff --git a/c_c++/linux/x64/test_apps/Makefile b/c_c++/linux/x64/test_apps/Makefile new file mode 100644 index 0000000..c326bcf --- /dev/null +++ b/c_c++/linux/x64/test_apps/Makefile @@ -0,0 +1,27 @@ +program_NAME := testutil +program_C_SRCS := $(wildcard *.c) +program_CXX_SRCS := $(wildcard *.cpp) +program_C_OBJS := ${program_C_SRCS:.c=.o} +program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} +program_OBJS := $(program_C_OBJS) $(program_CXX_OBJS) +program_INCLUDE_DIRS := +program_LIBRARY_DIRS := +program_LIBRARIES := riffa +CPPFLAGS += -g + +CPPFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir)) +LDFLAGS += $(foreach librarydir,$(program_LIBRARY_DIRS),-L$(librarydir)) +LDFLAGS += $(foreach library,$(program_LIBRARIES),-l$(library)) + +.PHONY: all clean distclean + +all: $(program_NAME) + +$(program_NAME): $(program_OBJS) + $(CC) $(CPPFLAGS) $(program_OBJS) -o $(program_NAME) $(LDFLAGS) + +clean: + @- $(RM) $(program_NAME) + @- $(RM) $(program_OBJS) + +distclean: clean diff --git a/c_c++/linux/x64/test_apps/testutil.c b/c_c++/linux/x64/test_apps/testutil.c new file mode 100644 index 0000000..9f347a7 --- /dev/null +++ b/c_c++/linux/x64/test_apps/testutil.c @@ -0,0 +1,509 @@ +#include +#include +#include "timer.h" +#include "riffa.h" +#define NUM_TESTS 100 + +int main(int argc, char** argv) { + fpga_t * fpga; + fpga_info_list info; + int option; + int i; + int id; + int chnl; + size_t numWords; + int sent; + int recvd; + int failure = 0; + unsigned int * sendBuffer; + unsigned int * recvBuffer; + int err; + GET_TIME_INIT(3); + + if (argc < 2) { + printf("Usage: %s