2023-02-20 11:48:23 +01:00
|
|
|
/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
|
|
|
|
#include "instr_nanos6.h"
|
|
|
|
|
2023-02-24 18:04:52 +01:00
|
|
|
#include "emu_prv.h"
|
|
|
|
#include "nanos6/nanos6_priv.h"
|
|
|
|
|
2023-02-20 11:48:23 +01:00
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
instr_start(0, 1);
|
|
|
|
|
|
|
|
/* Until here, the nanos6 model has not been connected to the
|
|
|
|
* patchbay yet. The next event will cause the subsystem mux to
|
|
|
|
* be connected to the patchbay. We need to ensure that at that
|
|
|
|
* moment the select channel is evaluated, otherwise the mux
|
|
|
|
* will remain selecting a null input until the thread state
|
|
|
|
* changes. */
|
|
|
|
|
|
|
|
instr_nanos6_worker_loop_enter();
|
|
|
|
|
2023-02-24 18:04:52 +01:00
|
|
|
/* Match the PRV line in the trace */
|
|
|
|
FILE *f = fopen("match.sh", "w");
|
|
|
|
if (f == NULL)
|
|
|
|
die("fopen failed:");
|
|
|
|
|
|
|
|
/* Ensure that after the Nanos6 connect phase, the CPU subsystem mux has
|
|
|
|
* selected the correct input, based on the running thread */
|
|
|
|
int type = PRV_NANOS6_SUBSYSTEM;
|
|
|
|
int64_t t = get_delta();
|
|
|
|
int value = ST_WORKER_LOOP;
|
|
|
|
fprintf(f, "grep ':%ld:%d:%d$' ovni/thread.prv\n", t, type, value);
|
|
|
|
fprintf(f, "grep ':%ld:%d:%d$' ovni/cpu.prv\n", t, type, value);
|
|
|
|
|
2023-02-20 11:48:23 +01:00
|
|
|
instr_nanos6_worker_loop_exit();
|
|
|
|
|
2023-02-24 18:04:52 +01:00
|
|
|
/* Also test when exitting the stacked subsystem */
|
|
|
|
t = get_delta();
|
|
|
|
value = 0;
|
|
|
|
fprintf(f, "grep ':%ld:%d:%d$' ovni/thread.prv\n", t, type, value);
|
|
|
|
fprintf(f, "grep ':%ld:%d:%d$' ovni/cpu.prv\n", t, type, value);
|
|
|
|
|
|
|
|
fclose(f);
|
|
|
|
|
2023-02-20 11:48:23 +01:00
|
|
|
instr_end();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|