aboutsummaryrefslogtreecommitdiff
path: root/arch/v1/arch_vars.py
blob: 2373e6bae68e174c58f1e283c593edd57119960f (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
class ArchVars:
    def __init__(self, args):
        self.inst_set = [
            (["noop"], " "),
            (["nop0"], "0"),
            (["nop1"], "1"),
            (["nop2"], "2"),
            (["nop3"], "3"),

            (["jmpb"], "("),
            (["jmpf"], ")"),
            (["adrb"], "["),
            (["adrf"], "]"),
            (["ifnz"], "?"),

            (["allb"], "{"),
            (["allf"], "}"),
            (["bswp"], "%"),
            (["bclr"], "|"),
            (["splt"], "$"),

            (["addn"], "+"),
            (["subn"], "-"),
            (["muln"], "*"),
            (["divn"], "/"),
            (["incn"], "^"),
            (["decn"], "v"),
            (["notn"], "!"),
            (["shfl"], "<"),
            (["shfr"], ">"),
            (["zero"], "z"),
            (["unit"], "u"),

            (["pshn"], "#"),
            (["popn"], "~"),

            (["load"], "."),
            (["wrte"], ":"),
            (["dupl"], "="),
            (["swap"], "x"),

            (["keya"], "a"),
            (["keyb"], "b"),
            (["keyc"], "c"),
            (["keyd"], "d"),
            (["keye"], "e"),
            (["keyf"], "f"),
            (["keyg"], "g"),
            (["keyh"], "h"),
            (["keyi"], "i"),
            (["keyj"], "j"),
            (["keyk"], "k"),
            (["keyl"], "l"),
            (["keym"], "m"),
            (["keyn"], "n"),
            (["keyo"], "o"),
            (["keyp"], "p"),

            (["loka"], "A"),
            (["lokb"], "B"),
            (["lokc"], "C"),
            (["lokd"], "D"),
            (["loke"], "E"),
            (["lokf"], "F"),
            (["lokg"], "G"),
            (["lokh"], "H"),
            (["loki"], "I"),
            (["lokj"], "J"),
            (["lokk"], "K"),
            (["lokl"], "L"),
            (["lokm"], "M"),
            (["lokn"], "N"),
            (["loko"], "O"),
            (["lokp"], "P"),
        ]

        self.core_fields = [
            ("uint64_t", "iexe", f"[{len(self.inst_set)}]"), # instruction execution counter
            ("uint64_t", "iwrt", f"[{len(self.inst_set)}]"), # instruction write counter

            ("uint64_t", "emb0", ""), # executions within mb0 counter
            ("uint64_t", "emb1", ""), # executions within mb1 counter
            ("uint64_t", "eliv", ""), # executions within not-owned live code counter
            ("uint64_t", "edea", ""), # executions within dead code counter
            ("uint64_t", "wmb0", ""), # writes within mb0 counter
            ("uint64_t", "wmb1", ""), # writes within mb1 counter
            ("uint64_t", "wdea", ""), # writes within dead code counter

            ("uint64_t", "aeva", f"[{2 ** args.mvec_pow}]"), # allocation events array
            #("uint64_t", "eeva", f"[{2 ** args.mvec_pow}]"), # execution events array
            #("uint64_t", "weva", f"[{2 ** args.mvec_pow}]"), # write events array
        ]

        self.data_is_compressed = True
        self.mvec_loop = False

        self.proc_fields = [
            ("uint64_t", "ip"),
            ("uint64_t", "sp"),
            ("uint64_t", "mb0a"),
            ("uint64_t", "mb0s"),
            ("uint64_t", "mb1a"),
            ("uint64_t", "mb1s"),
            ("uint64_t", "r0x"),
            ("uint64_t", "r1x"),
            ("uint64_t", "r2x"),
            ("uint64_t", "r3x"),
            ("uint64_t", "s0"),
            ("uint64_t", "s1"),
            ("uint64_t", "s2"),
            ("uint64_t", "s3"),
            ("uint64_t", "s4"),
            ("uint64_t", "s5"),
            ("uint64_t", "s6"),
            ("uint64_t", "s7"),
        ]