Commit 05f17114 authored by Federico Vaga's avatar Federico Vaga

global compilation fixes (sorry)

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 5136d4ad
......@@ -4,7 +4,6 @@
* License: GPLv3
*/
#include <mockturtle-rt-smem.h>
#include <mockturtle-framework.h>
static unsigned int iteration;
......
......@@ -5,7 +5,7 @@
#ifndef __FW_SVEC_COMMON_H__
#define __FW_SVEC_COMMON_H__
#include <mockturtle-rt-smem.h>
#include <mockturtle-rt.h>
#include <svec-common.h>
extern volatile int autosvec_run;
......
......@@ -37,7 +37,7 @@ enum trtl_fw_buffer_index {
/* Command and log message IDs */
enum rt_action_recv_svec {
SVEC_ID_LED_SET = __RT_ACTION_RECV_STANDARD_NUMBER,
SVEC_ID_LED_SET = 0,
SVEC_ID_LEMO_SET,
SVEC_ID_LEMO_DIR_SET,
SVEC_ID_STATE_GET,
......
......@@ -14,13 +14,6 @@
#include <libmockturtle.h>
#include <libsvec-internal.h>
static const struct trtl_proto_header hdr_tmpl = {
.rt_app_id = 0,
.slot_io = (SVEC_HMQ_IN << 4) |
(SVEC_HMQ_OUT & 0xF),
};
const char *svec_errors[] = {
"Received an invalid answer from white-rabbit-node-code CPU",
"Real-Time application does not acknowledge",
......@@ -229,16 +222,16 @@ int svec_version(struct svec_node *dev, struct trtl_fw_version *version)
{
struct svec_desc *svec = (struct svec_desc *)dev;
return trtl_fw_version_get(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
version);
return trtl_fw_version(svec->trtl,
SVEC_CPU_MANUAL, SVEC_CPU_MANUAL_HMQ,
version);
}
int svec_test_struct_get(struct svec_node *dev, struct svec_structure *test)
{
struct svec_desc *svec = (struct svec_desc *)dev;
struct trtl_structure_tlv tlv = {
.index = SVEC_BUF_TEST,
struct trtl_tlv tlv = {
.type = SVEC_BUF_TEST,
.size = sizeof(struct svec_structure),
.buf = test,
};
......@@ -251,8 +244,8 @@ int svec_test_struct_get(struct svec_node *dev, struct svec_structure *test)
int svec_test_struct_set(struct svec_node *dev, struct svec_structure *test)
{
struct svec_desc *svec = (struct svec_desc *)dev;
struct trtl_structure_tlv tlv = {
.index = SVEC_BUF_TEST,
struct trtl_tlv tlv = {
.type = SVEC_BUF_TEST,
.size = sizeof(struct svec_structure),
.buf = test,
};
......
#include <mockturtle-rt-serial.h>
#include <mockturtle-rt.h>
int main()
{
......
......@@ -346,14 +346,12 @@ int trtl_fw_mq_action_dispatch(enum trtl_mq_type type, unsigned int idx_mq)
struct trtl_msg msg;
int err = 0;
if (type == TRTL_RMQ)
return -EPERM; /* not supported yet */
/* Check if we have a pending message */
if (type == TRTL_HMQ) {
if (!(hmq_poll_in() & (1 << idx_mq)))
return -EAGAIN;
} else {
if (!(rmq_poll_in() & (1 << idx_mq)))
return -EAGAIN;
}
if (!(mq_poll_in(type) & (1 << idx_mq)))
return -EAGAIN;
/* Map the message */
mq_map_in_message(type, idx_mq, &msg);
......
......@@ -285,7 +285,7 @@ static inline void trtl_notify(unsigned int id)
static inline void trtl_notify_user(unsigned int id)
{
if (id < __TRTL_CPU_NOTIFY_MAX) {
pr_error("%s invalid user id %d. Replaced with\r\n",
pr_error("%s invalid user id %d. Replaced with %d\r\n",
__func__, id, TRTL_CPU_NOTIFY_APPLICATION);
id = TRTL_CPU_NOTIFY_APPLICATION;
}
......
#include <mockturtle-rt-serial.h>
int main()
{
int sum = 0;
......
......@@ -20,7 +20,7 @@ int main()
max_wait_cycle = 0xFFFF;
while (1) {
/* Wait incoming message */
while ((hmq_poll_in() & wait) != wait) {
while ((mq_poll_in(TRTL_HMQ) & wait) != wait) {
if (--max_wait_cycle == 0) {
pr_error("\tNO MESSAGE PENDING h:%d, cnt:0x%x\r\n",
hmq, count);
......@@ -30,13 +30,13 @@ int main()
/* validate message */
if (hdr->len != 1 || msg[0] != count) {
pr_error("\th: %d, l:%ld, d[0]:0x%lx, cnt:0x%x\r\n",
pr_error("\th: %d, l:%d, d[0]:0x%lx, cnt:0x%x\r\n",
hmq, hdr->len, msg[0], count);
mq_discard(TRTL_HMQ, hmq);
return -1;
}
if (msg[1] < count) {
pr_error("\th:%d, l:%ld d[1]:0x%lx, cnt:0x%x\r\n",
pr_error("\th:%d, l:%d d[1]:0x%lx, cnt:0x%x\r\n",
hmq, hdr->len, msg[1], count);
mq_discard(TRTL_HMQ, hmq);
return -1;
......
......@@ -10,23 +10,23 @@ int main()
cpu = 0;
for (hmq = 0; hmq < cfgrom->n_hmq[cpu]; ++hmq) {
if ((hmq_poll_in() & (1 << hmq)) != (1 << hmq)) {
pr_error("HMQ-%d after poll: 0x%lx\r\n",
hmq, hmq_poll_in());
if ((mq_poll_in(TRTL_HMQ) & (1 << hmq)) != (1 << hmq)) {
pr_error("HMQ-%d after poll: 0x%"PRIx32"\r\n",
hmq, mq_poll_in(TRTL_HMQ));
return -1;
}
mq_purge(TRTL_HMQ, hmq);
if ((hmq_poll_in() & (1 << hmq)) == (1 << hmq)) {
pr_error("HMQ-%d after poll: 0x%lx\r\n",
hmq, hmq_poll_in());
if ((mq_poll_in(TRTL_HMQ) & (1 << hmq)) == (1 << hmq)) {
pr_error("HMQ-%d after poll: 0x%"PRIx32"\r\n",
hmq, mq_poll_in(TRTL_HMQ));
return -1;
}
}
if (hmq_poll_in() != 0) {
pr_error("END poll: 0x%lx\r\n", hmq_poll_in());
if (mq_poll_in(TRTL_HMQ) != 0) {
pr_error("END poll: 0x%"PRIx32"\r\n", mq_poll_in(TRTL_HMQ));
return -1;
}
......
......@@ -23,7 +23,7 @@ int main()
max_wait_cycle = 0xFFFFFFFF;
while (1) {
/* Wait incoming message */
while ((hmq_poll_in() & wait) != wait) {
while ((mq_poll_in(TRTL_HMQ) & wait) != wait) {
if (--max_wait_cycle == 0) {
pr_error("\tNO MESSAGE PENDING h:%d, cnt:0x%x\r\n",
hmq, count);
......@@ -33,13 +33,13 @@ int main()
/* validate message */
if (hdr_r->len != 1 || msg_r[0] != count) {
pr_error("\th: %d, l:%ld, d[0]:0x%lx, cnt:0x%x\r\n",
pr_error("\th: %d, l:%d, d[0]:0x%lx, cnt:0x%x\r\n",
hmq, hdr_r->len, msg_r[0], count);
mq_discard(TRTL_HMQ, hmq);
return -1;
}
if (msg_r[1] < count) {
pr_error("\th:%d, l:%ld d[1]:0x%lx, cnt:0x%x\r\n",
pr_error("\th:%d, l:%d d[1]:0x%lx, cnt:0x%x\r\n",
hmq, hdr_r->len, msg_r[1], count);
mq_discard(TRTL_HMQ, hmq);
return -1;
......
#include <mockturtle-rt-serial.h>
#include <mockturtle-rt.h>
int main()
{
......
......@@ -65,7 +65,7 @@ test_hmq(void)
mq_send(TRTL_HMQ, 0);
// Wait for answer
while((hmq_poll_in() & 1) == 0)
while((mq_poll_in(TRTL_HMQ) & 1) == 0)
;
if (counts[cpu] != v + 1)
failed('H');
......@@ -80,7 +80,7 @@ test_hmq(void)
failed('K');
mq_discard(TRTL_HMQ, 0);
if ((hmq_poll_in() & 1) != 0)
if ((mq_poll_in(TRTL_HMQ) & 1) != 0)
failed('k');
}
......@@ -103,7 +103,7 @@ test_rmq(void)
mq_send(TRTL_RMQ, 0);
// Wait for answer
while((rmq_poll_in() & 1) == 0)
while((mq_poll_in(TRTL_RMQ) & 1) == 0)
;
// Read answer
......@@ -116,7 +116,7 @@ test_rmq(void)
failed('r');
mq_discard(TRTL_RMQ, 0);
if ((rmq_poll_in() & 1) != 0)
if ((mq_poll_in(TRTL_RMQ) & 1) != 0)
failed('s');
}
......
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