Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
4087088e
Commit
4087088e
authored
May 30, 2017
by
Jens Korinth
Browse files
Closes
#79
- Rename platform_api.h to platform.h
* suffix `_api` is unusual, removed * fixed all includes
parent
2a8a3af7
Changes
23
Hide whitespace changes
Inline
Side-by-side
arch/baseline/src/tapasco_address_map.c
View file @
4087088e
...
...
@@ -23,7 +23,7 @@
//!
#include <assert.h>
#include <tapasco_address_map.h>
#include <platform
_api
.h>
#include <platform.h>
#define TAPASCO_MAX_INSTANCES 128
...
...
arch/baseline/src/tapasco_device.c
View file @
4087088e
...
...
@@ -29,7 +29,7 @@
#include <tapasco_address_map.h>
#include <tapasco_scheduler.h>
#include <tapasco_logging.h>
#include <platform
_api
.h>
#include <platform.h>
#include <platform_errors.h>
/** Internal device struct implementation. */
...
...
arch/baseline/src/tapasco_init.c
View file @
4087088e
...
...
@@ -29,7 +29,7 @@
#include <tapasco_jobs.h>
#include <tapasco_functions.h>
#include <tapasco_logging.h>
#include <platform
_api
.h>
#include <platform.h>
#include <platform_errors.h>
// declare logging exit for flushing
...
...
arch/common/src/tapasco_functions.c
View file @
4087088e
...
...
@@ -30,7 +30,7 @@
#include <tapasco_address_map.h>
#include <tapasco_logging.h>
#include <tapasco_status.h>
#include <platform
_api
.h>
#include <platform.h>
/** State of functions, e.g., busy or idle. */
typedef
enum
{
...
...
arch/common/src/tapasco_scheduler.c
View file @
4087088e
...
...
@@ -27,7 +27,7 @@
#include <tapasco_address_map.h>
#include <tapasco_device.h>
#include <tapasco_logging.h>
#include <platform
_api
.h>
#include <platform.h>
tapasco_res_t
tapasco_scheduler_launch
(
tapasco_dev_ctx_t
*
dev_ctx
,
...
...
arch/common/src/tapasco_status.c
View file @
4087088e
...
...
@@ -28,7 +28,7 @@
#include <stdint.h>
#include <string.h>
#endif
#include <platform
_api
.h>
#include <platform.h>
#include <tapasco_status.h>
#include <tapasco_logging.h>
#include <tapasco_errors.h>
...
...
arch/common/tests/platform_dummy.c
View file @
4087088e
...
...
@@ -21,7 +21,7 @@
//! errors.
//! @authors J. Korinth, TU Darmstadt (jk@esa.cs.tu-darmstadt.de)
//!
#include <platform
_api
.h>
#include <platform.h>
platform_res_t
platform_read_mem
(
platform_mem_addr_t
const
start_addr
,
...
...
arch/tests/debug-screens/TapascoStatusScreen.hpp
View file @
4087088e
...
...
@@ -7,7 +7,7 @@
#define __TAPASCO_STATUS_SCREEN_HPP__
#include <tapasco_api.hpp>
#include <platform
_api
.h>
#include <platform.h>
#include "MenuScreen.hpp"
using
namespace
tapasco
;
...
...
arch/tests/tapasco_benchmark.cpp
View file @
4087088e
...
...
@@ -14,7 +14,7 @@
#include <vector>
#include <sys/utsname.h>
#include <tapasco_api.hpp>
#include <platform
_api
.h>
#include <platform.h>
#include "CumulativeAverage.hpp"
#include "TransferSpeed.hpp"
#include "InterruptLatency.hpp"
...
...
examples/benchmark-latency/CMakeLists.txt
View file @
4087088e
...
...
@@ -4,11 +4,11 @@ set (CMAKE_INSTALL_PREFIX "..")
include
(
../examples.cmake
)
add_executable
(
benchmark-latency benchmark-latency.c
)
target_link_libraries
(
benchmark-latency rt pthread tapasco platform
)
target_link_libraries
(
benchmark-latency rt pthread tapasco platform
atomic
)
set_target_properties
(
benchmark-latency PROPERTIES COMPILE_FLAGS
"-Wall -Werror -std=gnu99 -Wno-unused-function"
)
add_executable
(
benchmark-latency++ benchmark-latency.cpp
)
target_link_libraries
(
benchmark-latency++ m pthread atomic tapasco platform
)
target_link_libraries
(
benchmark-latency++ m pthread atomic tapasco platform
atomic
)
set_target_properties
(
benchmark-latency++ PROPERTIES COMPILE_FLAGS
"-Wall -Werror -std=c++11 -Wno-unused-function -static-libstdc++ -flto"
)
install
(
TARGETS benchmark-latency
...
...
examples/benchmark-latency/benchmark-latency.c
View file @
4087088e
...
...
@@ -23,7 +23,7 @@
#include <fcntl.h>
#include <errno.h>
#include <tapasco_api.h>
#include <platform
_api
.h>
#include <platform.h>
#include "../benchmark-mem/timer.h"
#define MIN_NSECS (10000)
...
...
examples/benchmark-latency/benchmark-latency.cpp
View file @
4087088e
...
...
@@ -27,7 +27,7 @@
#include <unistd.h>
#include <cassert>
#include <tapasco_api.hpp>
#include <platform
_api
.h>
#include <platform.h>
#define MIN_NSECS (10000)
#define MAX_NSECS (1000000)
...
...
@@ -35,7 +35,6 @@
#define JOBS (10)
using
namespace
std
;
using
namespace
tapasco
;
using
namespace
tapasco
::
platform
;
struct
config_t
{
...
...
@@ -47,11 +46,11 @@ struct config_t {
static
long
errors
;
static
Tapasco
Tapasco
;
static
tapasco
::
Tapasco
Tapasco
;
static
inline
void
check_tapasco
(
tapasco_res_t
const
result
)
static
inline
void
check_tapasco
(
tapasco
::
tapasco
_res_t
const
result
)
{
if
(
result
!=
TAPASCO_SUCCESS
)
{
if
(
result
!=
tapasco
::
TAPASCO_SUCCESS
)
{
cerr
<<
"Tapasco fatal error: "
<<
tapasco_strerror
(
result
)
<<
endl
;
exit
(
result
);
}
...
...
@@ -90,7 +89,7 @@ static inline unsigned long cd_to_ns(unsigned long cd) {
static
inline
uint32_t
tapasco_run
(
uint32_t
cc
)
{
uint32_t
ret
=
0
;
if
(
Tapasco
.
launch
_no_thread
(
14
,
ret
,
cc
)
!=
TAPASCO_SUCCESS
)
if
(
Tapasco
.
launch
(
14
,
ret
,
cc
)
!=
tapasco
::
TAPASCO_SUCCESS
)
__atomic_fetch_add
(
&
errors
,
1
,
__ATOMIC_SEQ_CST
);
return
ret
;
}
...
...
platform/common/include/platform
_api
.h
→
platform/common/include/platform.h
View file @
4087088e
...
...
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with Tapasco. If not, see <http://www.gnu.org/licenses/>.
//
/** @file platform
_api
.h
/** @file platform.h
* @brief API for low-level FPGA integration. Provides basic methods to
* interact with two different address spaces on the device: The
* memory address space refers to device-local memories, the
...
...
@@ -45,6 +45,8 @@
* License along with Tapasco. If not, see
* <http://www.gnu.org/licenses/>.
* @details ### Change Log ###
* - **05/2017: Version 1.2.2
* + renamed to platform.h
* - **02/2016: Version 1.2.1 (jk)**
* + added special address for the interrupt controllers, so that
* they can be accessed in a standard way using Platform API
...
...
@@ -58,8 +60,8 @@
* - **10/2014: Version 1.0 (jk)**
* + initial prototype version
**/
#ifndef
__
PLATFORM_API_H__
#define
__
PLATFORM_API_H__
#ifndef PLATFORM_API_H__
#define PLATFORM_API_H__
#include <platform_errors.h>
...
...
@@ -138,7 +140,7 @@ typedef enum {
* @{
**/
#define PLATFORM_API_VERSION "1.2.
1
"
#define PLATFORM_API_VERSION "1.2.
2
"
/**
* Returns the version string of the library.
...
...
@@ -350,5 +352,5 @@ extern platform_res_t platform_wait_cycles(const int cycles);
}
/* extern "C" */
}
/* namespace platform */
}
/* namespace tapasco */
#endif
#endif
/*
__
PLATFORM_API_H__ */
#endif
/* PLATFORM_API_H__ */
/* vim: set foldmarker=@{,@} foldlevel=0 foldmethod=marker : */
platform/common/src/platform_errors.c
View file @
4087088e
...
...
@@ -20,7 +20,7 @@
//! @brief Error messages and codes.
//! @authors J. Korinth (jk@esa.cs.tu-darmstadt.de)
//!
#include <platform
_api
.h>
#include <platform.h>
#include <platform_errors.h>
#ifdef _X
...
...
platform/common/src/platform_version.c
View file @
4087088e
...
...
@@ -22,7 +22,7 @@
* @author J. Korinth, TU Darmstadt (jk@esa.cs.tu-darmstadt.de)
**/
#include <string.h>
#include <platform
_api
.h>
#include <platform.h>
#include <platform_errors.h>
const
char
*
const
platform_version
()
...
...
platform/tests/CMakeLists.txt
View file @
4087088e
...
...
@@ -3,6 +3,7 @@ project(libplatform-tests)
set
(
CMAKE_INSTALL_PREFIX
".."
)
set
(
CMAKE_SKIP_RPATH true
)
set
(
CMAKE_C_FLAGS_RELEASE
"-DNDEBUG -O3 -flto"
)
set
(
ADD_LIBS
""
)
if
(
"$ENV{TAPASCO_HOME}"
STREQUAL
""
)
message
(
FATAL_ERROR
"Please set env var TAPASCO_HOME to root directory of Tapasco."
)
...
...
@@ -11,6 +12,7 @@ endif ("$ENV{TAPASCO_HOME}" STREQUAL "")
if
(
"$ENV{TAPASCO_PLATFORM}"
STREQUAL
"VC709"
)
message
(
STATUS
"Building for VC709 platform ..."
)
set
(
CFLAGS
"-g -Wall -Werror -std=gnu99 -DVC709"
)
set
(
ADD_LIBS
"stdc++"
)
else
(
"$ENV{TAPASCO_PLATFORM}"
STREQUAL
"VC709"
)
message
(
STATUS
"Building for Zynq platform ..."
)
set
(
CFLAGS
"-g -Wall -Werror -std=gnu99"
)
...
...
@@ -24,13 +26,13 @@ include_directories(${TAPASCO_HOME}/platform/common/include)
link_directories
(
${
TAPASCO_HOME
}
/platform/lib/
${
ARCH
}
/static
)
add_executable
(
platform-stress-alloc platform_stress_alloc.c
)
target_link_libraries
(
platform-stress-alloc m pthread platform atomic
)
target_link_libraries
(
platform-stress-alloc m pthread platform atomic
${
ADD_LIBS
}
)
add_executable
(
platform-slots platform_slots.c
)
target_link_libraries
(
platform-slots pthread platform atomic
)
target_link_libraries
(
platform-slots pthread platform atomic
${
ADD_LIBS
}
)
add_executable
(
iplatform iplatform.c
)
target_link_libraries
(
iplatform pthread platform ncurses atomic
)
target_link_libraries
(
iplatform pthread platform ncurses atomic
${
ADD_LIBS
}
)
set_target_properties
(
platform-stress-alloc platform-slots iplatform PROPERTIES COMPILE_FLAGS
${
CFLAGS
}
)
install
(
TARGETS platform-stress-alloc platform-slots
...
...
platform/tests/common.h
View file @
4087088e
...
...
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <platform_errors.h>
#include <platform
_api
.h>
#include <platform.h>
static
inline
int
check
(
platform_res_t
res
)
{
...
...
platform/tests/iplatform.c
View file @
4087088e
...
...
@@ -34,7 +34,7 @@
#include <ncurses.h>
#include <sys/ioctl.h>
#include <sched.h>
#include <platform
_api
.h>
#include <platform.h>
static
long
thrdcnt
=
0
;
static
volatile
int
stop
=
0
;
...
...
platform/tests/platform_slots.c
View file @
4087088e
...
...
@@ -28,7 +28,7 @@
#include <stdint.h>
#include <errno.h>
#include <platform
_api
.h>
#include <platform.h>
#include "common.h"
#define SLOTS_BASE (platform_address_get_slot_base(0,0))
...
...
platform/tests/platform_stress_alloc.c
View file @
4087088e
...
...
@@ -32,7 +32,7 @@
#include <string.h>
#include <errno.h>
#include <platform
_api
.h>
#include <platform.h>
#include "common.h"
#define LOWER_BND (2)
...
...
Prev
1
2
Next
Jens Korinth
@jk
mentioned in commit
a831b501
·
Jul 14, 2017
mentioned in commit
a831b501
mentioned in commit a831b5015df6bd8f8d23ddd334a3b1159392de92
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment