Line data Source code
1 1 : /** 2 : * @file test/integration/model/application.h 3 : * 4 : * @brief Header of the model used to verify the runtime correctness 5 : * 6 : * SPDX-FileCopyrightText: 2008-2021 HPDCS Group <rootsim@googlegroups.com> 7 : * SPDX-License-Identifier: GPL-3.0-only 8 : */ 9 : #pragma once 10 : 11 : #include <ROOT-Sim.h> 12 : 13 : #include <test_rng.h> 14 : 15 0 : #define MAX_BUFFERS 256 16 0 : #define MAX_BUFFER_SIZE 512 17 0 : #define SEND_PROBABILITY 0.05 18 0 : #define ALLOC_PROBABILITY 0.2 19 0 : #define DEALLOC_PROBABILITY 0.2 20 0 : #define DOUBLING_PROBABILITY 0.5 21 0 : #define COMPLETE_EVENTS 10000 22 : 23 0 : enum { 24 : LOOP = MODEL_FINI + 1, 25 : RECEIVE 26 : }; 27 : 28 0 : typedef struct _buffer { 29 0 : unsigned count; 30 0 : struct _buffer *next; 31 0 : uint64_t data[]; 32 0 : } buffer; 33 : 34 0 : typedef struct _lp_state_type { 35 0 : unsigned events; 36 0 : unsigned buffer_count; 37 0 : uint32_t total_checksum; 38 0 : test_rng_state rng_state; 39 0 : buffer *head; 40 0 : } lp_state; 41 : 42 0 : buffer* get_buffer(buffer *head, unsigned i); 43 0 : uint32_t read_buffer(buffer *head, unsigned i, uint32_t old_crc); 44 0 : buffer* allocate_buffer(lp_state *state, const unsigned *data, unsigned count); 45 0 : buffer* deallocate_buffer(buffer *head, unsigned i); 46 0 : void crc_table_init(void); 47 : 48 0 : extern const char model_expected_output_64[679];