Commit 8ff80577 authored by Federico Vaga's avatar Federico Vaga

sw:tool: port to Mock Turtle 4.0 [UNTESTED]

This is part of a more complex work. Here, I just fixed all the GCC errors
and warning. The next step will be to actually test it.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent f551c3ce
......@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
exit(1);
}
wrtd = wrtd_open_by_fmc(dev_id);
wrtd = wrtd_open(dev_id);
if (!wrtd) {
fprintf(stderr, "Cannot open WRNC: %s\n", wrtd_strerror(errno));
exit(1);
......@@ -206,12 +206,6 @@ int main(int argc, char *argv[])
if (err)
exit(1);
err = trtl_cpu_enable(trtl, 1);
if (err)
exit(1);
err = trtl_cpu_start(trtl, 0);
if (err)
exit(1);
err = trtl_cpu_start(trtl, 1);
if (err)
exit(1);
......
......@@ -356,7 +356,7 @@ int main(int argc, char *argv[])
exit(1);
}
wrtd = wrtd_open_by_fmc(dev_id);
wrtd = wrtd_open(dev_id);
if (!wrtd) {
fprintf(stderr, "Cannot open WRNC: %s\n", wrtd_strerror(errno));
exit(1);
......
......@@ -54,35 +54,11 @@ static void help()
static void *logging_thread(void *arg)
{
struct wrtd_log_th *th_data = arg;
struct trtl_hmq *hlog;
struct wrtd_log_entry log;
int i, count;
/* Open logging interfaces */
switch (th_data->core) {
case WRTD_CORE_IN:
fprintf(stdout, "Open INPUT logging interface, channel: %d\n",
th_data->channel);
hlog = wrtd_in_log_open(th_data->wrtd, th_data->channel);
break;
case WRTD_CORE_OUT:
fprintf(stdout, "Open OUTPUT logging interface, channel: %d\n",
th_data->channel);
hlog = wrtd_out_log_open(th_data->wrtd, th_data->channel);
break;
default:
fprintf(stderr, "Unknow core %d\n", th_data->core);
return NULL;
}
if (!hlog) {
fprintf(stderr, "Cannot open input logging HMQ: %s\n",
wrtd_strerror(errno));
return NULL;
}
while (i < th_data->n_read || th_data->n_read == 0) {
count = wrtd_log_read(hlog, &log, 1, -1);
count = wrtd_log_read(th_data->wrtd, &log, 1, -1);
if (count <= 0) {
fprintf(stderr, "Cannot read message: %s\n",
wrtd_strerror(errno));
......@@ -112,7 +88,6 @@ static void *logging_thread(void *arg)
pthread_mutex_unlock(&mtx);
}
wrtd_log_close(hlog);
return NULL;
}
......@@ -184,7 +159,7 @@ int main(int argc, char *argv[])
exit(1);
}
th_data[0].wrtd = wrtd_open_by_fmc(dev_id);
th_data[0].wrtd = wrtd_open(dev_id);
if (!th_data[0].wrtd) {
fprintf(stderr, "Cannot open WRNC: %s\n", wrtd_strerror(errno));
exit(1);
......
......@@ -622,7 +622,7 @@ int main(int argc, char *argv[])
exit(1);
}
wrtd = wrtd_open_by_fmc(dev_id);
wrtd = wrtd_open(dev_id);
if (!wrtd) {
fprintf(stderr, "Cannot open WRNC: %s\n", wrtd_strerror(errno));
exit(1);
......
......@@ -44,11 +44,9 @@ static void print_time(struct wr_timestamp *t)
t->seconds, t->ticks, t->frac);
}
static void print_version(struct trtl_rt_version *v)
static void print_version(struct trtl_fw_version *v)
{
fprintf(stdout, "\tRealTime Application Version:\n");
fprintf(stdout, "\t bitstream_id: 0x%08X\n",
v->fpga_id);
fprintf(stdout, "\tapplication_id: 0x%08X\n",
v->rt_id);
fprintf(stdout, "\t rt_version: 0x%08X\n",
......@@ -62,7 +60,7 @@ int main(int argc, char *argv[])
{
struct wrtd_node *wrtd;
uint32_t dev_id = 0, n = 1;
struct trtl_rt_version vi, vo;
struct trtl_fw_version vi, vo;
uint64_t period = 0;
struct wr_timestamp tsi, tso;
int err, time = 0, version = 0;
......@@ -107,7 +105,7 @@ int main(int argc, char *argv[])
exit(1);
}
wrtd = wrtd_open_by_fmc(dev_id);
wrtd = wrtd_open(dev_id);
if (!wrtd) {
fprintf(stderr, "Cannot open WRNC: %s\n", wrtd_strerror(errno));
exit(1);
......
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