The ROme OpTimistic Simulator  3.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
application.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include <ROOT-Sim.h>
12 
13 #include <test_rng.h>
14 
15 #define MAX_BUFFERS 256
16 #define MAX_BUFFER_SIZE 512
17 #define SEND_PROBABILITY 0.05
18 #define ALLOC_PROBABILITY 0.2
19 #define DEALLOC_PROBABILITY 0.2
20 #define DOUBLING_PROBABILITY 0.5
21 #define COMPLETE_EVENTS 10000
22 
23 enum {
24  LOOP = MODEL_FINI + 1,
25  RECEIVE
26 };
27 
28 typedef struct _buffer {
29  unsigned count;
30  struct _buffer *next;
31  uint64_t data[];
32 } buffer;
33 
34 typedef struct _lp_state_type {
35  unsigned events;
36  unsigned buffer_count;
37  uint32_t total_checksum;
38  test_rng_state rng_state;
39  buffer *head;
40 } lp_state;
41 
42 buffer* get_buffer(buffer *head, unsigned i);
43 uint32_t read_buffer(buffer *head, unsigned i, uint32_t old_crc);
44 buffer* allocate_buffer(lp_state *state, const unsigned *data, unsigned count);
45 buffer* deallocate_buffer(buffer *head, unsigned i);
46 void crc_table_init(void);
47 
48 extern const char model_expected_output_64[679];
ROOT-Sim.h
ROOT-Sim header for model development.
_lp_state_type
Definition: application.h:34
_buffer
Definition: application.h:28
test_rng.h
Pseudo random number generator for tests.
test_rng_state
__uint128_t test_rng_state
The type of this pseudo random number generator state.
Definition: test_rng.h:19