1 /* Copyright (c) 2008-2012. Da SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "xbt/function_types.h"
13 #include "mc/datatypes.h"
14 #include "simgrid/simix.h"
15 #include "simgrid/modelchecker.h" /* our public interface (and definition of HAVE_MC) */
16 #include "xbt/automaton.h"
17 #include "xbt/dynar.h"
19 #define STD_HEAP_SIZE 20480000 /* Maximum size of the system's heap */
23 /********************************** Configuration of MC **************************************/
24 extern int _sg_do_model_check;
25 extern int _sg_mc_checkpoint;
26 extern char* _sg_mc_property_file;
27 extern int _sg_mc_timeout;
28 extern int _sg_mc_max_depth;
29 extern int _sg_mc_visited;
30 extern char* _sg_mc_dot_output_file;
32 extern xbt_dynar_t mc_heap_comparison_ignore;
33 extern xbt_dynar_t stacks_areas;
34 extern void *maestro_stack_start;
35 extern void *maestro_stack_end;
37 /********************************* Global *************************************/
38 void _mc_cfg_cb_reduce(const char *name, int pos);
39 void _mc_cfg_cb_checkpoint(const char *name, int pos);
40 void _mc_cfg_cb_property(const char *name, int pos);
41 void _mc_cfg_cb_timeout(const char *name, int pos);
42 void _mc_cfg_cb_max_depth(const char *name, int pos);
43 void _mc_cfg_cb_visited(const char *name, int pos);
44 void _mc_cfg_cb_dot_output(const char *name, int pos);
46 XBT_PUBLIC(void) MC_do_the_modelcheck_for_real(void);
48 XBT_PUBLIC(void) MC_init(void);
49 XBT_PUBLIC(void) MC_exit(void);
50 XBT_PUBLIC(void) MC_modelcheck_safety(void);
51 XBT_PUBLIC(void) MC_modelcheck_liveness(void);
52 XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
53 XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
54 void MC_automaton_load(const char *file);
56 /****************************** MC ignore **********************************/
57 XBT_PUBLIC(void) MC_ignore_heap(void *address, size_t size);
58 XBT_PUBLIC(void) MC_remove_ignore_heap(void *address, size_t size);
59 XBT_PUBLIC(void) MC_ignore_local_variable(const char *var_name, const char *frame);
60 XBT_PUBLIC(void) MC_ignore_global_variable(const char *var_name);
61 void MC_new_stack_area(void *stack, char *name, void *context, size_t size);
63 /********************************* Memory *************************************/
64 XBT_PUBLIC(void) MC_memory_init(void); /* Initialize the memory subsystem */
65 XBT_PUBLIC(void) MC_memory_exit(void);