From 5b6637fb92c54b8f367ec8751f53f6f238d8dbed Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 9 Apr 2023 18:26:25 +0300 Subject: Remake ALU --- digital/atk16_alu.dig | 2290 +++++++++++++++---------------------------------- 1 file changed, 695 insertions(+), 1595 deletions(-) (limited to 'digital/atk16_alu.dig') diff --git a/digital/atk16_alu.dig b/digital/atk16_alu.dig index d456fee..0f40f94 100644 --- a/digital/atk16_alu.dig +++ b/digital/atk16_alu.dig @@ -1,641 +1,706 @@ 2 - + + + romContent + + + + + + Width + 5 + + - 74382.dig - - - - - 74382.dig - - - - - 74382.dig - - - - - 74382.dig - - - - - VDD + Add - rotation - + Label + PLUS - - - - - VDD - - rotation - + Bits + 16 - + - VDD + Tunnel rotation - + - - - - - VDD - - rotation - + NetName + A - + - Ground + Tunnel rotation - + + + + NetName + B - + Ground + + + + + Tunnel - rotation - + NetName + Y - + - Ground + Tunnel - rotation - + NetName + FC - + - Ground + Driver - rotation - + Bits + 16 - + - Splitter + Tunnel - mirror - true - - - Input Splitting - 16 + rotation + - Output Splitting - 1*16 + NetName + S0 - + - In + Driver + + + + + Tunnel - Description - LHS of binary ALU operation - - - Label - A + rotation + - Bits - 16 + NetName + S0 - + - In + atk16_alu_fo.dig - - Description - RHS of binary ALU operation - Label - B - - - Bits - 16 + Overflow flag - + Tunnel + + rotation + + NetName - A0 + A - + Tunnel + + rotation + + NetName - A1 + B - + + + + Ground + + Tunnel NetName - A2 + Y - + Tunnel NetName - A3 + FC - + - Tunnel + Driver - NetName - A4 + Bits + 16 - + Tunnel + + rotation + + NetName - A5 + S1 - + + + + Driver + + Tunnel + + rotation + + NetName - A6 + S1 - + - Tunnel + Sub - NetName - A7 + Label + MINUS + + + Bits + 16 - + - Tunnel + And - NetName - A8 + Bits + 16 - + - Tunnel + Text - NetName - A9 + Description + AND - + Tunnel + + rotation + + NetName - A10 + A - + Tunnel + + rotation + + NetName - A11 + B - + - Tunnel + Driver - NetName - A12 + Bits + 16 - + Tunnel + + rotation + + NetName - A13 + S2 - + Tunnel NetName - A14 + Y - + - Tunnel + Or - NetName - A15 + Bits + 16 - + - In + Text Description - ALU operation code - - - Label - S - - - Bits - 4 + OR - + - Splitter + Tunnel - Input Splitting - 4 + rotation + - Output Splitting - 1*4 + NetName + A - + - Splitter + Tunnel - mirror - true - - - Input Splitting - 16 + rotation + - Output Splitting - 1*16 + NetName + B - + - Tunnel + Driver - NetName - B0 + Bits + 16 - + Tunnel + + rotation + + NetName - B1 + S3 - + Tunnel NetName - B2 + Y - + - Tunnel + XOr - NetName - B3 + Bits + 16 - + - Tunnel + Text - NetName - B4 + Description + XOR - + Tunnel + + rotation + + NetName - B5 + A - + Tunnel + + rotation + + NetName - B6 + B - + - Tunnel + Driver - NetName - B7 + Bits + 16 - + Tunnel + + rotation + + NetName - B8 + S4 - + Tunnel NetName - B9 + Y - + - Tunnel + BarrelShifter - NetName - B10 + Label + LOG SHIFT RIGHT + + + Bits + 16 + + + direction + right - + Tunnel + + rotation + + NetName - B11 + A - + Tunnel + + rotation + + NetName - B12 + B_L5 - + - Tunnel + Driver - NetName - B13 + Bits + 16 - + Tunnel + + rotation + + NetName - B14 + S5 - + Tunnel NetName - B15 + Y - + - Tunnel + BarrelShifter - rotation - + Label + ARI SHIFT RIGHT - NetName - A0 + Bits + 16 + + + barrelShifterMode + arithmetic + + + direction + right - + Tunnel rotation - + NetName - A1 + A + + + + + + Driver + + + Bits + 16 - + Tunnel + + rotation + + NetName - A2 + S6 - + Tunnel NetName - A3 + Y - + - Tunnel + BarrelShifter - rotation - + Label + LOG SHIFT LEFT - NetName - B0 + Bits + 16 - + Tunnel rotation - + NetName - B1 + A - + - Tunnel + Driver - NetName - B2 + Bits + 16 - + Tunnel + + rotation + + NetName - B3 + S7 - + Tunnel - - rotation - - NetName - Y0 + Y - + Tunnel @@ -646,30 +711,38 @@ NetName - Y1 + B_L5 - + Tunnel + + rotation + + NetName - Y2 + B_L5 - + Tunnel + + rotation + + NetName - Y3 + B15 - + Tunnel @@ -680,10 +753,10 @@ NetName - Y4 + Y15 - + Tunnel @@ -694,30 +767,30 @@ NetName - Y5 + A15 - + Tunnel NetName - Y6 + FO - + - Tunnel + Text - NetName - Y7 + Description + Sign flag - + Tunnel @@ -728,58 +801,54 @@ NetName - Y8 + Y15 - + Tunnel - - rotation - - NetName - Y9 + FS - + - Tunnel + atk16_alu_fz.dig - NetName - Y10 + Label + Zero flag - + Tunnel + + rotation + + NetName - Y11 + Y - + Tunnel - - rotation - - NetName - Y12 + FZ - + Tunnel @@ -790,325 +859,361 @@ NetName - Y13 + S1 - + - Tunnel + Testcase - NetName - Y14 + Label + PLUS test + + + Testdata + + A B S FLAGS Y +0x1 0x2 0 0b0000 0x3 +0xff 0x1 0 0b0000 0x100 +0x1 0xffff 0 0b0101 0x0 +0x4000 0x4000 0 0b1010 0x8000 + - + - Tunnel + Testcase - NetName - Y15 + Label + MINUS test + + + Testdata + + A B S FLAGS Y +0x10 0x1 1 0b0000 0xF +0x1 0x0 1 0b0000 0x1 +0x0 0x1 1 0b1001 0xFFFF +0x8000 0x1 1 0b0010 0x7FFF + - + - Tunnel + In - rotation - + Description + LHS of binary ALU operation - NetName - A4 + Label + A + + + Bits + 16 - + - Tunnel + In - rotation - + Description + RHS of binary ALU operation - NetName - A5 + Label + B + + + Bits + 16 - + - Tunnel + In - NetName - A6 + Description + ALU operation code + + + Label + S + + + Bits + 3 - + - Tunnel + Text - NetName - A7 + Description + S Y +0 A + B +1 A - B +2 A and B +3 A or B +4 A xor B +5 A >> B # logical +6 A >>> B # arithmetic +7 A << B - + - Tunnel + Decoder - rotation - + Selector Bits + 3 - NetName - A8 + flipSelPos + true - + Tunnel - - rotation - - NetName - A9 + S0 - + Tunnel NetName - A10 + S1 - + Tunnel NetName - A11 + S2 - + Tunnel - - rotation - - NetName - A12 + S3 - + Tunnel - - rotation - - NetName - A13 + S4 - + Tunnel NetName - A14 + S5 - + Tunnel NetName - A15 + S6 - + Tunnel - - rotation - - NetName - B4 + S7 - + Tunnel rotation - + NetName - B5 + A - + - Tunnel + Splitter - NetName - B6 + Input Splitting + 16 + + + Output Splitting + 15,1 - + Tunnel + + rotation + + NetName - B7 + B - + - Tunnel + Splitter - rotation - + Input Splitting + 16 - NetName - B8 + Output Splitting + 15,1 - + - Tunnel + Splitter - rotation - + Input Splitting + 16 - NetName - B9 + Output Splitting + 5 - + Tunnel NetName - B10 + B_L5 - + Tunnel NetName - B11 + A15 - + Tunnel - - rotation - - NetName - B12 + B15 - + - Tunnel + Splitter - rotation - + Input Splitting + 16 - NetName - B13 + Output Splitting + 15,1 - + Tunnel + + rotation + + NetName - B14 + Y - + Tunnel NetName - B15 + Y15 - + Out Description - ALU output + Output Label @@ -1119,67 +1224,63 @@ 16 - + - BarrelShifter + Splitter - Label - SRL - - - Bits - 16 + Input Splitting + 1*4 - direction - right + Output Splitting + 4 - + - Demultiplexer + Out - Selector Bits - 3 + Label + FLAGS Bits - 16 + 4 - + Tunnel rotation - + NetName - A + FO - + Tunnel rotation - + NetName - B + FZ - + Tunnel @@ -1190,1405 +1291,404 @@ NetName - A + FS - + - Splitter + Tunnel - Input Splitting - 16 + rotation + - Output Splitting - 5, + NetName + FC - + - Tunnel + PullDown rotation - - NetName - B - - - - - - BarrelShifter - - - Label - SRA - - - Bits - 16 - - - barrelShifterMode - arithmetic - - - direction - right - - - - - - BarrelShifter - - - Label - SLL - - - Bits - 16 - - - - - - Splitter - - - Input Splitting - 1*4 - - - Output Splitting - 4 - - - - - - Out - - - Label - FLAGS - - - Bits - 4 - - - - - - Splitter - - - splitterSpreading - 2 - - - Input Splitting - 16 - - - Output Splitting - 8*2 - - - - - - BitSelector - - - Selector Bits - 4 - - - - - - Const - - - rotation - - - - Value - 15 - - - Bits - 4 - - - - - - Splitter - - - splitterSpreading - 2 - - - Input Splitting - 8 - - - Output Splitting - 4*2 - - - - - - Testcase - - - Label - Add test 1 - - - Testdata - - A B S FLAGS Y -0x1 0x2 3 0b0000 0x3 -0xff 0x1 3 0b0000 0x100 -0x1 0xffff 3 0b0101 0x0 - - - - - - - Or - - - Bits - 8 - - - - - - Or - - - Bits - 4 - - - - - - Splitter - - - splitterSpreading - 2 - - - Input Splitting - 2 - - - Output Splitting - 1*2 - - - - - - Splitter - - - splitterSpreading - 2 - - - Input Splitting - 4 - - - Output Splitting - 2*2 - - - - - - Or - - - Bits - 2 - - - - - - NOr - - - - - Testcase - - - Label - Sub test 1 - - - Testdata - - A B S FLAGS Y -0x10 0x1 2 0b0001 0xF -0x1 0x0 1 0b1000 0xFFFF - - - - - - - atk16_alu_carryfix.dig - - - - - Multiplexer - - - flipSelPos - true - - - Bits - 16 - - - Selector Bits - 2 - - - - - - Ground - - - rotation - - - - Bits - 16 - - - - - - Splitter - - - rotation - - - - Input Splitting - 1,1 - - - Output Splitting - 2 - - - - - - Splitter - - - Input Splitting - 1*16 - - - Output Splitting - 16 - - - - - - Tunnel - - - rotation - - - - NetName - Y0 - - - - - - Tunnel - - - rotation - - - - NetName - Y1 - - - - - - Tunnel - - - rotation - - - - NetName - Y2 - - - - - - Tunnel - - - rotation - - - - NetName - Y3 - - - - - - Tunnel - - - rotation - - - - NetName - Y4 - - - - - - Tunnel - - - rotation - - - - NetName - Y5 - - - - - - Tunnel - - - rotation - - - - NetName - Y6 - - - - - - Tunnel - - - rotation - - - - NetName - Y7 - - - - - - Tunnel - - - rotation - - - - NetName - Y8 - - - - - - Tunnel - - - rotation - - - - NetName - Y9 - - - - - - Tunnel - - - rotation - - - - NetName - Y10 - - - - - - Tunnel - - - rotation - - - - NetName - Y11 - - - - - - Tunnel - - - rotation - - - - NetName - Y12 - - - - - - Tunnel - - - rotation - - - - NetName - Y13 - - - - - - Tunnel - - - rotation - - - - NetName - Y14 - - - - - - Tunnel - - - rotation - - - - NetName - Y15 - - - - - - Tunnel - - - NetName - ALU1 - - - - - - Multiplexer - - - flipSelPos - true - - - Bits - 16 - - - - - - Tunnel - - - NetName - ALU2 - - - - - - Tunnel - - - rotation - - - - NetName - ALU1 - - - - - - Tunnel - - - rotation - - - - NetName - ALU2 - - - - - - Splitter - - - rotation - - - - Input Splitting - 1,1,1 - - - Output Splitting - 3 - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - + - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + -- cgit v1.3