2021-08-02 10:08:58 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "ovni.h"
|
|
|
|
#include "emu.h"
|
2021-09-23 12:40:59 +02:00
|
|
|
#include "prv.h"
|
2021-08-02 10:08:58 +02:00
|
|
|
|
|
|
|
void
|
2021-08-03 18:42:56 +02:00
|
|
|
prv_ev(FILE *f, int row, int64_t time, int type, int val)
|
2021-08-02 10:08:58 +02:00
|
|
|
{
|
2021-10-14 09:09:14 +02:00
|
|
|
dbg("<<< 2:0:1:1:%d:%ld:%d:%d\n", row, time, type, val);
|
2021-08-03 18:42:56 +02:00
|
|
|
fprintf(f, "2:0:1:1:%d:%ld:%d:%d\n", row, time, type, val);
|
|
|
|
}
|
|
|
|
|
2021-09-23 12:40:59 +02:00
|
|
|
void
|
|
|
|
prv_ev_thread_raw(struct ovni_emu *emu, int row, int64_t time, int type, int val)
|
|
|
|
{
|
|
|
|
prv_ev(emu->prv_thread, row, time, type, val);
|
|
|
|
}
|
|
|
|
|
2021-08-03 18:42:56 +02:00
|
|
|
void
|
|
|
|
prv_ev_thread(struct ovni_emu *emu, int row, int type, int val)
|
|
|
|
{
|
2021-09-23 12:40:59 +02:00
|
|
|
prv_ev_thread_raw(emu, row, emu->delta_time, type, val);
|
2021-08-03 18:42:56 +02:00
|
|
|
}
|
|
|
|
|
2021-10-21 15:55:40 +02:00
|
|
|
void
|
|
|
|
prv_ev_cpu_raw(struct ovni_emu *emu, int row, int64_t time, int type, int val)
|
|
|
|
{
|
|
|
|
prv_ev(emu->prv_cpu, row, time, type, val);
|
|
|
|
}
|
|
|
|
|
2021-08-03 18:42:56 +02:00
|
|
|
void
|
|
|
|
prv_ev_cpu(struct ovni_emu *emu, int row, int type, int val)
|
|
|
|
{
|
2021-10-21 15:55:40 +02:00
|
|
|
prv_ev_cpu_raw(emu, row, emu->delta_time, type, val);
|
2021-08-02 10:08:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2021-10-21 15:55:40 +02:00
|
|
|
prv_ev_autocpu_raw(struct ovni_emu *emu, int64_t time, int type, int val)
|
2021-08-02 10:08:58 +02:00
|
|
|
{
|
|
|
|
int row;
|
|
|
|
struct ovni_cpu *cpu;
|
|
|
|
|
|
|
|
assert(emu->cur_thread);
|
|
|
|
|
|
|
|
cpu = emu->cur_thread->cpu;
|
|
|
|
|
|
|
|
assert(cpu);
|
2021-08-02 18:15:59 +02:00
|
|
|
assert(cpu->i >= 0);
|
2021-08-02 10:08:58 +02:00
|
|
|
|
|
|
|
/* Begin at 1 */
|
2021-08-19 11:32:16 +02:00
|
|
|
row = emu->cur_loom->offset_ncpus + cpu->i + 1;
|
2021-08-02 10:08:58 +02:00
|
|
|
|
2021-10-21 15:55:40 +02:00
|
|
|
prv_ev_cpu_raw(emu, row, time, type, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
prv_ev_autocpu(struct ovni_emu *emu, int type, int val)
|
|
|
|
{
|
|
|
|
prv_ev_autocpu_raw(emu, emu->delta_time, type, val);
|
2021-08-02 10:08:58 +02:00
|
|
|
}
|
2021-08-02 21:13:03 +02:00
|
|
|
|
|
|
|
void
|
2021-08-03 18:42:56 +02:00
|
|
|
prv_header(FILE *f, int nrows)
|
2021-08-02 21:13:03 +02:00
|
|
|
{
|
2021-08-03 18:42:56 +02:00
|
|
|
fprintf(f, "#Paraver (19/01/38 at 03:14):00000000000000000000_ns:0:1:1(%d:1)\n", nrows);
|
2021-08-02 21:13:03 +02:00
|
|
|
}
|