-
Notifications
You must be signed in to change notification settings - Fork 0
/
ocm5-no-labels.gv
128 lines (113 loc) · 2.48 KB
/
ocm5-no-labels.gv
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
117
118
119
120
121
122
123
124
125
126
127
128
digraph ocm5Logic {
edge [ decorate = true ]
node [
style = filled
colorscheme=dark28
]
RAM [ fillcolor = 1 ]
subgraph IOPorts {
node [ fillcolor = 2 ]
IN [ label = "<IN>" ]
OUT [ label = "<OUT>" ]
}
subgraph Registers {
node [ fillcolor = 3 ]
A [ label = "[A]" ]
B [ label = "[B]" ]
}
subgraph Banks {
node [ fillcolor = 4 ]
OPERATOR [ label = "[@]" ]
LOCATION [ label = "[#]" ]
}
subgraph Signals {
node [ fillcolor = 5 ]
POWER [ label = "{POWER}" ]
OVERFLOW [ label = "{OVERFLOW}" ]
GO [ label = "{GO}" ]
POWER -> GO
GO -> {
LOCATION ->
RAM ->
OPERATOR
}
ROTATEONE [ label = "{ROTATEONE}" ]
ROTATEONE -> LOCATION
STEP [ label = "{STEP}" ]
STEP -> ROTATEONE
STEP -> GO
}
subgraph Instructions {
node [ fillcolor = 6 ]
OPERATOR -> {
NOP
HALT
SWAP
NEXT
GET
SET
IFGOTO
READIN
SENDOUT
ADD
SUBTRACT
}
edge [colorscheme=paired12]
edge [ color = 1 ]
NOP -> STEP
edge [ color = 2 ]
HALT -> POWER
edge [ color = 3 ]
SWAP -> {
A -> B
B -> A
}
SWAP -> STEP
edge [ color = 4 ]
NEXT -> ROTATEONE
NEXT -> {
LOCATION -> RAM -> A
}
NEXT -> STEP
edge [ color = 5 ]
GET -> {
B -> RAM -> A
}
GET -> STEP
edge [ color = 6 ]
SET -> {
{ B; A } -> RAM
}
SET -> STEP
edge [ color = 7 ]
OVERFLOW -> {
IFGOTO -> { B -> LOCATION }
IFGOTO -> GO
}
OVERFLOW -> {
IFGOTO -> STEP
}
edge [ color = 8 ]
READIN -> {
IN -> A
}
READIN -> STEP
edge [ color = 9 ]
SENDOUT -> {
A -> OUT
}
SENDOUT -> STEP
edge [ color = 10 ]
ADD -> {
{ A; B } -> A
}
ADD -> OVERFLOW
ADD -> STEP
edge [ color = 11 ]
SUBTRACT -> {
{ A; B } -> A
}
SUBTRACT -> OVERFLOW
SUBTRACT -> STEP
}
}