Commit 4087088e authored by Jens Korinth's avatar Jens Korinth

Closes #79 - Rename platform_api.h to platform.h

* suffix `_api` is unusual, removed
* fixed all includes
parent 2a8a3af7
......@@ -23,7 +23,7 @@
//!
#include <assert.h>
#include <tapasco_address_map.h>
#include <platform_api.h>
#include <platform.h>
#define TAPASCO_MAX_INSTANCES 128
......
......@@ -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. */
......
......@@ -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
......
......@@ -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 {
......
......@@ -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,
......
......@@ -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>
......
......@@ -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,
......
......@@ -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;
......
......@@ -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"
......
......@@ -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
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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 : */
......@@ -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
......
......@@ -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()
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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))
......
......@@ -32,7 +32,7 @@
#include <string.h>
#include <errno.h>
#include <platform_api.h>
#include <platform.h>
#include "common.h"
#define LOWER_BND (2)
......
......@@ -35,7 +35,7 @@ extern "C" {
}
#include "platform_errors.h"
#include "platform_api.h"
#include "platform.h"
#include "buddy_allocator.hpp"
#ifdef __cplusplus
......
......@@ -21,7 +21,7 @@
* @brief Implementation for platform API address calls.
* @author J. Korinth, TU Darmstadt (jk@esa.cs.tu-darmstadt.de)
**/
#include <platform_api.h>
#include <platform.h>
platform_ctl_addr_t platform_address_get_slot_base(
platform_slot_id_t const slot_id,
......
......@@ -21,7 +21,7 @@
//! loadable kernel module. Communicates with the Zynq fabric via
//! device driver.
//! @authors J. Korinth, TU Darmstadt (jk@esa.cs.tu-darmstadt.de)
//! @version 1.1
//! @version 1.2
//! @copyright Copyright 2014, 2015 J. Korinth
//!
//! This file is part of Tapasco (TPC).
......@@ -54,7 +54,7 @@
#include <assert.h>
#include <module/zynq_platform.h>
#include <module/zynq_ioctl_cmds.h>
#include <platform_api.h>
#include <platform.h>
#include <platform_errors.h>
#include "platform_logging.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment