diff --git a/LICENSE b/LICENSE index 6dac56b..8611a96 100644 --- a/LICENSE +++ b/LICENSE @@ -1,28 +1,34 @@ -Copyright (c) 2015, drichmond -All rights reserved. +---------------------------------------------------------------------- +Copyright (c) 2015, The Regents of the University of California All +rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +modification, are permitted provided that the following conditions are +met: -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. -* Neither the name of riffa-stable nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Neither the name of The Regents of the University of California + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL REGENTS OF THE +UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. +---------------------------------------------------------------------- diff --git a/c_c++/linux/x64/README.txt b/c_c++/linux/x64/README.txt new file mode 100644 index 0000000..baeb4fb --- /dev/null +++ b/c_c++/linux/x64/README.txt @@ -0,0 +1,3 @@ +The Linux C/C++ library is compiled and installed with the kernel driver. This +directory contains a sample application subdirectory that you can use to test +your design. diff --git a/c_c++/linux/x64/sample_app/Makefile b/c_c++/linux/x64/sample_app/Makefile new file mode 100644 index 0000000..c326bcf --- /dev/null +++ b/c_c++/linux/x64/sample_app/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/sample_app/README.txt b/c_c++/linux/x64/sample_app/README.txt new file mode 100644 index 0000000..870fd4b --- /dev/null +++ b/c_c++/linux/x64/sample_app/README.txt @@ -0,0 +1,8 @@ +The testutil example application works with the Verilog chnl_tester module +which receives data and then sends data back to the workstation. + +To compile the example application: + +make + +The riffa C/C++ library must be installed (it gets installed with the driver). diff --git a/c_c++/linux/x64/sample_app/testutil.c b/c_c++/linux/x64/sample_app/testutil.c new file mode 100644 index 0000000..abb2442 --- /dev/null +++ b/c_c++/linux/x64/sample_app/testutil.c @@ -0,0 +1,145 @@ +#include +#include +#include "timer.h" +#include "riffa.h" + +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; + unsigned int * sendBuffer; + unsigned int * recvBuffer; + GET_TIME_INIT(3); + + if (argc < 2) { + printf("Usage: %s