stepper-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +53 -0
- package/README.md +70 -0
- package/index.js +96 -0
- package/lib/abi.js +38 -0
- package/lib/chain/chain.js +198 -0
- package/lib/chain/verify.js +128 -0
- package/lib/netlist/asm.js +184 -0
- package/lib/netlist/machine.js +116 -0
- package/lib/netlist/st8.js +289 -0
- package/lib/st8-data.js +16 -0
- package/package.json +31 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* st8.js — the ST-8, described structurally in NAND gates.
|
|
3
|
+
*
|
|
4
|
+
* This is the silicon. Not a description of it, not a model of it: running
|
|
5
|
+
* this function emits the exact gate table the browser walks and a contract
|
|
6
|
+
* would interpret. Every gate below is one we placed.
|
|
7
|
+
*
|
|
8
|
+
* ARCHITECTURE
|
|
9
|
+
* 25-bit instruction word [24:20] op · [19:16] rd · [15:12] rs · [11:0] imm/addr
|
|
10
|
+
* thirty-two opcodes, which is every code the five-bit field can hold
|
|
11
|
+
* 16 registers of 8 bits read through two ports, written through one
|
|
12
|
+
* 10-bit program counter 1,024 words of ROM
|
|
13
|
+
* 256 bytes of RAM outside the netlist — the processor asks, the
|
|
14
|
+
* contract answers, which is why `ld` costs two cycles
|
|
15
|
+
* flags C and Z
|
|
16
|
+
* ports one byte in per step, one byte out
|
|
17
|
+
*
|
|
18
|
+
* WHY `ld` TAKES TWO CYCLES. The contract must know which address is being
|
|
19
|
+
* read *before* it runs the gates, but the address lives in a register only
|
|
20
|
+
* the gates can read. So cycle one latches the address and holds the PC;
|
|
21
|
+
* cycle two receives the data and advances. That is not a limitation worked
|
|
22
|
+
* around, it is what a real memory interface costs, and it is why the ISA
|
|
23
|
+
* documents `ld` as two honest cycles.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
"use strict";
|
|
27
|
+
|
|
28
|
+
var OP = {
|
|
29
|
+
NOP: 0, LDI: 1, MOV: 2, ADD: 3, ADC: 4, SUB: 5, SBB: 6, AND: 7,
|
|
30
|
+
OR: 8, XOR: 9, NAND: 10, NOT: 11, SHL: 12, SHR: 13, ROL: 14, ROR: 15,
|
|
31
|
+
INC: 16, DEC: 17, CMP: 18, LD: 19, ST: 20, IN: 21, OUT: 22, JMP: 23,
|
|
32
|
+
JZ: 24, JNZ: 25, JC: 26, JNC: 27, HLT: 28, TST: 29, SWAP: 30, JMPR: 31,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function buildST8(b, opts) {
|
|
36
|
+
var i, r;
|
|
37
|
+
// The data width. Everything below is written in terms of W, so ST-16 is
|
|
38
|
+
// this same description with one number changed rather than a second file
|
|
39
|
+
// to keep in step with the first.
|
|
40
|
+
var W = (opts && opts.width) || 8;
|
|
41
|
+
var mark = {};
|
|
42
|
+
var at = function (name) { mark[name] = b.gateCount(); b.block = name; };
|
|
43
|
+
var cost = {};
|
|
44
|
+
var spent = function (name, from) { cost[name] = b.gateCount() - mark[from]; };
|
|
45
|
+
|
|
46
|
+
/* ---------------------------------------------------------- the inputs
|
|
47
|
+
* Driven from outside every cycle: the instruction word at ROM[pc], the
|
|
48
|
+
* byte whoever paid for this step sent, and whatever RAM had at the
|
|
49
|
+
* address latched on the previous edge. */
|
|
50
|
+
var instr = b.bus(25);
|
|
51
|
+
var inPort = b.bus(W);
|
|
52
|
+
var ramRdata = b.bus(W);
|
|
53
|
+
|
|
54
|
+
/* ----------------------------------------------------------- the state
|
|
55
|
+
* Declared before any logic, because the logic reads Q. */
|
|
56
|
+
var regs = [];
|
|
57
|
+
for (r = 0; r < 16; r++) regs.push(b.flops(W));
|
|
58
|
+
var pc = b.flops(10);
|
|
59
|
+
var outp = b.flops(W);
|
|
60
|
+
var cf = b.flops(1);
|
|
61
|
+
var zf = b.flops(1);
|
|
62
|
+
var halt = b.flops(1);
|
|
63
|
+
var ramAddr = b.flops(8);
|
|
64
|
+
var ramWdata = b.flops(W);
|
|
65
|
+
var ramWe = b.flops(1);
|
|
66
|
+
/** High during the second cycle of a load, and only then. */
|
|
67
|
+
var ldPhase = b.flops(1);
|
|
68
|
+
|
|
69
|
+
var cfQ = cf.q[0], zfQ = zf.q[0], haltQ = halt.q[0], ldQ = ldPhase.q[0];
|
|
70
|
+
|
|
71
|
+
/* --------------------------------------------------------------- decode */
|
|
72
|
+
at("decode");
|
|
73
|
+
var opBits = instr.slice(20, 25);
|
|
74
|
+
var rdBits = instr.slice(16, 20);
|
|
75
|
+
var rsBits = instr.slice(12, 16);
|
|
76
|
+
// The instruction word keeps its 25 bits at every width, so an immediate
|
|
77
|
+
// is eight bits and arrives zero-extended. A wider core loads a constant
|
|
78
|
+
// into the low half and shifts, exactly like the silicon it imitates.
|
|
79
|
+
var imm8 = instr.slice(0, 8);
|
|
80
|
+
while (imm8.length < W) imm8 = imm8.concat([b.ZERO]);
|
|
81
|
+
imm8 = imm8.slice(0, W);
|
|
82
|
+
var addr10 = instr.slice(0, 10);
|
|
83
|
+
|
|
84
|
+
// Thirty-two one-hot lines and thirty-two instructions: the five-bit field
|
|
85
|
+
// is full, and a thirty-third would cost a sixth bit taken from the
|
|
86
|
+
// immediate. That is a decision for a wider generation, not this one.
|
|
87
|
+
var opIs = b.decode(opBits);
|
|
88
|
+
// rd needs a one-hot vector anyway, because writeback selects on it. rs does
|
|
89
|
+
// not: nothing but its own read port ever asks which register it names, so
|
|
90
|
+
// it is muxed straight off the select bits with no decoder at all.
|
|
91
|
+
var rdOne = b.decode(rdBits);
|
|
92
|
+
var o = function (name) { return opIs[OP[name]]; };
|
|
93
|
+
spent("decode", "decode");
|
|
94
|
+
|
|
95
|
+
var notHalt = b.not(haltQ);
|
|
96
|
+
/** A halted processor still fetches, but nothing it fetches has any effect. */
|
|
97
|
+
var live = function (sig) { return b.and(sig, notHalt); };
|
|
98
|
+
|
|
99
|
+
/* ------------------------------------------------- register read ports */
|
|
100
|
+
at("regread");
|
|
101
|
+
var qOf = function (bit) { return regs.map(function (rg) { return rg.q[bit]; }); };
|
|
102
|
+
var A = [], B = [];
|
|
103
|
+
for (i = 0; i < W; i++) {
|
|
104
|
+
A.push(b.mux1hot(qOf(i), rdOne)); // the destination register, read back
|
|
105
|
+
B.push(b.muxTree(qOf(i), rsBits)); // the source register
|
|
106
|
+
}
|
|
107
|
+
spent("regread", "regread");
|
|
108
|
+
|
|
109
|
+
/* ------------------------------------------------------------------ ALU */
|
|
110
|
+
at("alu");
|
|
111
|
+
|
|
112
|
+
// One adder serves add, adc, sub, sbb, cmp, inc and dec. Subtraction is
|
|
113
|
+
// two's complement: A + ~B + 1. inc and dec force B to 0 and pick the
|
|
114
|
+
// carry-in, so `dec` is A + 0xff + 0 and costs no extra hardware.
|
|
115
|
+
var selB = b.orAll([o("ADD"), o("ADC"), o("SUB"), o("SBB"), o("CMP")]);
|
|
116
|
+
var invB = b.orAll([o("SUB"), o("SBB"), o("CMP"), o("DEC")]);
|
|
117
|
+
var addB = [];
|
|
118
|
+
for (i = 0; i < W; i++) addB.push(b.xor(b.and(B[i], selB), invB));
|
|
119
|
+
|
|
120
|
+
var notC = b.not(cfQ);
|
|
121
|
+
var cin = b.orAll([
|
|
122
|
+
b.and(o("ADC"), cfQ),
|
|
123
|
+
o("SUB"), o("CMP"), o("INC"),
|
|
124
|
+
b.and(o("SBB"), notC),
|
|
125
|
+
]);
|
|
126
|
+
var sum = b.adder(A, addB, cin);
|
|
127
|
+
|
|
128
|
+
var andR = [], orR = [], xorR = [], nandR = [], notR = [];
|
|
129
|
+
for (i = 0; i < W; i++) {
|
|
130
|
+
andR.push(b.and(A[i], B[i]));
|
|
131
|
+
orR.push(b.or(A[i], B[i]));
|
|
132
|
+
xorR.push(b.xor(A[i], B[i]));
|
|
133
|
+
nandR.push(b.nand(A[i], B[i]));
|
|
134
|
+
notR.push(b.not(A[i]));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Shifts and rotates are wiring, not logic: no gate is spent on moving the
|
|
138
|
+
// bits. And a rotate differs from a shift in exactly one bit, the one that
|
|
139
|
+
// wraps, so the four operations collapse into two sources for the result
|
|
140
|
+
// mux. Two gates buys back four mux inputs across all eight bits.
|
|
141
|
+
var isRol = b.or(o("SHL"), o("ROL"));
|
|
142
|
+
var isRor = b.or(o("SHR"), o("ROR"));
|
|
143
|
+
var shiftL = [b.and(cfQ, o("ROL"))].concat(A.slice(0, W - 1));
|
|
144
|
+
var shiftR = A.slice(1).concat([b.and(cfQ, o("ROR"))]);
|
|
145
|
+
|
|
146
|
+
// swap is the same idea taken further: the halves of A exchanged, which is
|
|
147
|
+
// a permutation of the wires and costs nothing but a source on the mux.
|
|
148
|
+
var half = W >> 1;
|
|
149
|
+
var swapR = A.slice(half).concat(A.slice(0, half));
|
|
150
|
+
|
|
151
|
+
// cmp rides the adder so the flags are right, then declines to write.
|
|
152
|
+
var selSum = b.orAll([
|
|
153
|
+
o("ADD"), o("ADC"), o("SUB"), o("SBB"), o("INC"), o("DEC"), o("CMP"),
|
|
154
|
+
]);
|
|
155
|
+
var selLd = b.and(o("LD"), ldQ);
|
|
156
|
+
|
|
157
|
+
// tst rides the AND the way cmp rides the adder: the result is computed so
|
|
158
|
+
// the flags are right, and then thrown away.
|
|
159
|
+
var selAnd = b.or(o("AND"), o("TST"));
|
|
160
|
+
|
|
161
|
+
var result = b.mux1hotBus(
|
|
162
|
+
[sum.sum, andR, orR, xorR, nandR, notR, shiftL, shiftR, swapR,
|
|
163
|
+
B, imm8, inPort, ramRdata],
|
|
164
|
+
[selSum, selAnd, o("OR"), o("XOR"), o("NAND"), o("NOT"),
|
|
165
|
+
isRol, isRor, o("SWAP"),
|
|
166
|
+
o("MOV"), o("LDI"), o("IN"), selLd],
|
|
167
|
+
W
|
|
168
|
+
);
|
|
169
|
+
spent("alu", "alu");
|
|
170
|
+
|
|
171
|
+
/* ---------------------------------------------------- register writeback */
|
|
172
|
+
at("regwrite");
|
|
173
|
+
// tst is absent on purpose: it is the only new instruction that computes a
|
|
174
|
+
// result and refuses to keep it.
|
|
175
|
+
var writes = b.orAll([
|
|
176
|
+
o("LDI"), o("MOV"), o("ADD"), o("ADC"), o("SUB"), o("SBB"), o("AND"),
|
|
177
|
+
o("OR"), o("XOR"), o("NAND"), o("NOT"), o("SHL"), o("SHR"), o("ROL"),
|
|
178
|
+
o("ROR"), o("INC"), o("DEC"), o("IN"), o("SWAP"), selLd,
|
|
179
|
+
]);
|
|
180
|
+
var writeEn = live(writes);
|
|
181
|
+
for (r = 0; r < 16; r++) {
|
|
182
|
+
var hit = b.and(rdOne[r], writeEn);
|
|
183
|
+
var nhit = b.not(hit);
|
|
184
|
+
var d = [];
|
|
185
|
+
for (i = 0; i < W; i++) d.push(b.mux(regs[r].q[i], result[i], hit, nhit));
|
|
186
|
+
regs[r].drive(d);
|
|
187
|
+
}
|
|
188
|
+
spent("regwrite", "regwrite");
|
|
189
|
+
|
|
190
|
+
/* ---------------------------------------------------------------- flags */
|
|
191
|
+
at("flags");
|
|
192
|
+
// swap and tst set Z from their result and clear C, which is what every
|
|
193
|
+
// logic operation here already does: no carry select is asserted, so the
|
|
194
|
+
// one-hot mux yields zero.
|
|
195
|
+
var setsFlags = b.orAll([
|
|
196
|
+
o("ADD"), o("ADC"), o("SUB"), o("SBB"), o("AND"), o("OR"), o("XOR"),
|
|
197
|
+
o("NAND"), o("NOT"), o("SHL"), o("SHR"), o("ROL"), o("ROR"),
|
|
198
|
+
o("INC"), o("DEC"), o("CMP"), o("TST"), o("SWAP"),
|
|
199
|
+
]);
|
|
200
|
+
var flagEn = live(setsFlags);
|
|
201
|
+
|
|
202
|
+
var zNew = b.not(b.orAll(result));
|
|
203
|
+
// Carry means different things per op, and nothing at all for the logic
|
|
204
|
+
// ops — where no select is asserted and the one-hot mux yields 0.
|
|
205
|
+
var cNew = b.mux1hot([sum.cout, A[W - 1], A[0]], [selSum, isRol, isRor]);
|
|
206
|
+
cf.drive([b.mux(cfQ, cNew, flagEn)]);
|
|
207
|
+
zf.drive([b.mux(zfQ, zNew, flagEn)]);
|
|
208
|
+
spent("flags", "flags");
|
|
209
|
+
|
|
210
|
+
/* ------------------------------------------------------ program counter */
|
|
211
|
+
at("pc");
|
|
212
|
+
var taken = b.orAll([
|
|
213
|
+
o("JMP"), o("JMPR"),
|
|
214
|
+
b.and(o("JZ"), zfQ),
|
|
215
|
+
b.and(o("JNZ"), b.not(zfQ)),
|
|
216
|
+
b.and(o("JC"), cfQ),
|
|
217
|
+
b.and(o("JNC"), notC),
|
|
218
|
+
]);
|
|
219
|
+
// Where a taken branch goes: the address in the word, or the one in a
|
|
220
|
+
// register. At eight bits a register holds eight of the ten address bits,
|
|
221
|
+
// so jmpr reaches the first 256 words; at sixteen it reaches all 1,024.
|
|
222
|
+
var regAddr = A.slice(0, 10);
|
|
223
|
+
while (regAddr.length < 10) regAddr = regAddr.concat([b.ZERO]);
|
|
224
|
+
var branchTo = b.muxBus(addr10, regAddr, o("JMPR"));
|
|
225
|
+
|
|
226
|
+
var pcNext = b.increment(pc.q);
|
|
227
|
+
var pcTarget = b.muxBus(pcNext, branchTo, taken);
|
|
228
|
+
// The PC stands still while a load is fetching its operand, and forever
|
|
229
|
+
// once the machine has halted.
|
|
230
|
+
var loadStall = b.and(o("LD"), b.not(ldQ));
|
|
231
|
+
var advance = b.not(b.or(haltQ, loadStall));
|
|
232
|
+
pc.drive(b.muxBus(pc.q, pcTarget, advance));
|
|
233
|
+
spent("pc", "pc");
|
|
234
|
+
|
|
235
|
+
/* ------------------------------------------------------ memory and ports */
|
|
236
|
+
at("mem");
|
|
237
|
+
var doLoad = live(loadStall); // cycle one of a load: latch the address
|
|
238
|
+
var doStore = live(o("ST"));
|
|
239
|
+
var addrD = [];
|
|
240
|
+
var nLoad = b.not(doLoad);
|
|
241
|
+
var nStore = b.not(doStore);
|
|
242
|
+
// The address is always eight bits: 256 locations, whatever the word size.
|
|
243
|
+
for (i = 0; i < 8; i++) {
|
|
244
|
+
var held = b.mux(ramAddr.q[i], B[i], doLoad, nLoad);
|
|
245
|
+
addrD.push(b.mux(held, A[i], doStore, nStore));
|
|
246
|
+
}
|
|
247
|
+
ramAddr.drive(addrD);
|
|
248
|
+
|
|
249
|
+
var wD = [];
|
|
250
|
+
for (i = 0; i < W; i++) wD.push(b.mux(ramWdata.q[i], B[i], doStore, nStore));
|
|
251
|
+
ramWdata.drive(wD);
|
|
252
|
+
ramWe.drive([doStore]);
|
|
253
|
+
|
|
254
|
+
var outEn = live(o("OUT"));
|
|
255
|
+
var nOut = b.not(outEn);
|
|
256
|
+
var outD = [];
|
|
257
|
+
for (i = 0; i < W; i++) outD.push(b.mux(outp.q[i], A[i], outEn, nOut));
|
|
258
|
+
outp.drive(outD);
|
|
259
|
+
|
|
260
|
+
// Two cycles per load, and exactly two: the phase bit cannot stay high.
|
|
261
|
+
ldPhase.drive([live(loadStall)]);
|
|
262
|
+
// Halt is a one-way door. Nothing in the netlist can clear it.
|
|
263
|
+
halt.drive([b.or(haltQ, o("HLT"))]);
|
|
264
|
+
spent("mem", "mem");
|
|
265
|
+
|
|
266
|
+
b.sealFlops();
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
instr: instr,
|
|
270
|
+
inPort: inPort,
|
|
271
|
+
ramRdata: ramRdata,
|
|
272
|
+
regs: regs.map(function (rg) { return rg.idx; }),
|
|
273
|
+
pc: pc.idx,
|
|
274
|
+
out: outp.idx,
|
|
275
|
+
ramAddr: ramAddr.idx,
|
|
276
|
+
ramWdata: ramWdata.idx,
|
|
277
|
+
ramWe: ramWe.idx[0],
|
|
278
|
+
halt: halt.idx[0],
|
|
279
|
+
cf: cf.idx[0],
|
|
280
|
+
zf: zf.idx[0],
|
|
281
|
+
// Not read by machine.js, but it is real architectural state and the
|
|
282
|
+
// verifier drives it directly, so it is exported rather than hidden.
|
|
283
|
+
ldPhase: ldPhase.idx[0],
|
|
284
|
+
width: W,
|
|
285
|
+
cost: cost,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
module.exports = { buildST8: buildST8, OP: OP };
|
package/lib/st8-data.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// ST-8 netlist. Generated by tools/build-netlist.js; do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// 2,161 NAND gates and 167 flip-flops, composed structurally from a
|
|
4
|
+
// single primitive, then optimised: 2,425 placed, 264 removed (10.9%).
|
|
5
|
+
// Emitted in topological order, which is free here: a gate can only name
|
|
6
|
+
// nets that already exist.
|
|
7
|
+
//
|
|
8
|
+
// Every gate here was placed by tools/netlist/st8.js, one nand() call at a
|
|
9
|
+
// time. `npm run silicon` rebuilds it and refuses to write this file unless
|
|
10
|
+
// all four checks pass, run against this optimised netlist rather than the
|
|
11
|
+
// naive one.
|
|
12
|
+
//
|
|
13
|
+
// Verified: 1,052,672 exhaustive ALU vectors, 20,000 cycles of ledger and
|
|
14
|
+
// every cycle of selftest against an independent behavioural model, through the
|
|
15
|
+
// same machine.js the browser loads.
|
|
16
|
+
window.ST8_DATA = {"nets":2371,"zero":0,"one":1,"gateCount":2161,"flopCount":167,"gates":[22,22,210,23,23,211,210,211,212,212,212,213,210,23,214,214,214,215,22,211,216,216,216,217,22,23,218,218,218,219,24,24,220,213,220,221,221,221,222,213,24,223,223,223,224,217,220,225,225,225,226,217,24,227,227,227,228,215,220,229,229,229,230,215,24,231,231,231,232,219,220,233,233,233,234,219,24,235,235,235,236,25,25,237,222,237,238,238,238,239,222,25,240,240,240,241,226,237,242,242,242,243,226,25,244,244,244,245,230,237,246,246,246,247,230,25,248,248,248,249,234,237,250,250,250,251,234,25,252,252,252,253,224,237,254,254,254,255,224,25,256,256,256,257,228,237,258,258,258,259,228,25,260,260,260,261,232,237,262,262,262,263,232,25,264,264,264,265,236,237,266,266,266,267,236,25,268,268,268,269,26,26,270,239,26,271,243,270,272,272,272,273,243,26,274,247,270,275,275,275,276,247,26,277,251,270,278,251,26,279,279,279,280,255,270,281,281,281,282,255,26,283,283,283,284,259,270,285,259,26,286,286,286,287,263,270,288,288,288,289,263,26,290,290,290,291,267,270,292,267,26,293,241,270,294,294,294,295,241,26,296,296,296,297,245,270,298,298,298,299,245,26,300,300,300,301,249,270,302,302,302,303,249,26,304,304,304,305,253,270,306,306,306,307,253,26,308,308,308,309,257,270,310,257,26,311,261,270,312,261,26,313,265,270,314,314,314,315,265,26,316,316,316,317,269,270,318,318,318,319,269,26,320,320,320,321,18,18,322,19,19,323,322,323,324,324,324,325,322,19,326,326,326,327,18,323,328,328,328,329,18,19,330,330,330,331,20,20,332,325,332,333,333,333,334,325,20,335,335,335,336,329,332,337,337,337,338,329,20,339,339,339,340,327,332,341,341,341,342,327,20,343,343,343,344,331,332,345,345,345,346,331,20,347,347,347,348,21,21,349,334,349,350,350,350,351,334,21,352,352,352,353,338,349,354,354,354,355,338,21,356,356,356,357,342,349,358,358,358,359,342,21,360,360,360,361,346,349,362,362,362,363,346,21,364,364,364,365,336,349,366,366,366,367,336,21,368,368,368,369,340,349,370,370,370,371,340,21,372,372,372,373,344,349,374,374,374,375,344,21,376,376,376,377,348,349,378,378,378,379,348,21,380,380,380,381,191,191,382,43,351,383,51,355,384,59,359,385,67,363,386,75,367,387,83,371,388,91,375,389,99,379,390,107,353,391,115,357,392,123,361,393,131,365,394,139,369,395,147,373,396,155,377,397,163,381,398,383,384,399,399,399,400,385,386,401,401,401,402,387,388,403,403,403,404,389,390,405,405,405,406,400,402,407,407,407,408,404,406,409,409,409,410,408,410,411,411,411,412,391,392,413,413,413,414,393,394,415,415,415,416,395,396,417,417,417,418,397,398,419,419,419,420,414,416,421,421,421,422,418,420,423,423,423,424,422,424,425,425,425,426,412,426,427,14,14,428,43,428,429,51,14,430,429,430,431,59,428,432,67,14,433,432,433,434,75,428,435,83,14,436,435,436,437,91,428,438,99,14,439,438,439,440,107,428,441,115,14,442,441,442,443,123,428,444,131,14,445,444,445,446,139,428,447,147,14,448,447,448,449,155,428,450,163,14,451,450,451,452,15,15,453,431,453,454,434,15,455,454,455,456,437,453,457,440,15,458,457,458,459,443,453,460,446,15,461,460,461,462,449,453,463,452,15,464,463,464,465,16,16,466,456,466,467,459,16,468,467,468,469,462,466,470,465,16,471,470,471,472,17,17,473,469,473,474,472,17,475,474,475,476,44,351,477,52,355,478,60,359,479,68,363,480,76,367,481,84,371,482,92,375,483,100,379,484,108,353,485,116,357,486,124,361,487,132,365,488,140,369,489,148,373,490,156,377,491,164,381,492,477,478,493,493,493,494,479,480,495,495,495,496,481,482,497,497,497,498,483,484,499,499,499,500,494,496,501,501,501,502,498,500,503,503,503,504,502,504,505,505,505,506,485,486,507,507,507,508,487,488,509,509,509,510,489,490,511,511,511,512,491,492,513,513,513,514,508,510,515,515,515,516,512,514,517,517,517,518,516,518,519,519,519,520,506,520,521,44,428,522,52,14,523,522,523,524,60,428,525,68,14,526,525,526,527,76,428,528,84,14,529,528,529,530,92,428,531,100,14,532,531,532,533,108,428,534,116,14,535,534,535,536,124,428,537,132,14,538,537,538,539,140,428,540,148,14,541,540,541,542,156,428,543,164,14,544,543,544,545,524,453,546,527,15,547,546,547,548,530,453,549,533,15,550,549,550,551,536,453,552,539,15,553,552,553,554,542,453,555,545,15,556,555,556,557,548,466,558,551,16,559,558,559,560,554,466,561,557,16,562,561,562,563,560,473,564,563,17,565,564,565,566,45,351,567,53,355,568,61,359,569,69,363,570,77,367,571,85,371,572,93,375,573,101,379,574,109,353,575,117,357,576,125,361,577,133,365,578,141,369,579,149,373,580,157,377,581,165,381,582,567,568,583,583,583,584,569,570,585,585,585,586,571,572,587,587,587,588,573,574,589,589,589,590,584,586,591,591,591,592,588,590,593,593,593,594,592,594,595,595,595,596,575,576,597,597,597,598,577,578,599,599,599,600,579,580,601,601,601,602,581,582,603,603,603,604,598,600,605,605,605,606,602,604,607,607,607,608,606,608,609,609,609,610,596,610,611,45,428,612,53,14,613,612,613,614,61,428,615,69,14,616,615,616,617,77,428,618,85,14,619,618,619,620,93,428,621,101,14,622,621,622,623,109,428,624,117,14,625,624,625,626,125,428,627,133,14,628,627,628,629,141,428,630,149,14,631,630,631,632,157,428,633,165,14,634,633,634,635,614,453,636,617,15,637,636,637,638,620,453,639,623,15,640,639,640,641,626,453,642,629,15,643,642,643,644,632,453,645,635,15,646,645,646,647,638,466,648,641,16,649,648,649,650,644,466,651,647,16,652,651,652,653,650,473,654,653,17,655,654,655,656,46,351,657,54,355,658,62,359,659,70,363,660,78,367,661,86,371,662,94,375,663,102,379,664,110,353,665,118,357,666,126,361,667,134,365,668,142,369,669,150,373,670,158,377,671,166,381,672,657,658,673,673,673,674,659,660,675,675,675,676,661,662,677,677,677,678,663,664,679,679,679,680,674,676,681,681,681,682,678,680,683,683,683,684,682,684,685,685,685,686,665,666,687,687,687,688,667,668,689,689,689,690,669,670,691,691,691,692,671,672,693,693,693,694,688,690,695,695,695,696,692,694,697,697,697,698,696,698,699,699,699,700,686,700,701,46,428,702,54,14,703,702,703,704,62,428,705,70,14,706,705,706,707,78,428,708,86,14,709,708,709,710,94,428,711,102,14,712,711,712,713,110,428,714,118,14,715,714,715,716,126,428,717,134,14,718,717,718,719,142,428,720,150,14,721,720,721,722,158,428,723,166,14,724,723,724,725,704,453,726,707,15,727,726,727,728,710,453,729,713,15,730,729,730,731,716,453,732,719,15,733,732,733,734,722,453,735,725,15,736,735,736,737,728,466,738,731,16,739,738,739,740,734,466,741,737,16,742,741,742,743,740,473,744,743,17,745,744,745,746,47,351,747,55,355,748,63,359,749,71,363,750,79,367,751,87,371,752,95,375,753,103,379,754,111,353,755,119,357,756,127,361,757,135,365,758,143,369,759,151,373,760,159,377,761,167,381,762,747,748,763,763,763,764,749,750,765,765,765,766,751,752,767,767,767,768,753,754,769,769,769,770,764,766,771,771,771,772,768,770,773,773,773,774,772,774,775,775,775,776,755,756,777,777,777,778,757,758,779,779,779,780,759,760,781,781,781,782,761,762,783,783,783,784,778,780,785,785,785,786,782,784,787,787,787,788,786,788,789,789,789,790,776,790,791,47,428,792,55,14,793,792,793,794,63,428,795,71,14,796,795,796,797,79,428,798,87,14,799,798,799,800,95,428,801,103,14,802,801,802,803,111,428,804,119,14,805,804,805,806,127,428,807,135,14,808,807,808,809,143,428,810,151,14,811,810,811,812,159,428,813,167,14,814,813,814,815,794,453,816,797,15,817,816,817,818,800,453,819,803,15,820,819,820,821,806,453,822,809,15,823,822,823,824,812,453,825,815,15,826,825,826,827,818,466,828,821,16,829,828,829,830,824,466,831,827,16,832,831,832,833,830,473,834,833,17,835,834,835,836,48,351,837,56,355,838,64,359,839,72,363,840,80,367,841,88,371,842,96,375,843,104,379,844,112,353,845,120,357,846,128,361,847,136,365,848,144,369,849,152,373,850,160,377,851,168,381,852,837,838,853,853,853,854,839,840,855,855,855,856,841,842,857,857,857,858,843,844,859,859,859,860,854,856,861,861,861,862,858,860,863,863,863,864,862,864,865,865,865,866,845,846,867,867,867,868,847,848,869,869,869,870,849,850,871,871,871,872,851,852,873,873,873,874,868,870,875,875,875,876,872,874,877,877,877,878,876,878,879,879,879,880,866,880,881,48,428,882,56,14,883,882,883,884,64,428,885,72,14,886,885,886,887,80,428,888,88,14,889,888,889,890,96,428,891,104,14,892,891,892,893,112,428,894,120,14,895,894,895,896,128,428,897,136,14,898,897,898,899,144,428,900,152,14,901,900,901,902,160,428,903,168,14,904,903,904,905,884,453,906,887,15,907,906,907,908,890,453,909,893,15,910,909,910,911,896,453,912,899,15,913,912,913,914,902,453,915,905,15,916,915,916,917,908,466,918,911,16,919,918,919,920,914,466,921,917,16,922,921,922,923,920,473,924,923,17,925,924,925,926,49,351,927,57,355,928,65,359,929,73,363,930,81,367,931,89,371,932,97,375,933,105,379,934,113,353,935,121,357,936,129,361,937,137,365,938,145,369,939,153,373,940,161,377,941,169,381,942,927,928,943,943,943,944,929,930,945,945,945,946,931,932,947,947,947,948,933,934,949,949,949,950,944,946,951,951,951,952,948,950,953,953,953,954,952,954,955,955,955,956,935,936,957,957,957,958,937,938,959,959,959,960,939,940,961,961,961,962,941,942,963,963,963,964,958,960,965,965,965,966,962,964,967,967,967,968,966,968,969,969,969,970,956,970,971,49,428,972,57,14,973,972,973,974,65,428,975,73,14,976,975,976,977,81,428,978,89,14,979,978,979,980,97,428,981,105,14,982,981,982,983,113,428,984,121,14,985,984,985,986,129,428,987,137,14,988,987,988,989,145,428,990,153,14,991,990,991,992,161,428,993,169,14,994,993,994,995,974,453,996,977,15,997,996,997,998,980,453,999,983,15,1000,999,1000,1001,986,453,1002,989,15,1003,1002,1003,1004,992,453,1005,995,15,1006,1005,1006,1007,998,466,1008,1001,16,1009,1008,1009,1010,1004,466,1011,1007,16,1012,1011,1012,1013,1010,473,1014,1013,17,1015,1014,1015,1016,50,351,1017,58,355,1018,66,359,1019,74,363,1020,82,367,1021,90,371,1022,98,375,1023,106,379,1024,114,353,1025,122,357,1026,130,361,1027,138,365,1028,146,369,1029,154,373,1030,162,377,1031,170,381,1032,1017,1018,1033,1033,1033,1034,1019,1020,1035,1035,1035,1036,1021,1022,1037,1037,1037,1038,1023,1024,1039,1039,1039,1040,1034,1036,1041,1041,1041,1042,1038,1040,1043,1043,1043,1044,1042,1044,1045,1045,1045,1046,1025,1026,1047,1047,1047,1048,1027,1028,1049,1049,1049,1050,1029,1030,1051,1051,1051,1052,1031,1032,1053,1053,1053,1054,1048,1050,1055,1055,1055,1056,1052,1054,1057,1057,1057,1058,1056,1058,1059,1059,1059,1060,1046,1060,1061,50,428,1062,58,14,1063,1062,1063,1064,66,428,1065,74,14,1066,1065,1066,1067,82,428,1068,90,14,1069,1068,1069,1070,98,428,1071,106,14,1072,1071,1072,1073,114,428,1074,122,14,1075,1074,1075,1076,130,428,1077,138,14,1078,1077,1078,1079,146,428,1080,154,14,1081,1080,1081,1082,162,428,1083,170,14,1084,1083,1084,1085,1064,453,1086,1067,15,1087,1086,1087,1088,1070,453,1089,1073,15,1090,1089,1090,1091,1076,453,1092,1079,15,1093,1092,1093,1094,1082,453,1095,1085,15,1096,1095,1096,1097,1088,466,1098,1091,16,1099,1098,1099,1100,1094,466,1101,1097,16,1102,1101,1102,1103,1100,473,1104,1103,17,1105,1104,1105,1106,278,281,1107,285,288,1108,1107,1107,1109,1108,1108,1110,1109,1110,1111,1111,1111,1112,1112,277,1113,277,274,1114,1114,1114,1115,1110,1115,1116,476,1113,1117,1117,1117,1118,1118,1116,1119,1118,1119,1120,1116,1119,1121,1120,1121,1122,566,1113,1123,1123,1123,1124,1124,1116,1125,1124,1125,1126,1116,1125,1127,1126,1127,1128,656,1113,1129,1129,1129,1130,1130,1116,1131,1130,1131,1132,1116,1131,1133,1132,1133,1134,746,1113,1135,1135,1135,1136,1136,1116,1137,1136,1137,1138,1116,1137,1139,1138,1139,1140,836,1113,1141,1141,1141,1142,1142,1116,1143,1142,1143,1144,1116,1143,1145,1144,1145,1146,926,1113,1147,1147,1147,1148,1148,1116,1149,1148,1149,1150,1116,1149,1151,1150,1151,1152,1016,1113,1153,1153,1153,1154,1154,1116,1155,1154,1155,1156,1116,1155,1157,1156,1157,1158,1106,1113,1159,1159,1159,1160,1160,1116,1161,1160,1161,1162,1116,1161,1163,1162,1163,1164,189,189,1165,282,189,1166,289,1165,1167,1166,285,1168,277,271,1169,1168,1168,1170,1169,1169,1171,1170,1171,1172,1172,1172,1173,1173,1167,1174,427,1122,1175,427,1175,1176,1122,1175,1177,1176,1177,1178,1178,1174,1179,1178,1179,1180,1174,1179,1181,1180,1181,1182,1175,1179,1183,521,1128,1184,521,1184,1185,1128,1184,1186,1185,1186,1187,1187,1183,1188,1187,1188,1189,1183,1188,1190,1189,1190,1191,1184,1188,1192,611,1134,1193,611,1193,1194,1134,1193,1195,1194,1195,1196,1196,1192,1197,1196,1197,1198,1192,1197,1199,1198,1199,1200,1193,1197,1201,701,1140,1202,701,1202,1203,1140,1202,1204,1203,1204,1205,1205,1201,1206,1205,1206,1207,1201,1206,1208,1207,1208,1209,1202,1206,1210,791,1146,1211,791,1211,1212,1146,1211,1213,1212,1213,1214,1214,1210,1215,1214,1215,1216,1210,1215,1217,1216,1217,1218,1211,1215,1219,881,1152,1220,881,1220,1221,1152,1220,1222,1221,1222,1223,1223,1219,1224,1223,1224,1225,1219,1224,1226,1225,1226,1227,1220,1224,1228,971,1158,1229,971,1229,1230,1158,1229,1231,1230,1231,1232,1232,1228,1233,1232,1233,1234,1228,1233,1235,1234,1235,1236,1229,1233,1237,1061,1164,1238,1061,1238,1239,1164,1238,1240,1239,1240,1241,1241,1237,1242,1241,1242,1243,1237,1242,1244,1243,1244,1245,1238,1242,1246,427,476,1247,1247,1247,1248,427,427,1249,476,476,1250,1249,1250,1251,427,1247,1252,476,1247,1253,1252,1253,1254,521,566,1255,1255,1255,1256,521,521,1257,566,566,1258,1257,1258,1259,521,1255,1260,566,1255,1261,1260,1261,1262,611,656,1263,1263,1263,1264,611,611,1265,656,656,1266,1265,1266,1267,611,1263,1268,656,1263,1269,1268,1269,1270,701,746,1271,1271,1271,1272,701,701,1273,746,746,1274,1273,1274,1275,701,1271,1276,746,1271,1277,1276,1277,1278,791,836,1279,1279,1279,1280,791,791,1281,836,836,1282,1281,1282,1283,791,1279,1284,836,1279,1285,1284,1285,1286,881,926,1287,1287,1287,1288,881,881,1289,926,926,1290,1289,1290,1291,881,1287,1292,926,1287,1293,1292,1293,1294,971,1016,1295,1295,1295,1296,971,971,1297,1016,1016,1298,1297,1298,1299,971,1295,1300,1016,1295,1301,1300,1301,1302,1061,1106,1303,1303,1303,1304,1061,1061,1305,1106,1106,1306,1305,1306,1307,1061,1303,1308,1106,1303,1309,1308,1309,1310,310,314,1311,312,318,1312,189,315,1313,1313,1313,1314,189,319,1315,1315,1315,1316,271,274,1317,1317,1317,1318,1318,277,1319,1319,1319,1320,1112,1320,1321,280,209,1322,1322,1322,1323,292,313,1324,1182,1321,1325,1248,1324,1326,1251,295,1327,1254,299,1328,1247,303,1329,1249,307,1330,1314,1311,1331,521,1312,1332,791,317,1333,476,276,1334,2,273,1335,27,287,1336,35,1323,1337,1325,1326,1338,1338,1338,1339,1327,1328,1340,1340,1340,1341,1329,1330,1342,1342,1342,1343,1339,1341,1344,1344,1344,1345,1343,1331,1346,1346,1346,1347,1345,1347,1348,1348,1348,1349,1332,1333,1350,1350,1350,1351,1334,1335,1352,1352,1352,1353,1336,1337,1354,1354,1354,1355,1351,1353,1356,1356,1356,1357,1357,1355,1358,1358,1358,1359,1349,1359,1360,1191,1321,1361,1256,1324,1362,1259,295,1363,1262,299,1364,1255,303,1365,1257,307,1366,427,1311,1367,611,1312,1368,881,317,1369,566,276,1370,3,273,1371,28,287,1372,36,1323,1373,1361,1362,1374,1374,1374,1375,1363,1364,1376,1376,1376,1377,1365,1366,1378,1378,1378,1379,1375,1377,1380,1380,1380,1381,1379,1367,1382,1382,1382,1383,1381,1383,1384,1384,1384,1385,1368,1369,1386,1386,1386,1387,1370,1371,1388,1388,1388,1389,1372,1373,1390,1390,1390,1391,1387,1389,1392,1392,1392,1393,1393,1391,1394,1394,1394,1395,1385,1395,1396,1200,1321,1397,1264,1324,1398,1267,295,1399,1270,299,1400,1263,303,1401,1265,307,1402,521,1311,1403,701,1312,1404,971,317,1405,656,276,1406,4,273,1407,29,287,1408,37,1323,1409,1397,1398,1410,1410,1410,1411,1399,1400,1412,1412,1412,1413,1401,1402,1414,1414,1414,1415,1411,1413,1416,1416,1416,1417,1415,1403,1418,1418,1418,1419,1417,1419,1420,1420,1420,1421,1404,1405,1422,1422,1422,1423,1406,1407,1424,1424,1424,1425,1408,1409,1426,1426,1426,1427,1423,1425,1428,1428,1428,1429,1429,1427,1430,1430,1430,1431,1421,1431,1432,1209,1321,1433,1272,1324,1434,1275,295,1435,1278,299,1436,1271,303,1437,1273,307,1438,611,1311,1439,791,1312,1440,1061,317,1441,746,276,1442,5,273,1443,30,287,1444,38,1323,1445,1433,1434,1446,1446,1446,1447,1435,1436,1448,1448,1448,1449,1437,1438,1450,1450,1450,1451,1447,1449,1452,1452,1452,1453,1451,1439,1454,1454,1454,1455,1453,1455,1456,1456,1456,1457,1440,1441,1458,1458,1458,1459,1442,1443,1460,1460,1460,1461,1444,1445,1462,1462,1462,1463,1459,1461,1464,1464,1464,1465,1465,1463,1466,1466,1466,1467,1457,1467,1468,1218,1321,1469,1280,1324,1470,1283,295,1471,1286,299,1472,1279,303,1473,1281,307,1474,701,1311,1475,881,1312,1476,427,317,1477,836,276,1478,6,273,1479,31,287,1480,39,1323,1481,1469,1470,1482,1482,1482,1483,1471,1472,1484,1484,1484,1485,1473,1474,1486,1486,1486,1487,1483,1485,1488,1488,1488,1489,1487,1475,1490,1490,1490,1491,1489,1491,1492,1492,1492,1493,1476,1477,1494,1494,1494,1495,1478,1479,1496,1496,1496,1497,1480,1481,1498,1498,1498,1499,1495,1497,1500,1500,1500,1501,1501,1499,1502,1502,1502,1503,1493,1503,1504,1227,1321,1505,1288,1324,1506,1291,295,1507,1294,299,1508,1287,303,1509,1289,307,1510,791,1311,1511,971,1312,1512,521,317,1513,926,276,1514,7,273,1515,32,287,1516,40,1323,1517,1505,1506,1518,1518,1518,1519,1507,1508,1520,1520,1520,1521,1509,1510,1522,1522,1522,1523,1519,1521,1524,1524,1524,1525,1523,1511,1526,1526,1526,1527,1525,1527,1528,1528,1528,1529,1512,1513,1530,1530,1530,1531,1514,1515,1532,1532,1532,1533,1516,1517,1534,1534,1534,1535,1531,1533,1536,1536,1536,1537,1537,1535,1538,1538,1538,1539,1529,1539,1540,1236,1321,1541,1296,1324,1542,1299,295,1543,1302,299,1544,1295,303,1545,1297,307,1546,881,1311,1547,1061,1312,1548,611,317,1549,1016,276,1550,8,273,1551,33,287,1552,41,1323,1553,1541,1542,1554,1554,1554,1555,1543,1544,1556,1556,1556,1557,1545,1546,1558,1558,1558,1559,1555,1557,1560,1560,1560,1561,1559,1547,1562,1562,1562,1563,1561,1563,1564,1564,1564,1565,1548,1549,1566,1566,1566,1567,1550,1551,1568,1568,1568,1569,1552,1553,1570,1570,1570,1571,1567,1569,1572,1572,1572,1573,1573,1571,1574,1574,1574,1575,1565,1575,1576,1245,1321,1577,1304,1324,1578,1307,295,1579,1310,299,1580,1303,303,1581,1305,307,1582,971,1311,1583,1316,1312,1584,701,317,1585,1106,276,1586,9,273,1587,34,287,1588,42,1323,1589,1577,1578,1590,1590,1590,1591,1579,1580,1592,1592,1592,1593,1581,1582,1594,1594,1594,1595,1591,1593,1596,1596,1596,1597,1595,1583,1598,1598,1598,1599,1597,1599,1600,1600,1600,1601,1584,1585,1602,1602,1602,1603,1586,1587,1604,1604,1604,1605,1588,1589,1606,1606,1606,1607,1603,1605,1608,1608,1608,1609,1609,1607,1610,1610,1610,1611,1601,1611,1612,272,275,1613,292,294,1614,298,302,1615,306,310,1616,312,314,1617,318,271,1618,274,286,1619,316,1322,1620,1613,1613,1621,1621,1109,1622,1614,1614,1623,1110,1623,1624,1615,1615,1625,1616,1616,1626,1625,1626,1627,1617,1617,1628,1618,1618,1629,1628,1629,1630,1619,1619,1631,1620,1620,1632,1631,1632,1633,1622,1622,1634,1624,1624,1635,1634,1635,1636,1627,1627,1637,1630,1630,1638,1637,1638,1639,1636,1636,1640,1639,1639,1641,1640,1641,1642,1642,1642,1643,1633,1633,1644,1643,1644,1645,1645,382,1646,1646,1646,1647,351,1647,1648,1648,1648,1649,43,1648,1650,1360,1649,1651,1650,1651,1652,44,1648,1653,1396,1649,1654,1653,1654,1655,45,1648,1656,1432,1649,1657,1656,1657,1658,46,1648,1659,1468,1649,1660,1659,1660,1661,47,1648,1662,1504,1649,1663,1662,1663,1664,48,1648,1665,1540,1649,1666,1665,1666,1667,49,1648,1668,1576,1649,1669,1668,1669,1670,50,1648,1671,1612,1649,1672,1671,1672,1673,355,1647,1674,1674,1674,1675,51,1674,1676,1360,1675,1677,1676,1677,1678,52,1674,1679,1396,1675,1680,1679,1680,1681,53,1674,1682,1432,1675,1683,1682,1683,1684,54,1674,1685,1468,1675,1686,1685,1686,1687,55,1674,1688,1504,1675,1689,1688,1689,1690,56,1674,1691,1540,1675,1692,1691,1692,1693,57,1674,1694,1576,1675,1695,1694,1695,1696,58,1674,1697,1612,1675,1698,1697,1698,1699,359,1647,1700,1700,1700,1701,59,1700,1702,1360,1701,1703,1702,1703,1704,60,1700,1705,1396,1701,1706,1705,1706,1707,61,1700,1708,1432,1701,1709,1708,1709,1710,62,1700,1711,1468,1701,1712,1711,1712,1713,63,1700,1714,1504,1701,1715,1714,1715,1716,64,1700,1717,1540,1701,1718,1717,1718,1719,65,1700,1720,1576,1701,1721,1720,1721,1722,66,1700,1723,1612,1701,1724,1723,1724,1725,363,1647,1726,1726,1726,1727,67,1726,1728,1360,1727,1729,1728,1729,1730,68,1726,1731,1396,1727,1732,1731,1732,1733,69,1726,1734,1432,1727,1735,1734,1735,1736,70,1726,1737,1468,1727,1738,1737,1738,1739,71,1726,1740,1504,1727,1741,1740,1741,1742,72,1726,1743,1540,1727,1744,1743,1744,1745,73,1726,1746,1576,1727,1747,1746,1747,1748,74,1726,1749,1612,1727,1750,1749,1750,1751,367,1647,1752,1752,1752,1753,75,1752,1754,1360,1753,1755,1754,1755,1756,76,1752,1757,1396,1753,1758,1757,1758,1759,77,1752,1760,1432,1753,1761,1760,1761,1762,78,1752,1763,1468,1753,1764,1763,1764,1765,79,1752,1766,1504,1753,1767,1766,1767,1768,80,1752,1769,1540,1753,1770,1769,1770,1771,81,1752,1772,1576,1753,1773,1772,1773,1774,82,1752,1775,1612,1753,1776,1775,1776,1777,371,1647,1778,1778,1778,1779,83,1778,1780,1360,1779,1781,1780,1781,1782,84,1778,1783,1396,1779,1784,1783,1784,1785,85,1778,1786,1432,1779,1787,1786,1787,1788,86,1778,1789,1468,1779,1790,1789,1790,1791,87,1778,1792,1504,1779,1793,1792,1793,1794,88,1778,1795,1540,1779,1796,1795,1796,1797,89,1778,1798,1576,1779,1799,1798,1799,1800,90,1778,1801,1612,1779,1802,1801,1802,1803,375,1647,1804,1804,1804,1805,91,1804,1806,1360,1805,1807,1806,1807,1808,92,1804,1809,1396,1805,1810,1809,1810,1811,93,1804,1812,1432,1805,1813,1812,1813,1814,94,1804,1815,1468,1805,1816,1815,1816,1817,95,1804,1818,1504,1805,1819,1818,1819,1820,96,1804,1821,1540,1805,1822,1821,1822,1823,97,1804,1824,1576,1805,1825,1824,1825,1826,98,1804,1827,1612,1805,1828,1827,1828,1829,379,1647,1830,1830,1830,1831,99,1830,1832,1360,1831,1833,1832,1833,1834,100,1830,1835,1396,1831,1836,1835,1836,1837,101,1830,1838,1432,1831,1839,1838,1839,1840,102,1830,1841,1468,1831,1842,1841,1842,1843,103,1830,1844,1504,1831,1845,1844,1845,1846,104,1830,1847,1540,1831,1848,1847,1848,1849,105,1830,1850,1576,1831,1851,1850,1851,1852,106,1830,1853,1612,1831,1854,1853,1854,1855,353,1647,1856,1856,1856,1857,107,1856,1858,1360,1857,1859,1858,1859,1860,108,1856,1861,1396,1857,1862,1861,1862,1863,109,1856,1864,1432,1857,1865,1864,1865,1866,110,1856,1867,1468,1857,1868,1867,1868,1869,111,1856,1870,1504,1857,1871,1870,1871,1872,112,1856,1873,1540,1857,1874,1873,1874,1875,113,1856,1876,1576,1857,1877,1876,1877,1878,114,1856,1879,1612,1857,1880,1879,1880,1881,357,1647,1882,1882,1882,1883,115,1882,1884,1360,1883,1885,1884,1885,1886,116,1882,1887,1396,1883,1888,1887,1888,1889,117,1882,1890,1432,1883,1891,1890,1891,1892,118,1882,1893,1468,1883,1894,1893,1894,1895,119,1882,1896,1504,1883,1897,1896,1897,1898,120,1882,1899,1540,1883,1900,1899,1900,1901,121,1882,1902,1576,1883,1903,1902,1903,1904,122,1882,1905,1612,1883,1906,1905,1906,1907,361,1647,1908,1908,1908,1909,123,1908,1910,1360,1909,1911,1910,1911,1912,124,1908,1913,1396,1909,1914,1913,1914,1915,125,1908,1916,1432,1909,1917,1916,1917,1918,126,1908,1919,1468,1909,1920,1919,1920,1921,127,1908,1922,1504,1909,1923,1922,1923,1924,128,1908,1925,1540,1909,1926,1925,1926,1927,129,1908,1928,1576,1909,1929,1928,1929,1930,130,1908,1931,1612,1909,1932,1931,1932,1933,365,1647,1934,1934,1934,1935,131,1934,1936,1360,1935,1937,1936,1937,1938,132,1934,1939,1396,1935,1940,1939,1940,1941,133,1934,1942,1432,1935,1943,1942,1943,1944,134,1934,1945,1468,1935,1946,1945,1946,1947,135,1934,1948,1504,1935,1949,1948,1949,1950,136,1934,1951,1540,1935,1952,1951,1952,1953,137,1934,1954,1576,1935,1955,1954,1955,1956,138,1934,1957,1612,1935,1958,1957,1958,1959,369,1647,1960,1960,1960,1961,139,1960,1962,1360,1961,1963,1962,1963,1964,140,1960,1965,1396,1961,1966,1965,1966,1967,141,1960,1968,1432,1961,1969,1968,1969,1970,142,1960,1971,1468,1961,1972,1971,1972,1973,143,1960,1974,1504,1961,1975,1974,1975,1976,144,1960,1977,1540,1961,1978,1977,1978,1979,145,1960,1980,1576,1961,1981,1980,1981,1982,146,1960,1983,1612,1961,1984,1983,1984,1985,373,1647,1986,1986,1986,1987,147,1986,1988,1360,1987,1989,1988,1989,1990,148,1986,1991,1396,1987,1992,1991,1992,1993,149,1986,1994,1432,1987,1995,1994,1995,1996,150,1986,1997,1468,1987,1998,1997,1998,1999,151,1986,2000,1504,1987,2001,2000,2001,2002,152,1986,2003,1540,1987,2004,2003,2004,2005,153,1986,2006,1576,1987,2007,2006,2007,2008,154,1986,2009,1612,1987,2010,2009,2010,2011,377,1647,2012,2012,2012,2013,155,2012,2014,1360,2013,2015,2014,2015,2016,156,2012,2017,1396,2013,2018,2017,2018,2019,157,2012,2020,1432,2013,2021,2020,2021,2022,158,2012,2023,1468,2013,2024,2023,2024,2025,159,2012,2026,1504,2013,2027,2026,2027,2028,160,2012,2029,1540,2013,2030,2029,2030,2031,161,2012,2032,1576,2013,2033,2032,2033,2034,162,2012,2035,1612,2013,2036,2035,2036,2037,381,1647,2038,2038,2038,2039,163,2038,2040,1360,2039,2041,2040,2041,2042,164,2038,2043,1396,2039,2044,2043,2044,2045,165,2038,2046,1432,2039,2047,2046,2047,2048,166,2038,2049,1468,2039,2050,2049,2050,2051,167,2038,2052,1504,2039,2053,2052,2053,2054,168,2038,2055,1540,2039,2056,2055,2056,2057,169,2038,2058,1576,2039,2059,2058,2059,2060,170,2038,2061,1612,2039,2062,2061,2062,2063,313,316,2064,1623,1625,2065,1626,1628,2066,1629,1115,2067,2065,2065,2068,1112,2068,2069,2066,2066,2070,2067,2067,2071,2070,2071,2072,2069,2069,2073,2072,2072,2074,2073,2074,2075,2075,2075,2076,2064,2064,2077,2076,2077,2078,2078,382,2079,2079,2079,2080,1360,1360,2081,1396,1396,2082,2081,2082,2083,1432,1432,2084,1468,1468,2085,2084,2085,2086,1504,1504,2087,1540,1540,2088,2087,2088,2089,1576,1576,2090,1612,1612,2091,2090,2091,2092,2083,2083,2093,2086,2086,2094,2093,2094,2095,2089,2089,2096,2092,2092,2097,2096,2097,2098,2095,2095,2099,2098,2098,2100,2099,2100,2101,2101,2101,2102,1246,1321,2103,1061,1311,2104,427,1312,2105,2103,2104,2106,2106,2106,2107,2107,2105,2108,189,2079,2109,2108,2080,2110,2109,2110,2111,190,2079,2112,2102,2080,2113,2112,2113,2114,297,190,2115,190,190,2116,301,2116,2117,305,189,2118,309,1165,2119,293,320,2120,2115,2117,2121,2118,2119,2122,2120,2120,2123,2121,2121,2124,2123,2124,2125,2125,2125,2126,2122,2122,2127,2126,2127,2128,2,320,2129,427,321,2130,2129,2130,2131,3,320,2132,521,321,2133,2132,2133,2134,4,320,2135,611,321,2136,2135,2136,2137,5,320,2138,701,321,2139,2138,2139,2140,6,320,2141,791,321,2142,2141,2142,2143,7,320,2144,881,321,2145,2144,2145,2146,8,320,2147,971,321,2148,2147,2148,2149,9,320,2150,1061,321,2151,2150,2151,2152,10,320,2153,2153,2153,2154,11,320,2155,2155,2155,2156,171,171,2157,172,171,2158,172,2158,2159,171,2158,2160,2159,2160,2161,2158,2158,2162,173,2162,2163,173,2163,2164,2162,2163,2165,2164,2165,2166,2163,2163,2167,174,2167,2168,174,2168,2169,2167,2168,2170,2169,2170,2171,2168,2168,2172,175,2172,2173,175,2173,2174,2172,2173,2175,2174,2175,2176,2173,2173,2177,176,2177,2178,176,2178,2179,2177,2178,2180,2179,2180,2181,2178,2178,2182,177,2182,2183,177,2183,2184,2182,2183,2185,2184,2185,2186,2183,2183,2187,178,2187,2188,178,2188,2189,2187,2188,2190,2189,2190,2191,2188,2188,2192,179,2192,2193,179,2193,2194,2192,2193,2195,2194,2195,2196,2193,2193,2197,180,2197,2198,180,2198,2199,2197,2198,2200,2199,2200,2201,2128,2128,2202,2157,2202,2203,2131,2128,2204,2203,2204,2205,2161,2202,2206,2134,2128,2207,2206,2207,2208,2166,2202,2209,2137,2128,2210,2209,2210,2211,2171,2202,2212,2140,2128,2213,2212,2213,2214,2176,2202,2215,2143,2128,2216,2215,2216,2217,2181,2202,2218,2146,2128,2219,2218,2219,2220,2186,2202,2221,2149,2128,2222,2221,2222,2223,2191,2202,2224,2152,2128,2225,2224,2225,2226,2196,2202,2227,2154,2128,2228,2227,2228,2229,2201,2202,2230,2156,2128,2231,2230,2231,2232,209,209,2233,280,2233,2234,2234,2234,2235,382,2234,2236,2236,2236,2237,171,2236,2238,2205,2237,2239,2238,2239,2240,172,2236,2241,2208,2237,2242,2241,2242,2243,173,2236,2244,2211,2237,2245,2244,2245,2246,174,2236,2247,2214,2237,2248,2247,2248,2249,175,2236,2250,2217,2237,2251,2250,2251,2252,176,2236,2253,2220,2237,2254,2253,2254,2255,177,2236,2256,2223,2237,2257,2256,2257,2258,178,2236,2259,2226,2237,2260,2259,2260,2261,179,2236,2262,2229,2237,2263,2262,2263,2264,180,2236,2265,2232,2237,2266,2265,2266,2267,2235,382,2268,2268,2268,2269,284,382,2270,2270,2270,2271,192,2268,2272,476,2269,2273,2272,2273,2274,2274,2270,2275,427,2271,2276,2275,2276,2277,193,2268,2278,566,2269,2279,2278,2279,2280,2280,2270,2281,521,2271,2282,2281,2282,2283,194,2268,2284,656,2269,2285,2284,2285,2286,2286,2270,2287,611,2271,2288,2287,2288,2289,195,2268,2290,746,2269,2291,2290,2291,2292,2292,2270,2293,701,2271,2294,2293,2294,2295,196,2268,2296,836,2269,2297,2296,2297,2298,2298,2270,2299,791,2271,2300,2299,2300,2301,197,2268,2302,926,2269,2303,2302,2303,2304,2304,2270,2305,881,2271,2306,2305,2306,2307,198,2268,2308,1016,2269,2309,2308,2309,2310,2310,2270,2311,971,2271,2312,2311,2312,2313,199,2268,2314,1106,2269,2315,2314,2315,2316,2316,2270,2317,1061,2271,2318,2317,2318,2319,200,2270,2320,476,2271,2321,2320,2321,2322,201,2270,2323,566,2271,2324,2323,2324,2325,202,2270,2326,656,2271,2327,2326,2327,2328,203,2270,2329,746,2271,2330,2329,2330,2331,204,2270,2332,836,2271,2333,2332,2333,2334,205,2270,2335,926,2271,2336,2335,2336,2337,206,2270,2338,1016,2271,2339,2338,2339,2340,207,2270,2341,1106,2271,2342,2341,2342,2343,291,382,2344,2344,2344,2345,181,2344,2346,427,2345,2347,2346,2347,2348,182,2344,2349,521,2345,2350,2349,2350,2351,183,2344,2352,611,2345,2353,2352,2353,2354,184,2344,2355,701,2345,2356,2355,2356,2357,185,2344,2358,791,2345,2359,2358,2359,2360,186,2344,2361,881,2345,2362,2361,2362,2363,187,2344,2364,971,2345,2365,2364,2365,2366,188,2344,2367,1061,2345,2368,2367,2368,2369,382,311,2370],"flops":[1652,43,1655,44,1658,45,1661,46,1664,47,1667,48,1670,49,1673,50,1678,51,1681,52,1684,53,1687,54,1690,55,1693,56,1696,57,1699,58,1704,59,1707,60,1710,61,1713,62,1716,63,1719,64,1722,65,1725,66,1730,67,1733,68,1736,69,1739,70,1742,71,1745,72,1748,73,1751,74,1756,75,1759,76,1762,77,1765,78,1768,79,1771,80,1774,81,1777,82,1782,83,1785,84,1788,85,1791,86,1794,87,1797,88,1800,89,1803,90,1808,91,1811,92,1814,93,1817,94,1820,95,1823,96,1826,97,1829,98,1834,99,1837,100,1840,101,1843,102,1846,103,1849,104,1852,105,1855,106,1860,107,1863,108,1866,109,1869,110,1872,111,1875,112,1878,113,1881,114,1886,115,1889,116,1892,117,1895,118,1898,119,1901,120,1904,121,1907,122,1912,123,1915,124,1918,125,1921,126,1924,127,1927,128,1930,129,1933,130,1938,131,1941,132,1944,133,1947,134,1950,135,1953,136,1956,137,1959,138,1964,139,1967,140,1970,141,1973,142,1976,143,1979,144,1982,145,1985,146,1990,147,1993,148,1996,149,1999,150,2002,151,2005,152,2008,153,2011,154,2016,155,2019,156,2022,157,2025,158,2028,159,2031,160,2034,161,2037,162,2042,163,2045,164,2048,165,2051,166,2054,167,2057,168,2060,169,2063,170,2240,171,2243,172,2246,173,2249,174,2252,175,2255,176,2258,177,2261,178,2264,179,2267,180,2348,181,2351,182,2354,183,2357,184,2360,185,2363,186,2366,187,2369,188,2111,189,2114,190,2370,191,2277,192,2283,193,2289,194,2295,195,2301,196,2307,197,2313,198,2319,199,2322,200,2325,201,2328,202,2331,203,2334,204,2337,205,2340,206,2343,207,2271,208,2269,209],"instr":[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],"inPort":[27,28,29,30,31,32,33,34],"ramRdata":[35,36,37,38,39,40,41,42],"pc":[128,129,130,131,132,133,134,135,136,137],"out":[138,139,140,141,142,143,144,145],"ramAddr":[149,150,151,152,153,154,155,156],"ramWdata":[157,158,159,160,161,162,163,164],"ramWe":165,"halt":148,"regs":[[0,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]],"cf":146,"zf":147,"ldPhase":166,"ops":{"NOP":0,"LDI":1,"MOV":2,"ADD":3,"ADC":4,"SUB":5,"SBB":6,"AND":7,"OR":8,"XOR":9,"NAND":10,"NOT":11,"SHL":12,"SHR":13,"ROL":14,"ROR":15,"INC":16,"DEC":17,"CMP":18,"LD":19,"ST":20,"IN":21,"OUT":22,"JMP":23,"JZ":24,"JNZ":25,"JC":26,"JNC":27,"HLT":28,"TST":29,"SWAP":30,"JMPR":31},"blocks":{"decode":173,"regread":724,"alu":506,"regwrite":451,"flags":51,"pc":153,"mem":103},"blockOrder":["decode","regread","alu","regwrite","flags","pc","mem"],"gateBlock":"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333334444444444444444444444444444444444444444444444444445555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555556666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666","depth":[1,1,2,3,2,3,2,3,1,2,1,4,5,4,5,4,5,4,5,4,5,4,5,3,4,3,4,1,6,7,6,7,6,7,6,7,6,7,6,7,5,6,5,6,6,7,6,7,6,7,6,7,6,7,6,7,5,6,5,6,1,8,8,9,8,8,9,8,7,7,8,8,9,8,9,8,8,9,8,9,8,9,7,7,8,9,8,9,8,9,8,9,8,9,8,9,7,8,7,8,8,8,8,8,8,9,8,9,7,8,7,8,1,1,2,3,2,3,2,3,1,2,1,4,5,4,5,4,5,4,5,4,5,4,5,3,4,3,4,1,6,7,6,7,6,7,6,7,6,7,6,7,5,6,5,6,6,7,6,7,6,7,6,7,6,7,6,7,5,6,5,6,1,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,1,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,1,4,4,5,4,4,5,4,4,5,4,4,5,1,6,6,7,6,6,7,1,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,8,8,8,7,8,8,8,7,8,8,8,7,8,8,8,7,9,10,9,10,9,10,9,10,11,12,11,12,13,14,9,10,9,10,9,10,9,10,11,12,11,12,13,14,15,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,4,4,5,4,4,5,4,4,5,4,4,5,6,6,7,6,6,7,8,8,9,9,9,10,10,11,12,13,9,10,11,14,15,16,17,17,18,14,15,16,17,17,18,14,15,16,17,17,18,14,15,16,17,17,18,14,15,16,17,17,18,14,15,16,17,17,18,14,15,16,17,17,18,14,15,16,17,17,18,1,10,10,11,9,12,10,13,14,15,19,20,20,21,22,23,23,24,23,19,20,20,21,24,25,25,26,25,19,20,20,21,26,27,27,28,27,19,20,20,21,28,29,29,30,29,19,20,20,21,30,31,31,32,31,19,20,20,21,32,33,33,34,33,19,20,20,21,34,35,35,36,35,19,20,20,21,36,37,37,38,37,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,16,17,16,10,17,17,17,18,9,9,10,11,9,10,9,10,11,12,13,9,10,9,25,18,18,19,17,17,12,16,16,10,10,10,11,26,27,20,21,18,19,28,29,20,21,30,31,17,18,11,12,12,13,19,20,21,22,32,27,18,18,19,17,17,16,16,16,10,10,10,11,28,29,20,21,18,19,30,31,20,21,32,33,17,18,11,12,12,13,19,20,21,22,34,29,18,18,19,17,17,16,16,16,10,10,10,11,30,31,20,21,18,19,32,33,20,21,34,35,17,18,11,12,12,13,19,20,21,22,36,31,18,18,19,17,17,16,16,16,10,10,10,11,32,33,20,21,18,19,34,35,20,21,36,37,17,18,11,12,12,13,19,20,21,22,38,33,18,18,19,17,17,16,16,16,10,10,10,11,34,35,20,21,18,19,36,37,20,21,38,39,17,18,11,12,12,13,19,20,21,22,40,35,18,18,19,17,17,16,16,16,10,10,10,11,36,37,20,21,18,19,38,39,20,21,40,41,17,18,11,12,12,13,19,20,21,22,42,37,18,18,19,17,17,16,16,16,10,10,10,11,38,39,20,21,18,19,40,41,20,21,42,43,17,18,11,12,12,13,19,20,21,22,44,39,18,18,19,17,17,16,11,16,10,10,10,11,40,41,20,21,18,19,42,43,20,21,44,45,17,18,11,12,12,13,19,20,21,22,46,9,9,9,9,9,9,9,10,10,11,10,11,10,10,11,10,10,11,10,11,12,12,12,13,12,12,13,14,14,15,16,13,17,18,19,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,20,21,21,33,34,21,35,36,21,37,38,21,39,40,21,41,42,21,43,44,21,45,46,21,47,48,9,11,11,11,12,13,12,12,13,14,14,15,16,10,17,18,19,33,35,36,37,39,40,41,43,44,45,47,48,37,41,42,45,49,50,43,51,52,53,38,16,16,39,40,41,19,42,43,19,54,55,10,1,10,10,9,8,11,11,9,12,13,14,12,15,8,16,17,8,16,17,8,16,17,8,16,17,8,16,17,8,16,17,8,16,17,8,16,17,8,9,8,9,1,1,2,2,3,2,3,4,4,5,4,5,6,6,7,6,7,8,8,9,8,9,10,10,11,10,11,12,12,13,12,13,14,14,15,14,15,16,16,17,16,17,18,18,19,16,17,18,19,17,18,19,17,18,19,17,18,19,17,18,19,17,18,19,17,18,19,17,18,19,18,16,19,20,16,21,1,9,10,10,11,11,20,21,11,20,21,11,20,21,11,20,21,11,20,21,11,20,21,11,20,21,11,20,21,11,20,21,11,22,23,11,12,10,11,12,13,14,15,16,17,12,13,14,15,16,17,12,13,14,15,16,17,12,13,14,15,16,17,12,13,14,15,16,17,12,13,14,15,16,17,12,13,14,15,16,17,12,13,14,15,16,17,11,12,13,11,12,13,11,12,13,11,12,13,11,12,13,11,12,13,11,12,13,11,12,13,10,11,11,16,17,11,16,17,11,16,17,11,16,17,11,16,17,11,16,17,11,16,17,11,16,17,9],"programs":{"ledger":{"rom":[1179648,1245184,22020096,23068672,3276800,2170880,21172224,16973824,24117250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"labels":{"loop":2},"listing":[{"pc":0,"hex":"0120000","src":"ldi r2, #0"},{"pc":1,"hex":"0130000","src":"ldi r3, #0"},{"pc":2,"hex":"1500000","src":"in r0"},{"pc":3,"hex":"1600000","src":"out r0"},{"pc":4,"hex":"0320000","src":"add r2, r0"},{"pc":5,"hex":"0212000","src":"mov r1, r2"},{"pc":6,"hex":"1431000","src":"st [r3], r1"},{"pc":7,"hex":"1030000","src":"inc r3"},{"pc":8,"hex":"1700002","src":"jmp loop"}]},"selftest":{"rom":[1048776,1114212,3149824,28311580,23068672,1179692,18882560,26214428,1245424,1310735,8601600,23265280,11730944,26214428,1376257,12910592,12910592,1441796,19226624,26214428,1507344,1572987,21463040,20541440,19496960,26214428,23658496,29360128,1048831,23068672,29360128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"labels":{"fail":28},"listing":[{"pc":0,"hex":"01000c8","src":"ldi r0, #200"},{"pc":1,"hex":"0110064","src":"ldi r1, #100"},{"pc":2,"hex":"0301000","src":"add r0, r1"},{"pc":3,"hex":"1b0001c","src":"jnc fail"},{"pc":4,"hex":"1600000","src":"out r0"},{"pc":5,"hex":"012002c","src":"ldi r2, #44"},{"pc":6,"hex":"1202000","src":"cmp r0, r2"},{"pc":7,"hex":"190001c","src":"jnz fail"},{"pc":8,"hex":"01300f0","src":"ldi r3, #0xf0"},{"pc":9,"hex":"014000f","src":"ldi r4, #0x0f"},{"pc":10,"hex":"0834000","src":"or r3, r4"},{"pc":11,"hex":"1630000","src":"out r3"},{"pc":12,"hex":"0b30000","src":"not r3"},{"pc":13,"hex":"190001c","src":"jnz fail"},{"pc":14,"hex":"0150001","src":"ldi r5, #1"},{"pc":15,"hex":"0c50000","src":"shl r5"},{"pc":16,"hex":"0c50000","src":"shl r5"},{"pc":17,"hex":"0160004","src":"ldi r6, #4"},{"pc":18,"hex":"1256000","src":"cmp r5, r6"},{"pc":19,"hex":"190001c","src":"jnz fail"},{"pc":20,"hex":"0170010","src":"ldi r7, #16"},{"pc":21,"hex":"018007b","src":"ldi r8, #123"},{"pc":22,"hex":"1478000","src":"st [r7], r8"},{"pc":23,"hex":"1397000","src":"ld r9, [r7]"},{"pc":24,"hex":"1298000","src":"cmp r9, r8"},{"pc":25,"hex":"190001c","src":"jnz fail"},{"pc":26,"hex":"1690000","src":"out r9"},{"pc":27,"hex":"1c00000","src":"hlt"},{"pc":28,"hex":"01000ff","src":"ldi r0, #255"},{"pc":29,"hex":"1600000","src":"out r0"},{"pc":30,"hex":"1c00000","src":"hlt"}]}},"maxDepth":55};
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stepper-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The STEPPER ST-8 processor as a library: 2,161 NAND gates, an assembler, and a verifier that replays a chip's whole on-chain history and checks it.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js",
|
|
8
|
+
"lib/",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"NOTICE"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"cpu",
|
|
15
|
+
"processor",
|
|
16
|
+
"netlist",
|
|
17
|
+
"nand",
|
|
18
|
+
"ethereum",
|
|
19
|
+
"evm",
|
|
20
|
+
"verify"
|
|
21
|
+
],
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"homepage": "https://steppercpu.tech",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/steppercpu/stepper.git"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
}
|
|
31
|
+
}
|