aboutsummaryrefslogtreecommitdiff
path: root/include/salis.h
blob: 75ef9dd3d3a5b55ad3a5224bbe2b1a45cbeee91e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @file salis.h
* @author Paul Oliver
*
* Main header file for the Salis library. Loading this header imports all API
* modules and functions. It may be loaded from C or C++.
*/

#ifndef SALIS_H
#define SALIS_H

#ifdef __cplusplus
	extern "C" {
#endif

#include <types.h>
#include <instset.h>
#include <memory.h>
#include <evolver.h>
#include <common.h>
#include <process.h>

/** Initialize Salis simulation.
* @param order Order of memory (memory_size == 1 << order)
*/
SALIS_API void sal_main_init(uint32 order);

/** Free resources and quit Salis.
*/
SALIS_API void sal_main_quit(void);

/** Load existing Salis simulation from saved file.
* @param file_name Path of the save file to be loaded
*/
SALIS_API void sal_main_load(string file_name);

/** Save Salis simulation to a file.
* @param file_name Path of the save file to be created
*/
SALIS_API void sal_main_save(string file_name);

/** Check if Salis simulation has been correctly initialized.
* @return Salis has been correctly initialized
*/
SALIS_API boolean sal_main_is_init(void);

/** Get current simulation cycle.
* @return Current simulation cycle
*/
SALIS_API uint32 sal_main_get_cycle(void);

/** Get current simulation epoch.
* @return Current simulation epoch (1 epoch == 2^32 cycles)
*/
SALIS_API uint32 sal_main_get_epoch(void);

/** Update simulation once. This will cycle all Salis modules and processes.
*/
SALIS_API void sal_main_cycle(void);

#ifdef __cplusplus
	}
#endif

#endif