Commit 3da020ee authored by Adam Wujek's avatar Adam Wujek 💬

sw:rt: use framework config items via Kconfig

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 67957803
......@@ -8,11 +8,5 @@ EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 1
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 1
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 1
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 1
include $(TRTL_SW)/rt/Makefile
......@@ -11,3 +11,7 @@
# Mock Turtle configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
mainmenu "data_generator demo configuration"
comment "Project specific configuration"
source "Kconfig.mt"
......@@ -10,11 +10,5 @@ EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 1
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 1
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 1
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 1
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 1
include $(TRTL_SW)/rt/Makefile
#
# Automatically generated file; DO NOT EDIT.
# data_generator demo configuration
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE=y
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
mainmenu "hello_world demo configuration"
comment "Project specific configuration"
source "Kconfig.mt"
......@@ -9,11 +9,5 @@ EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 0
include $(TRTL_SW)/rt/Makefile
#
# Automatically generated file; DO NOT EDIT.
# hello_world demo configuration
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN is not set
mainmenu "hello_world_framework demo configuration"
comment "Project specific configuration"
source "Kconfig.mt"
......@@ -8,11 +8,5 @@ EXTRA_CFLAGS += -DFPGA_APPLICATION_ID=0x0
EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 1
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 1
include $(TRTL_SW)/rt/Makefile
#
# Automatically generated file; DO NOT EDIT.
# alarm_clock demo configuration
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE=y
# CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN=y
mainmenu "Profiling 1 demo configuration"
comment "Project specific configuration"
source "Kconfig.mt"
......@@ -12,11 +12,5 @@ EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 0
include $(TRTL_SW)/rt/Makefile
#
# Automatically generated file; DO NOT EDIT.
# Profiling 1 demo configuration
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE is not set
# CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN is not set
mainmenu "alarm_clock demo configuration"
comment "Project specific configuration"
source "Kconfig.mt"
......@@ -12,11 +12,5 @@ EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 0
include $(TRTL_SW)/rt/Makefile
#
# Automatically generated file; DO NOT EDIT.
# alarm_clock demo configuration
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
mainmenu "alarm_clock demo configuration"
comment "Project specific configuration"
source "Kconfig.mt"
......@@ -12,11 +12,5 @@ EXTRA_CFLAGS += -DRT_APPLICATION_ID=0x0
MOCKTURTLE_LIBRARY_PRINT_ENABLE := 1
MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE := 1
# Firmware Libray configuration
MOCKTURTLE_FRAMEWORK_ENABLE := 0
MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE := 0
MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE := 0
MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE := 0
MOCKTURTLE_FRAMEWORK_32BIT_ALIGN := 0
include $(TRTL_SW)/rt/Makefile
#
# Automatically generated file; DO NOT EDIT.
# alarm_clock demo configuration
#
#
# Project specific configuration
#
#
# Mock Turtle configuration
#
# CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE is not set
......@@ -145,7 +145,7 @@ static inline struct trtl_proto_header *rt_proto_header_get(void *raw_msg)
static inline void rt_proto_header_set(void *raw_msg,
struct trtl_proto_header *header)
{
#if MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
#if CONFIG_MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
int i;
for (i = 0; i < sizeof(struct trtl_proto_header) / 4; ++i)
......
......@@ -2,3 +2,16 @@ comment "Mock Turtle configuration"
config MOCKTURTLE_FRAMEWORK_ENABLE
bool "Enable Mock Turtle framework"
config MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
bool "Enable debugging in Mock Turtle framework"
config MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
bool "Enable variable in Mock Turtle framework"
config MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
bool "Enable buffer in Mock Turtle framework"
config MOCKTURTLE_FRAMEWORK_32BIT_ALIGN
bool "Enable 32bit align in Mock Turtle framework"
......@@ -61,21 +61,6 @@ CFLAGS += -DLIB_PRINT_ERROR
endif
endif
ifeq ($(MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE), 1)
CFLAGS += -DMOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
endif
ifeq ($(MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE), 1)
CFLAGS += -DMOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
endif
ifeq ($(MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE), 1)
CFLAGS += -DMOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
endif
ifeq ($(MOCKTURTLE_FRAMEWORK_32BIT_ALIGN), 1)
CFLAGS += -DMOCKTURTLE_FRAMEWORK_32BIT_ALIGN
endif
CFLAGS += $(EXTRA_CFLAGS)
......@@ -89,13 +74,14 @@ OBJS += lib/vsprintf-xint.o
OBJS += lib/printf.o
OBJS += lib/mockturtle-rt-common.o
ifeq ($(MOCKTURTLE_FRAMEWORK_ENABLE), 1)
OBJDIR += framework
OBJS += framework/mockturtle-frm-core.o
OBJS += framework/mockturtle-frm-debug.o
OBJS += framework/mockturtle-frm-action.o
OBJS += framework/mockturtle-frm-mqueue.o
endif
OBJDIR-$(CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE) += framework
OBJS-$(CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE) += framework/mockturtle-frm-core.o
OBJS-$(CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE) += framework/mockturtle-frm-debug.o
OBJS-$(CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE) += framework/mockturtle-frm-action.o
OBJS-$(CONFIG_MOCKTURTLE_FRAMEWORK_ENABLE) += framework/mockturtle-frm-mqueue.o
OBJDIR += $(OBJDIR-y)
OBJS += $(OBJS-y)
OBJS_BUILD = $(addprefix $(BUILDDIR)/, $(OBJS))
......
......@@ -14,6 +14,7 @@
#ifndef __TRTL_FW_FRM_H__
#define __TRTL_FW_FRM_H__
#include <generated/autoconf.h>
#include "mockturtle-rt.h"
#include "mockturtle-frm-action.h"
#include "mockturtle-frm-mqueue.h"
......
......@@ -48,7 +48,7 @@ int rt_version_getter(struct trtl_proto_header *hin, void *pin,
* it overwrite a data structure with the one contained in the input
* payload. If the message is syncrnous it will copy back the data structure.
*/
#ifdef MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
int rt_buffer_setter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
......@@ -97,7 +97,7 @@ int rt_buffer_setter(struct trtl_proto_header *hin, void *pin,
* This is an @ref action_t function type. Accorind the message request,
* it copies one of the declared data structure to the output payload.
*/
#ifdef MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_BUFFER_ENABLE
int rt_buffer_getter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
......@@ -146,7 +146,7 @@ int rt_buffer_getter(struct trtl_proto_header *hin, void *pin,
* it writes a number of declared variables. If the message is synchronous
* it copies back the values in the output payload.
*/
#ifdef MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
int rt_variable_setter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
......@@ -199,7 +199,7 @@ int rt_variable_setter(struct trtl_proto_header *hin, void *pin,
* This is an @ref action_t function type. Accorind the message request,
* it copies a number of declared variables.
*/
#ifdef MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_VARIABLE_ENABLE
int rt_variable_getter(struct trtl_proto_header *hin, void *pin,
struct trtl_proto_header *hout, void *pout)
{
......
......@@ -18,7 +18,7 @@
* @param[in] n_values number of variadic arguments
* @return 0 on success. -1 on error
*/
#ifdef MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
int rt_send_debug(int mq_in, int n_values, ...)
{
va_list ap;
......@@ -62,7 +62,7 @@ int rt_send_debug(int mq_in, int n_values, ...)
* It prints on the serial interface the given message header
* @param[in] h message header to print
*/
#ifdef MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
void rt_print_header(struct trtl_proto_header *h)
{
pr_debug(" app_id 0x%x | msg_id %d | slot_io 0x%x | seq %"PRIu32"d\n\r",
......@@ -85,7 +85,7 @@ void rt_print_header(struct trtl_proto_header *h)
* @param[in] d buffer data
* @param[in] count number of 32bit words to show
*/
#ifdef MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
#ifdef CONFIG_MOCKTURTLE_FRAMEWORK_DEBUG_ENABLE
void rt_print_data(uint32_t *d, unsigned int count)
{
int i;
......
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