blob: 5bc95577f32636652342e69301a34ad8442d8498 (
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
66
67
68
69
70
71
72
73
74
|
#ifndef INCLUDED_CONFIG_H
#define INCLUDED_CONFIG_H
#include <stdint.h>
#define INITIAL_SCREEN_WIDTH 500
#define INITIAL_SCREEN_HEIGHT 500
#define WINDOW_NAME "MERSI/MESIF LRU vizualization"
#define CPU_COUNT 4
#define CACHE_COUNT CPU_COUNT
#define MEMORY_SIZE 16
#define CACHE_LINE_SIZE 1
#define CACHE_LINE_COUNT 4
#define CACHE_ASSOCIATIVITY 2
#define CACHE_LINES_PER_SET (CACHE_LINE_COUNT/CACHE_ASSOCIATIVITY)
#define SCREEN_PADDING 25
#define BUS_THICKNESS 10
#define BUS_MARGIN 40
#define BUS_SPACING 40
#define BUS_ARROW_SIDE (2*BUS_THICKNESS)
#define BUS_ARROW_HEIGHT (BUS_ARROW_SIDE*sqrt (3)/2)
#define BLOCK_WIDTH 170
#define BLOCK_MARGINH 50
#define BLOCK_MARGINV 50
#define BLOCK_PADDING 4
#define TEXT_MARGIN 4
#define TEXT_SPACING 4
#define FONT_SIZE 24
#define ENTRY_HEIGHT 20
#define ENTRY_MARGIN 6
#define ROUNDNESS 0.05
#define SEGMENTS 16
#define LINE_THICKNESS 2
#define TRANSACTIONS_PER_SECOND 2
#define TICKS_PER_TRANSACTION 20
#define TICKS_PER_SECOND (TICKS_PER_TRANSACTION*TRANSACTIONS_PER_SECOND)
#define TICK_SECONDS (1./TICKS_PER_SECOND)
#define MAX_TIME (60*60)
#define MAX_TICKS (MAX_TIME*TICKS_PER_SECOND)
#define DARKDARKGRAY (Color) { 20, 20, 20, 255 }
#define COLOR_DATA RED
#define COLOR_ADDR BLUE
#define COLOR_SHARED MAGENTA
#define THEME_LIGHT 0
#define THEME_DARK 1
#define THEME THEME_LIGHT
#if THEME == THEME_DARK
#define COLOR_BACKGROUND BLACK
#define COLOR_BUS_INACTIVE LIGHTGRAY
#define COLOR_BLOCK BLACK
#define COLOR_BLOCK_EDGE WHITE
#define COLOR_BUTTON DARKDARKGRAY
#define COLOR_BUTTON_HOVER COLOR_BACKGROUND
#define COLOR_TEXT WHITE
#else
#define COLOR_BACKGROUND WHITE
#define COLOR_BUS_INACTIVE DARKGRAY
#define COLOR_BLOCK WHITE
#define COLOR_BLOCK_EDGE BLACK
#define COLOR_BUTTON LIGHTGRAY
#define COLOR_BUTTON_HOVER COLOR_BACKGROUND
#define COLOR_TEXT BLACK
#endif
#endif
|