Commit 12b0d558 authored by Federico Vaga's avatar Federico Vaga

sw:*: use prefix trtl_fw for firmware related code

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 2d145ffe
......@@ -20,7 +20,7 @@ enum ac_variable {
AC_ALARM_ITER,
};
static struct rt_variable variables[] = {
static struct trtl_fw_variable variables[] = {
[AC_TIME] = {
.addr = (void *)&iteration,
.mask = 0xFFFFFFFF,
......@@ -47,7 +47,7 @@ static struct rt_variable variables[] = {
},
};
static struct rt_application app = {
static struct trtl_fw_application app = {
.name = "alarm-clk",
.version = {
.rt_id = CONFIG_RT_APPLICATION_ID,
......@@ -64,18 +64,18 @@ static void ac_update(void)
{
uint32_t sec, cyc;
rt_get_time(&sec, &cyc);
trtl_fw_time(&sec, &cyc);
if ((--period_c) == 0) {
period_c = period;
trtl_rt_mq_send_uint32(TRTL_HMQ, 0, 0x12, 1,
trtl_fw_mq_send_uint32(TRTL_HMQ, 0, 0x12, 1,
iteration);
pr_debug("Iteration %d\n\r", iteration);
}
if (alarm_enable) {
if (alarm_iter < iteration) {
trtl_rt_mq_send_uint32(TRTL_HMQ, 0, 0x34, 2,
trtl_fw_mq_send_uint32(TRTL_HMQ, 0, 0x34, 2,
iteration, alarm_iter);
alarm_enable = 0;
alarm_iter = 0;
......@@ -100,12 +100,12 @@ static void ac_init(void)
*/
int main()
{
rt_init(&app);
trtl_fw_init(&app);
ac_init();
while (1) {
/* Handle all messages incoming from HMQ 0 as actions */
rt_mq_action_dispatch(TRTL_HMQ, 0);
trtl_fw_mq_action_dispatch(TRTL_HMQ, 0);
ac_update();
}
......
......@@ -26,7 +26,7 @@ enum dg_variable {
DG_PERIOD_UPDATE = 0,
};
static struct rt_variable variables[] = {
static struct trtl_fw_variable variables[] = {
[DG_PERIOD_UPDATE] = {
.addr = (void *)&period,
.mask = 0xFFFFFFFF,
......@@ -40,7 +40,7 @@ enum dg_structures {
DG_CONF,
};
struct rt_buffer buffers[] = {
struct trtl_fw_buffer buffers[] = {
[DG_DATA] = {
.buf = dg_data,
.len = sizeof(dg_data),
......@@ -51,7 +51,7 @@ struct rt_buffer buffers[] = {
},
};
static struct rt_application app = {
static struct trtl_fw_application app = {
.name = "data-gen",
.version = {
.rt_id = CONFIG_RT_APPLICATION_ID,
......@@ -113,12 +113,12 @@ static void dg_init(void)
*/
int main()
{
rt_init(&app);
trtl_fw_init(&app);
dg_init();
while (1) {
/* Handle all messages incoming from HMQ 0 as actions */
rt_mq_action_dispatch(TRTL_HMQ, 0);
trtl_fw_mq_action_dispatch(TRTL_HMQ, 0);
dg_update();
}
......
......@@ -17,14 +17,14 @@
static struct svec_structure svec_struct;
struct rt_buffer svec_buffers[] = {
struct trtl_fw_buffer svec_buffers[] = {
[SVEC_BUF_TEST] = {
.buf = &svec_struct,
.len = sizeof(struct svec_structure),
}
};
struct rt_variable svec_variables[] = {
struct trtl_fw_variable svec_variables[] = {
[SVEC_VAR_LEMO_STA] = {
.addr = TRTL_ADDR_DP(GPIO_PSR),
.mask = PIN_LEMO_MASK,
......@@ -68,7 +68,7 @@ struct rt_variable svec_variables[] = {
};
struct rt_application app = {
struct trtl_fw_application app = {
.name = "svec-svec",
.version = {
.rt_id = RT_APPLICATION_ID,
......@@ -99,12 +99,12 @@ static void svec_debug_interface(void)
*/
int main()
{
rt_init(&app);
trtl_fw_init(&app);
svec_debug_interface();
while (1) {
/* Handle all messages incoming from HMQ 0 as actions */
rt_mq_action_dispatch(TRTL_HMQ, 0);
trtl_fw_mq_action_dispatch(TRTL_HMQ, 0);
}
return 0;
......
......@@ -18,7 +18,7 @@
#define SVEC_HMQ_OUT 0
/* Variable index - used only by svec-librt */
enum rt_variable_index {
enum trtl_fw_variable_index {
SVEC_VAR_LEMO_STA = 0,
SVEC_VAR_LEMO_DIR,
SVEC_VAR_LEMO_SET,
......@@ -30,7 +30,7 @@ enum rt_variable_index {
__SVEC_VAR_MAX,
};
enum rt_buffer_index {
enum trtl_fw_buffer_index {
SVEC_BUF_TEST = 0,
__SVEC_BUF_MAX,
};
......
......@@ -132,7 +132,7 @@ int svec_lemo_dir_set(struct svec_node *dev, uint32_t value)
struct svec_desc *svec = (struct svec_desc *)dev;
uint32_t fields[] = {SVEC_VAR_LEMO_DIR, value};
return trtl_rt_variable_set(svec->trtl,
return trtl_fw_variable_set(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
fields, 1);
}
......@@ -143,7 +143,7 @@ int svec_lemo_set(struct svec_node *dev, uint32_t value)
uint32_t fields[] = {SVEC_VAR_LEMO_SET, value,
SVEC_VAR_LEMO_CLR, ~value};
return trtl_rt_variable_set(svec->trtl,
return trtl_fw_variable_set(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
fields, 2);
}
......@@ -185,7 +185,7 @@ int svec_led_set(struct svec_node *dev, uint32_t value, enum svec_color color)
uint32_t fields[] = {SVEC_VAR_LED_SET, real_value,
SVEC_VAR_LED_CLR, ~real_value};
return trtl_rt_variable_set(svec->trtl,
return trtl_fw_variable_set(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
fields, 2);
}
......@@ -202,7 +202,7 @@ int svec_status_get(struct svec_node *dev, struct svec_status *status)
SVEC_VAR_LEMO_DIR, 0};
int err;
err = trtl_rt_variable_get(svec->trtl,
err = trtl_fw_variable_get(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
fields, 3);
if (err)
......@@ -220,16 +220,16 @@ int svec_run_autosvec(struct svec_node *dev, uint32_t run)
struct svec_desc *svec = (struct svec_desc *)dev;
uint32_t fields[] = {SVEC_VAR_AUTO, run};
return trtl_rt_variable_set(svec->trtl,
return trtl_fw_variable_set(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
fields, 1);
}
int svec_version(struct svec_node *dev, struct trtl_rt_version *version)
int svec_version(struct svec_node *dev, struct trtl_fw_version *version)
{
struct svec_desc *svec = (struct svec_desc *)dev;
return trtl_rt_version_get(svec->trtl,
return trtl_fw_version_get(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
version);
}
......@@ -243,7 +243,7 @@ int svec_test_struct_get(struct svec_node *dev, struct svec_structure *test)
.buf = test,
};
return trtl_rt_buffer_get(svec->trtl,
return trtl_fw_buffer_get(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
&tlv, 1);
}
......@@ -257,7 +257,7 @@ int svec_test_struct_set(struct svec_node *dev, struct svec_structure *test)
.buf = test,
};
return trtl_rt_buffer_set(svec->trtl,
return trtl_fw_buffer_set(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
&tlv, 1);
}
......@@ -56,7 +56,7 @@ extern int svec_lemo_set(struct svec_node *dev, uint32_t value);
extern int svec_lemo_dir_set(struct svec_node *dev, uint32_t value);
extern int svec_status_get(struct svec_node *dev, struct svec_status *status);
extern int svec_run_autosvec(struct svec_node *dev, uint32_t run);
extern int svec_version(struct svec_node *dev, struct trtl_rt_version *version);
extern int svec_version(struct svec_node *dev, struct trtl_fw_version *version);
extern int svec_test_struct_set(struct svec_node *dev,
struct svec_structure *test);
extern int svec_test_struct_get(struct svec_node *dev,
......
......@@ -40,7 +40,7 @@ static void svec_print_status(struct svec_status *status)
fprintf(stdout, "\tautosvec\t%s\n", status->autosvec ? "run" : "stop");
}
static void svec_print_version(struct trtl_rt_version *version)
static void svec_print_version(struct trtl_fw_version *version)
{
fprintf(stdout, "Version:\n");
fprintf(stdout, "\tRT: 0x%x\n", version->rt_id);
......@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
char c, c_color = 0, autosvec = 0;
int err = 0, show_status = 0, show_version = 0, structure = 0;
enum svec_color color = SVEC_RED;
struct trtl_rt_version version;
struct trtl_fw_version version;
struct svec_structure test, test_rb;
while ((c = getopt (argc, argv, "hD:l:L:d:c:sa:vt")) != -1) {
......
......@@ -6,7 +6,7 @@
#include <mockturtle-framework.h>
static struct rt_application app = {
static struct trtl_fw_application app = {
.name = "hellofrm",
.version = {
.rt_id = CONFIG_RT_APPLICATION_ID,
......@@ -20,14 +20,14 @@ static struct rt_application app = {
*/
int main()
{
rt_init(&app);
trtl_fw_init(&app);
while (1) {
/*
* Handle all messages incoming from slot 0
* as actions
*/
rt_mq_action_dispatch(TRTL_HMQ, 0);
trtl_fw_mq_action_dispatch(TRTL_HMQ, 0);
}
return 0;
......
......@@ -104,7 +104,7 @@ struct trtl_hmq_header {
/**
* It describes the version running on the embedded CPU
*/
struct trtl_rt_version {
struct trtl_fw_version {
uint32_t rt_id; /**< RT application identifier */
uint32_t rt_version; /**< RT application version*/
uint32_t git_version; /**< git commit SHA1 of the compilation time */
......
......@@ -238,15 +238,15 @@ class TrtlDevice(object):
self.libtrtl.trtl_hmq_flush.restype = c_int
self.libtrtl.trtl_hmq_flush.errcheck = self.errcheck
# FW PING
self.libtrtl.trtl_rt_ping.argtypes = [c_void_p, c_uint, c_uint]
self.libtrtl.trtl_rt_ping.restype = c_int
self.libtrtl.trtl_rt_ping.errcheck = self.__errcheck_int
self.libtrtl.trtl_fw_ping.argtypes = [c_void_p, c_uint, c_uint]
self.libtrtl.trtl_fw_ping.restype = c_int
self.libtrtl.trtl_fw_ping.errcheck = self.__errcheck_int
# FW VERSION
self.libtrtl.trtl_rt_version.argtypes = [c_void_p, c_uint, c_uint,
self.libtrtl.trtl_fw_version.argtypes = [c_void_p, c_uint, c_uint,
POINTER(TrtlFirmwareVersion),
]
self.libtrtl.trtl_rt_version.restype = c_int
self.libtrtl.trtl_rt_version.errcheck = self.__errcheck_int
self.libtrtl.trtl_fw_version.restype = c_int
self.libtrtl.trtl_fw_version.errcheck = self.__errcheck_int
# self.libtrtl.trtl_hmq_filter_add.argtypes = [c_void_p]
# self.libtrtl.trtl_hmq_filter_clean.argtypes = [c_void_p]
# # Return
......@@ -348,13 +348,13 @@ class TrtlCpu(object):
It pings the firmware running on the CPU
@return True if the firmware is alive, False otherwise
"""
val = self.libtrtl.trtl_rt_ping(self.trtl_dev.tkn,
val = self.libtrtl.trtl_fw_ping(self.trtl_dev.tkn,
self.idx_cpu, idx_hmq)
return True if val == 0 else False
def version(self):
version = TrtlFirmwareVersion()
self.libtrtl.trtl_rt_version(self.trtl_dev.tkn,
self.libtrtl.trtl_fw_version(self.trtl_dev.tkn,
self.idx_cpu, idx_hmq,
pointer(version))
return version
......
......@@ -20,10 +20,10 @@
* @param[out] version RT id, RT and GIT version
* @return 0 on success, -1 on error and errno is set appropriately
*/
int trtl_rt_version(struct trtl_dev *trtl,
int trtl_fw_version(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
struct trtl_rt_version *version)
struct trtl_fw_version *version)
{
struct trtl_msg msg;
int err;
......@@ -47,7 +47,7 @@ int trtl_rt_version(struct trtl_dev *trtl,
* @param[in] idx_hmq which HMQ
* @return 0 on success, -1 on error and errno is set appropriately
*/
int trtl_rt_ping(struct trtl_dev *trtl,
int trtl_fw_ping(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq)
{
......@@ -99,7 +99,7 @@ int trtl_rt_ping(struct trtl_dev *trtl,
* the number of indexes you have in the 'variables' fields
* @return 0 on success, -1 on error and errno is appropriately set.
*/
int trtl_rt_variable_set(struct trtl_dev *trtl,
int trtl_fw_variable_set(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
uint32_t *variables,
......@@ -155,7 +155,7 @@ int trtl_rt_variable_set(struct trtl_dev *trtl,
* the number of indexes you have in the 'variables' fields
* @return 0 on success, -1 on error and errno is appropriately set.
*/
int trtl_rt_variable_get(struct trtl_dev *trtl,
int trtl_fw_variable_get(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
uint32_t *variables,
......@@ -193,7 +193,7 @@ int trtl_rt_variable_get(struct trtl_dev *trtl,
* @param[in|out] tlv structures to get on input, structures values on output
* @param[in] n_tlv number of tlv structures
*/
int trtl_rt_buffer_set(struct trtl_dev *trtl,
int trtl_fw_buffer_set(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
struct trtl_tlv *tlv,
......@@ -244,7 +244,7 @@ int trtl_rt_buffer_set(struct trtl_dev *trtl,
* @param[in|out] tlv structures to get on input, structures values on output
* @param[in] n_tlv number of tlv structures
*/
int trtl_rt_buffer_get(struct trtl_dev *trtl,
int trtl_fw_buffer_get(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
struct trtl_tlv *tlv,
......@@ -332,7 +332,7 @@ void trtl_print_payload(struct trtl_msg *msg)
fprintf(stdout, "Ping message\n");
break;
case TRTL_MSG_ID_VER: {
struct trtl_rt_version *v = (struct trtl_rt_version *)msg->data;
struct trtl_fw_version *v = (struct trtl_fw_version *)msg->data;
fprintf(stdout, "Version message\n");
fprintf(stdout, "Firmware ID: 0x%08"PRIx32"\n", v->rt_id);
fprintf(stdout, "Firmware version: %d.%d\n",
......
......@@ -218,27 +218,27 @@ extern int trtl_smem_write(struct trtl_dev *trtl, uint32_t addr, uint32_t *data,
* Message builders for RT service messages
* @{
*/
extern int trtl_rt_version(struct trtl_dev *trtl,
extern int trtl_fw_version(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
struct trtl_rt_version *version);
extern int trtl_rt_ping(struct trtl_dev *trtl,
struct trtl_fw_version *version);
extern int trtl_fw_ping(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq);
extern int trtl_rt_variable_set(struct trtl_dev *trtl,
extern int trtl_fw_variable_set(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
uint32_t *var, unsigned int n_var);
extern int trtl_rt_variable_get(struct trtl_dev *trtl,
extern int trtl_fw_variable_get(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
uint32_t *var, unsigned int n_var);
extern int trtl_rt_buffer_set(struct trtl_dev *trtl,
extern int trtl_fw_buffer_set(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
struct trtl_tlv *tlv,
unsigned int n_tlv);
extern int trtl_rt_buffer_get(struct trtl_dev *trtl,
extern int trtl_fw_buffer_get(struct trtl_dev *trtl,
unsigned int idx_cpu,
unsigned int idx_hmq,
struct trtl_tlv *tlv,
......
......@@ -27,18 +27,18 @@
* On error the message will be sent anyway to the host. This
* is just in case of future development.
*/
typedef int (action_t)(struct trtl_msg *msg_i, struct trtl_msg *msg_o);
typedef int (trtl_fw_action_t)(struct trtl_msg *msg_i, struct trtl_msg *msg_o);
/**
* Variable flag. Register
*/
#define TRTL_RT_VARIABLE_FLAG_FLD (1 << 0)
#define TRTL_FW_VARIABLE_FLAG_FLD (1 << 0)
/**
* Description of a variable that we want to export to the external
* world (host or network).
*/
struct rt_variable {
struct trtl_fw_variable {
void *addr; /**< variable address */
uint32_t mask; /**< variable mask without offset applied */
uint8_t offset; /**< variable offset within the word */
......@@ -50,7 +50,7 @@ struct rt_variable {
* Description of a buffer that we want to export to the external world
* (host or network)
*/
struct rt_buffer {
struct trtl_fw_buffer {
void *buf; /**< structure location */
uint32_t len; /**< data structure lenght */
/* Maybe other option later in time */
......@@ -60,21 +60,21 @@ struct rt_buffer {
/**
* Real-Time Application Descriptor
*/
struct rt_application {
struct trtl_fw_application {
const char name[16]; /**< Firmware name*/
const uint32_t *fpga_id_compat; /**< list of compatible FPGA
application ID */
const unsigned int fpga_id_compat_n; /**< number of entry in
the fpga_id_compat list */
const struct trtl_rt_version version; /**< version running */
const struct trtl_fw_version version; /**< version running */
struct rt_buffer *buffers; /**< exported buffers */
struct trtl_fw_buffer *buffers; /**< exported buffers */
unsigned int n_buffers; /**< number or exported buffers */
struct rt_variable *variables; /**< exported variables */
struct trtl_fw_variable *variables; /**< exported variables */
unsigned int n_variables; /**< number or exported variables */
action_t **actions; /**< list of custum actions */
trtl_fw_action_t **actions; /**< list of custum actions */
unsigned int n_actions; /**< number of custum actions */
unsigned int seq; /** sequence number reference */
......@@ -82,26 +82,26 @@ struct rt_application {
};
extern struct rt_application *_app;
extern struct trtl_fw_application *_app;
extern int rt_init(struct rt_application *app);
extern void rt_get_time(uint32_t *seconds, uint32_t *cycles);
extern void rt_print_header(struct trtl_hmq_header *h);
extern void rt_print_data(uint32_t *d, unsigned int count);
extern void rt_print_message(struct trtl_msg *msg);
extern int trtl_rt_mq_send_uint32(enum trtl_mq_type type,
extern int trtl_fw_init(struct trtl_fw_application *app);
extern void trtl_fw_time(uint32_t *seconds, uint32_t *cycles);
extern void trtl_fw_print_header(struct trtl_hmq_header *h);
extern void trtl_fw_print_data(uint32_t *d, unsigned int count);
extern void trtl_fw_print_message(struct trtl_msg *msg);
extern int trtl_fw_mq_send_uint32(enum trtl_mq_type type,
unsigned int idx_mq,
uint8_t msg_id,
unsigned int n,
...);
extern int trtl_rt_mq_send_buf(enum trtl_mq_type type,
extern int trtl_fw_mq_send_buf(enum trtl_mq_type type,
unsigned int idx_mq,
uint8_t msg_id,
unsigned int n,
void *data);
extern int rt_mq_action_dispatch(enum trtl_mq_type type,
extern int trtl_fw_mq_action_dispatch(enum trtl_mq_type type,
unsigned int idx_mq);
extern void rt_message_error(struct trtl_msg *msg, int err);
extern void trtl_fw_message_error(struct trtl_msg *msg, int err);
#endif
/**@}*/
......@@ -10,8 +10,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef __TRTL_RT_MQUEUE_H
#define __TRTL_RT_MQUEUE_H
#ifndef __TRTL_FW_MQUEUE_H
#define __TRTL_FW_MQUEUE_H
#include <hw/mockturtle_addresses.h>
#include <hw/mockturtle_queue.h>
......
......@@ -10,8 +10,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef __TRTL_RT_PP_PRINTF_H
#define __TRTL_RT_PP_PRINTF_H
#ifndef __TRTL_FW_PP_PRINTF_H
#define __TRTL_FW_PP_PRINTF_H
#include <stdarg.h>
#include <generated/autoconf.h>
......
......@@ -10,8 +10,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
#ifndef __TRTL_RT_SMEM_H
#define __TRTL_RT_SMEM_H
#ifndef __TRTL_FW_SMEM_H
#define __TRTL_FW_SMEM_H
/**
......
......@@ -174,7 +174,7 @@ int main(int argc, char *argv[])
switch (mode) {
case OP_READ:
err = trtl_rt_buffer_get(trtl, idx_cpu, idx_hmq, tlv, n_tlv);
err = trtl_fw_buffer_get(trtl, idx_cpu, idx_hmq, tlv, n_tlv);
if (err) {
fprintf(stderr, "Cannot read buffer: %s\n",
trtl_strerror(errno));
......@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
/* trtl_print_payload(&hdr, tlv); */
break;
case OP_WRITE:
err = trtl_rt_buffer_set(trtl, idx_cpu, idx_hmq, tlv, n_tlv);
err = trtl_fw_buffer_set(trtl, idx_cpu, idx_hmq, tlv, n_tlv);
break;
}
......
......@@ -44,7 +44,7 @@ static void help(char *name)
* It prints the given Mock Turtle firmware version
* @param[in] v version to print
*/
static void trtl_ping_version_print(struct trtl_rt_version *v)
static void trtl_ping_version_print(struct trtl_fw_version *v)
{
fprintf(stdout, "\tFirmware Version:\n");
fprintf(stdout, "\t application_id: 0x%08X\n",
......@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
{
struct trtl_dev *trtl;
uint32_t dev_id = 0, n = 1;
struct trtl_rt_version version;
struct trtl_fw_version version;
uint64_t period = 0;
int err, f_version = 0, idx_cpu = 0, idx_hmq = 0;
char c;
......@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
usleep(period);
/* Try to ping */
err = trtl_rt_ping(trtl, idx_cpu, idx_hmq);
err = trtl_fw_ping(trtl, idx_cpu, idx_hmq);
if (err) {
fprintf(stderr,
"Ping failed on Device 0x%x CPU %d HMQ %d: %s\n",
......@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
/* Get the version */
if (f_version) {
trtl_rt_version(trtl, idx_cpu, idx_hmq, &version);
trtl_fw_version(trtl, idx_cpu, idx_hmq, &version);
trtl_ping_version_print(&version);
}
......
......@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
switch (mode) {
case OP_READ:
err = trtl_rt_variable_get(trtl, idx_cpu, idx_hmq, var, n_var);
err = trtl_fw_variable_get(trtl, idx_cpu, idx_hmq, var, n_var);
if (err) {
fprintf(stderr, "Cannot read variables: %s\n",
trtl_strerror(errno));
......@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
}
break;
case OP_WRITE:
err = trtl_rt_variable_set(trtl, idx_cpu, idx_hmq, var, n_var);
err = trtl_fw_variable_set(trtl, idx_cpu, idx_hmq, var, n_var);
if (err) {
fprintf(stderr, "Cannot write variables: %s\n",
trtl_strerror(errno));
......
......@@ -25,7 +25,7 @@ static struct rt_mq mq[] = {
};
static struct rt_variable variables[] = {
static struct trtl_fw_variable variables[] = {
/* put here variables that you want to share */
};
......@@ -33,17 +33,17 @@ static struct rt_structure structures[] = {
/* put here data structures that you want to share */
};
static action_t *actions[] = {
static trtl_fw_action_t *actions[] = {
[RT_ACTION_RECV_PING] = rt_recv_ping,
[RT_ACTION_RECV_VERSION] = rt_version_getter,
[RT_ACTION_RECV_FIELD_SET] = rt_variable_setter,
[RT_ACTION_RECV_FIELD_GET] = rt_variable_getter,
[RT_ACTION_RECV_FIELD_SET] = trtl_fw_variable_setter,
[RT_ACTION_RECV_FIELD_GET] = trtl_fw_variable_getter,
[RT_ACTION_RECV_STRUCT_SET] = rt_structure_setter,
[RT_ACTION_RECV_STRUCT_GET] = rt_structure_getter,
/* Add your actions here */
};
struct rt_application app = {
struct trtl_fw_application app = {
.name = "{{short_name}}",
.version = {
.fpga_id = FPGA_APPLICATION_ID,
......@@ -69,7 +69,7 @@ struct rt_application app = {
*/
int main()
{
rt_init(&app);
trtl_fw_init(&app);
while (1) {
/*
......@@ -77,7 +77,7 @@ int main()
* {{short_name_capital}}_CMD_IN
* as actions
*/
rt_mq_action_dispatch({{short_name_capital}}_CMD_IN);
trtl_fw_mq_action_dispatch({{short_name_capital}}_CMD_IN);
}
return 0;
......
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