Commit Graph

79 Commits

Author SHA1 Message Date
8f4aa59148 Fix unit-stream test 2024-09-17 08:27:51 +02:00
1f30e8ef8b Parse metadata from proc and loom directly
All the metadata keys are known to proc and loom only, making it
self-contained. The metadata.c module is no longer needed.
2024-09-12 15:54:29 +02:00
6a54f19b76 Fix unit tests 2024-09-10 11:21:44 +02:00
c8750b9dfd Enable -Wconversion and -Wsign-conversion
Prevents implicit conversions to go undetected, as they will have to be
explicit now.
2024-09-09 08:28:02 +02:00
2457e50712 Use always base 10 integer formats with scanf()
The %i printf variant tries to autodetect the base, so 010 becomes 8.
2024-07-24 16:36:54 +02:00
129020e1c5 Fix format errors in printf-like functions 2024-07-24 15:12:09 +02:00
Miquel Vidal i Pinyol
3103018404 Use format macro constants for fprintf and fscanf family functions 2024-07-24 15:12:09 +02:00
Miquel Vidal i Pinyol
478ed1f5d0 Use proper format specifiers
Allows compiling for architectures with different data type sizes
2024-07-24 15:12:09 +02:00
27a23f25ca Update task model to use bodies
The task model is now integrated with the body model. A normal task can
only have one body, while a parallel task can have more.

It inherits the restriction that a task body cannot be nested over
another one unless it is paused (or the relaxed nest model is enabled).
2024-03-12 12:37:58 +01:00
a0e7fad83e Add body model for tasks
The new task body model (or just body model) allows a task to have
multiple bodies. Generally a body is mapped to the execution of the same
user code of the task with specific input arguments.

The body model can constraint if a given body can be paused or re-run
again (resurrect).

Additionally, the body model can run multiple nested bodies but with the
restriction that the parent body should be paused first. This condition
can be relaxed with the BODY_FLAG_RELAX_NESTING flag.
2024-03-12 12:37:09 +01:00
1792c650ec Add definitions for emulator events
Implements a small language parser to define the emulator events. The
event specification is parsed at emulation (when the emulator runs).
The ovnidump output now prints the events with the arguments formatted
as given in the event description.

It also introduces some consistency checks over the event MCVs, which
must begin with the model identifier and cannot be duplicated.
2024-01-30 12:01:56 +01:00
d45041e00c Disable delayed connect 2023-11-16 12:39:14 +01:00
354f2f50eb Register emulation models only if required
Until now, emulation models were always being registered via probe(),
which causes the emulator to initialize all the channels. To reduce the
overhead, the channels were not connected or registered in the bay
until the first event of that model was received. This delayed connect
was causing issues in muxes where the newly connected model required
refreshing the touched channels. Which in turn was causing unexpected
PRV events.

By determining which models we need to enable, we can remove the delayed
connect mechanism and just enable those models at initialization time,
and connect the channels.
2023-11-16 12:39:05 +01:00
74557ab348 Don't rely on temporary directories
Use the current test directory instead.
2023-07-25 16:36:57 +02:00
c257405060 Define unit_test() macro with ovni_test()
This allows unit tests to be executed in a individual directory where
they can create new files in $PWD.
2023-07-25 16:26:25 +02:00
3a28e1c3d3 Avoid fmemopen() due to bug in old glibc 2023-04-19 10:57:10 +00:00
676e30b4ca Order looms and processes by rank if given 2023-04-14 08:35:21 +00:00
602daabe23 Fix copyright years 2023-04-06 15:33:15 +00:00
6711afdb58 Fix include headers following IWYU 2023-04-06 15:33:15 +00:00
30812e134e Reduce test cases in sort_replace 2023-04-06 15:33:15 +00:00
467cc9aa7e Fix value_str() usage 2023-04-06 15:33:15 +00:00
35872354e0 Speedup the sort module
Improvements:

- Don't propagate values if they didn't change
- Use custom sort algorithm to speedup the sorting
- Allocate a contiguous array of channel outputs
2023-04-06 15:33:15 +00:00
70b29b6459 Add sort channel module
Sorts the N input values and writes them in the N outputs in order.
2023-04-06 15:33:15 +00:00
ddbb7dd9f4 Add include-what-you-use
Adds forwards declarations in headers and includes all headers in
sources, even if they are found by transitive includes.
2023-03-24 12:08:45 +00:00
81875450a8 Add unit tests for PRV_SKIPDUP and PRV_EMITDUP 2023-03-24 12:08:45 +00:00
c0afc79d4e Use OK() and ERR() in unit tests
Also remove prefixes and trailing new lines in err() and die()
2023-03-24 12:08:45 +00:00
9a4a4a0005 Remove bay_remove() 2023-03-24 12:08:45 +00:00
b42fb4d2f3 Check prv_* return values 2023-03-24 12:08:45 +00:00
6deef0308a Fix underflow in path_remove_trailing() 2023-03-24 12:08:45 +00:00
e625897766 Add CHAN_IGNORE_DUP to ignore duplicates 2023-03-24 12:08:45 +00:00
ab3e823134 Rename CHAN_DUPLICATES to CHAN_ALLOW_DUP 2023-03-24 12:08:45 +00:00
f61711047c Remove buffer argument from value_str()
Use a ring of buffers instead, so we can printf() up to 16 values in
the same call.
2023-03-24 12:08:45 +00:00
82f1cc287d Update copyright years to 2021-2023 2023-03-24 12:08:45 +00:00
4c7b44510a Remove empty tests 2023-03-24 12:08:45 +00:00
a4452dee8c Use OK() and ERR() macros in cpu and loom tests
Some return checks were missing too.
2023-03-24 12:08:45 +00:00
0eb88af4b9 Use the CPU phyid for the name only
The logical index is used to change the affinity of the threads.
2023-03-24 12:08:45 +00:00
65ecc75afd Sort unit tests by name 2023-03-24 12:08:45 +00:00
98b698473d Remove unused unit tests 2023-03-24 12:08:45 +00:00
b98ccfe3ad Use row and type as identifiers in prv_register()
Prevents multiple channels from being accidentally set to the same row
with the same type.
2023-03-24 12:08:45 +00:00
1c90947f82 Remove unused select function from mux unit test 2023-03-24 12:08:45 +00:00
5b980734ed Add unit test cases for thread init 2023-03-24 12:08:45 +00:00
7bbd74cb17 Add common unit test macros 2023-03-24 12:08:45 +00:00
e06651bbb6 Disable hash speed test
We no longer use the hash for the mux inputs, so during emulation is not
a performance bottleneck.
2023-03-24 12:08:45 +00:00
7ba810fd4a Set the thread->proc in proc_add_thread() 2023-03-24 12:08:45 +00:00
3a4722a83e Add delayed connect unit test for mux 2023-03-24 12:08:45 +00:00
4a1fba74f3 Update bay unit test 2023-03-24 12:08:45 +00:00
fe6db823a7 Index mux inputs by an integer 2023-03-24 12:08:45 +00:00
3da9e27190 Skip "loom." prefix from hostname 2023-03-24 12:08:45 +00:00
f76d160c69 Copy Paraver configs to output directory 2023-03-24 12:08:45 +00:00
8727126551 Use .obs extension for ovni binary streams 2023-03-24 12:08:45 +00:00