From b7980bd1f6f9351fc421807ddd48d9f3a76b19fd Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 14 Apr 2023 17:54:42 +0300 Subject: Start working on VGA circuit --- asm/bootstrap.atk16 | 8 +- digital/atk16.dig | 1066 ++++++++++++++++------------------------ digital/atk16_mem.dig | 2 +- digital/atk16_peripherals.dig | 852 ++++++++++++++++++++++++++++++++ digital/atk16_ppu.dig | 1078 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 2349 insertions(+), 657 deletions(-) create mode 100644 digital/atk16_peripherals.dig create mode 100644 digital/atk16_ppu.dig diff --git a/asm/bootstrap.atk16 b/asm/bootstrap.atk16 index 29ed0ea..5c6f38d 100644 --- a/asm/bootstrap.atk16 +++ b/asm/bootstrap.atk16 @@ -4,10 +4,10 @@ @let keyboard_addr 0xE001 @address vector_table - hlt_isr ; 0x10 ISR0 - hlt_isr ; 0x11 ISR1 - hlt_isr ; 0x12 ISR2 - keyboard_isr ; 0x13 ISR3 (keyboard) + keyboard_isr ; 0x10 ISR0 + hlt_isr ; 0x11 ISR1 + hlt_isr ; 0x12 ISR2 + hlt_isr ; 0x13 ISR3 stack_segment ; 0x14 Stack address 0x0 ; 0x15 Interrupt PC address (IPCA) terminal_addr ; 0x16 Terminal peripheral address diff --git a/digital/atk16.dig b/digital/atk16.dig index c2b1cf3..f79e909 100644 --- a/digital/atk16.dig +++ b/digital/atk16.dig @@ -142,93 +142,6 @@ - - Testcase - - - Label - Sum program TODO - - - Testdata - - IN OUT - -program(0x4051, 0x40a2, 0x029b) - -0 x - - - - - - - Out - - - Description - Dummy output - - - Label - OUT - - - - - - Ground - - - rotation - - - - - - - In - - - Label - IN - - - - - - Ground - - - rotation - - - - - - - Clock - - - small - true - - - runRealTime - true - - - Frequency - 100 - - - - - - Break - - - atk16_decoder.dig @@ -609,16 +522,6 @@ program(0x4051, 0x40a2, 0x029b) - - Tunnel - - - NetName - CLK - - - - Tunnel @@ -929,81 +832,6 @@ program(0x4051, 0x40a2, 0x029b) - - Splitter - - - Input Splitting - 1*4 - - - Output Splitting - 4 - - - - - - EEPROM - - - AddrBits - 8 - - - Label - UCODE - - - Bits - 24 - - - Data - c,221,3040,8000,4*0,c,221,3040,8000,4*0,c,221,3440,8000,4*0,c -,221,3440,8000,4*0,c,221,88,60,8000,0,0,0,c,221,88,60,8000,0,0,0 -,c,221,88,110,8000,0,0,0,c,221,88,110,8000,0,0,0,c,221,840,8000 -,4*0,c,221,840,8000,4*0,c,221,82,8000,4*0,c,221,82,8000,4*0,c -,221,c02,8000,4*0,c,221,c02,8000,4*0,c,221,8000,5*0,c,221,82,8000 -,4*0,c,221,8000,5*0,c,221,c02,8000,4*0,c,221,44,8000,4*0,c,221 -,44,8000,4*0,c,221,8000,5*0,c,221,8000,5*0,c,221,8000,5*0,c,221 -,8000,5*0,c0004,10008,22,8000,4*0,c0004,10008,22,8000,4*0,c0004 -,10008,22,8000,4*0,c0004,10008,22,8000,4*0,c,221,120002,8000,4*0 -,c,221,120002,8000,4*0,c,221,4000,5*0,c,221,4000 - - - - - - VDD - - - rotation - - - - - - - Ground - - - rotation - - - - - - - VDD - - - rotation - - - - - Tunnel @@ -1014,16 +842,6 @@ program(0x4051, 0x40a2, 0x029b) - - Tunnel - - - NetName - IT_N - - - - Tunnel @@ -1252,51 +1070,6 @@ program(0x4051, 0x40a2, 0x029b) - - RS_FF_AS - - - - - Ground - - - rotation - - - - - - - Ground - - - rotation - - - - - - - Ground - - - rotation - - - - - - - LED - - - rotation - - - - - Tunnel @@ -1350,66 +1123,49 @@ program(0x4051, 0x40a2, 0x029b) - Comparator + Probe - Bits - 13 + Label + MMIO_S - + - Const + Tunnel - Value - 0 - - - Bits - 13 + NetName + MMIO_IE - - - - And - - - - - Terminal - - + Tunnel - - rotation - - NetName - CLK + MMIO_OE - + Tunnel - - rotation - - NetName - DBUS + MMIO_S - + + + + atk16_peripherals.dig + + Tunnel @@ -1420,10 +1176,10 @@ program(0x4051, 0x40a2, 0x029b) NetName - MMIO_IE + MMIO_OE - + Tunnel @@ -1434,10 +1190,10 @@ program(0x4051, 0x40a2, 0x029b) NetName - MMIO_S + IT_N - + Tunnel @@ -1451,153 +1207,207 @@ program(0x4051, 0x40a2, 0x029b) IM_DS - + - Tunnel + Counter - rotation - + Label + CLK divider /16 - NetName - IRQ0 + Bits + 4 - + - Keyboard + Break - + Tunnel NetName - IRQ0 + CLK - + - Tunnel + VDD - NetName - DBUS + rotation + - + - Tunnel + Ground + + + + + Clock - rotation - + runRealTime + true - NetName - CLK + Frequency + 25175000 - + - Comparator + atk16_ppu.dig + + + + + Tunnel - Bits - 13 + rotation + + + + NetName + CLK - + - Const + Tunnel - Bits - 13 + NetName + IT_N - + - And - - + EEPROM + + + AddrBits + 8 + + + Label + UCODE + + + Bits + 24 + + + Data + c,221,3040,8000,4*0,c,221,3040,8000,4*0,c,221,3440,8000,4*0,c +,221,3440,8000,4*0,c,221,88,60,8000,0,0,0,c,221,88,60,8000,0,0,0 +,c,221,88,110,8000,0,0,0,c,221,88,110,8000,0,0,0,c,221,840,8000 +,4*0,c,221,840,8000,4*0,c,221,82,8000,4*0,c,221,82,8000,4*0,c +,221,c02,8000,4*0,c,221,c02,8000,4*0,c,221,8000,5*0,c,221,82,8000 +,4*0,c,221,8000,5*0,c,221,c02,8000,4*0,c,221,44,8000,4*0,c,221 +,44,8000,4*0,c,221,8000,5*0,c,221,8000,5*0,c,221,8000,5*0,c,221 +,8000,5*0,c0004,10008,22,8000,4*0,c0004,10008,22,8000,4*0,c0004 +,10008,22,8000,4*0,c0004,10008,22,8000,4*0,c,221,120002,8000,4*0 +,c,221,120002,8000,4*0,c,221,4000,5*0,c,221,4000 + + + - Tunnel + VDD rotation - - - - NetName - MMIO_OE + - + - Tunnel + Ground rotation - + + + + + + VDD + - NetName - MMIO_S + rotation + - + - Probe + Tunnel - Label - MMIO_S + NetName + DBUS - + Tunnel + + rotation + + NetName MMIO_IE - + Tunnel + + rotation + + NetName - MMIO_OE + MMIO_S - + Tunnel + + rotation + + NetName - MMIO_S + CLK - + @@ -1626,300 +1436,48 @@ program(0x4051, 0x40a2, 0x029b) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -1941,6 +1499,10 @@ program(0x4051, 0x40a2, 0x029b) + + + + @@ -1953,14 +1515,46 @@ program(0x4051, 0x40a2, 0x029b) - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2001,41 +1595,81 @@ program(0x4051, 0x40a2, 0x029b) + + + + + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + - - + + + + + + - - + + + + + + + + + + + + + + + + + + @@ -2065,6 +1699,10 @@ program(0x4051, 0x40a2, 0x029b) + + + + @@ -2082,8 +1720,28 @@ program(0x4051, 0x40a2, 0x029b) - - + + + + + + + + + + + + + + + + + + + + + + @@ -2126,32 +1784,60 @@ program(0x4051, 0x40a2, 0x029b) - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + - - + + - - + + - - + + @@ -2161,6 +1847,10 @@ program(0x4051, 0x40a2, 0x029b) + + + + @@ -2170,8 +1860,12 @@ program(0x4051, 0x40a2, 0x029b) - - + + + + + + @@ -2181,33 +1875,105 @@ program(0x4051, 0x40a2, 0x029b) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - + + - - + + @@ -2225,6 +1991,10 @@ program(0x4051, 0x40a2, 0x029b) + + + + @@ -2233,6 +2003,10 @@ program(0x4051, 0x40a2, 0x029b) + + + + @@ -2245,10 +2019,6 @@ program(0x4051, 0x40a2, 0x029b) - - - - @@ -2265,10 +2035,6 @@ program(0x4051, 0x40a2, 0x029b) - - - - @@ -2285,14 +2051,6 @@ program(0x4051, 0x40a2, 0x029b) - - - - - - - - @@ -2329,6 +2087,10 @@ program(0x4051, 0x40a2, 0x029b) + + + + @@ -2338,8 +2100,12 @@ program(0x4051, 0x40a2, 0x029b) - - + + + + + + @@ -2349,10 +2115,6 @@ program(0x4051, 0x40a2, 0x029b) - - - - diff --git a/digital/atk16_mem.dig b/digital/atk16_mem.dig index 0c217b9..a3d8b5e 100644 --- a/digital/atk16_mem.dig +++ b/digital/atk16_mem.dig @@ -35,7 +35,7 @@ Data - 4014,2a00,6026,13*8000,18,18,18,1a,8000,0,e000,e001,4855,f000 + 4014,2a00,6026,13*8000,1a,18,18,18,8000,0,e000,e001,4855,f000 ,3140,1b48,3148,1b48,4017,2000,2000,4216,2240,3040,1b49,2340,1b49 ,2140,e000,61ff diff --git a/digital/atk16_peripherals.dig b/digital/atk16_peripherals.dig new file mode 100644 index 0000000..c8eb7b5 --- /dev/null +++ b/digital/atk16_peripherals.dig @@ -0,0 +1,852 @@ + + + 2 + + + romContent + + + + + + Width + 6 + + + + + Splitter + + + Input Splitting + 1*4 + + + Output Splitting + 4 + + + + + + Out + + + Label + IRQ + + + Bits + 4 + + + + + + RS_FF_AS + + + + + Tunnel + + + rotation + + + + NetName + IRQ0 + + + + + + And + + + + + Tunnel + + + rotation + + + + NetName + IM_DS + + + + + + And + + + + + Tunnel + + + rotation + + + + NetName + IM_DS + + + + + + RS_FF_AS + + + + + Tunnel + + + rotation + + + + NetName + IRQ1 + + + + + + RS_FF_AS + + + + + Tunnel + + + rotation + + + + NetName + IRQ2 + + + + + + And + + + + + Tunnel + + + rotation + + + + NetName + IM_DS + + + + + + RS_FF_AS + + + + + Tunnel + + + rotation + + + + NetName + IRQ3 + + + + + + And + + + + + Tunnel + + + rotation + + + + NetName + IM_DS + + + + + + Decoder + + + Selector Bits + 2 + + + + + + Comparator + + + Bits + 13 + + + + + + Const + + + Value + 0 + + + Bits + 13 + + + + + + And + + + + + Terminal + + + + + Tunnel + + + rotation + + + + NetName + CLK + + + + + + Tunnel + + + rotation + + + + NetName + DBUS + + + + + + Tunnel + + + rotation + + + + NetName + IE + + + + + + Tunnel + + + rotation + + + + NetName + S + + + + + + Keyboard + + + + + Tunnel + + + NetName + IRQ0 + + + + + + Tunnel + + + NetName + DBUS + + + + + + Tunnel + + + rotation + + + + NetName + CLK + + + + + + Comparator + + + Bits + 13 + + + + + + Const + + + Bits + 13 + + + + + + And + + + + + Tunnel + + + rotation + + + + NetName + OE + + + + + + Tunnel + + + rotation + + + + NetName + S + + + + + + Ground + + + + + Tunnel + + + NetName + IRQ1 + + + + + + Ground + + + + + Tunnel + + + NetName + IRQ2 + + + + + + Ground + + + + + Tunnel + + + NetName + IRQ3 + + + + + + In + + + Label + IM_DS + + + + + + Tunnel + + + NetName + IM_DS + + + + + + In + + + Label + IT_N + + + Bits + 2 + + + + + + In + + + Label + OE + + + + + + Tunnel + + + NetName + OE + + + + + + In + + + Label + IE + + + + + + Tunnel + + + NetName + IE + + + + + + In + + + Label + S + + + Bits + 13 + + + + + + Tunnel + + + NetName + S + + + + + + In + + + Label + CLK + + + + + + Tunnel + + + NetName + CLK + + + + + + Out + + + Label + DBUS + + + Bits + 16 + + + + + + Tunnel + + + rotation + + + + NetName + DBUS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/digital/atk16_ppu.dig b/digital/atk16_ppu.dig new file mode 100644 index 0000000..17b9447 --- /dev/null +++ b/digital/atk16_ppu.dig @@ -0,0 +1,1078 @@ + + + 2 + + + romContent + + + + + + Width + 7 + + + + + Comparator + + + Bits + 10 + + + + + + Const + + + Value + 798 + + + Bits + 10 + + + intFormat + dec + + + + + + Counter + + + Bits + 10 + + + + + + VDD + + + rotation + + + + + + + Tunnel + + + rotation + + + + NetName + PCLK + + + + + + Comparator + + + Bits + 10 + + + + + + Const + + + Value + 523 + + + Bits + 10 + + + intFormat + dec + + + + + + Counter + + + Bits + 10 + + + + + + VDD + + + rotation + + + + + + + Comparator + + + Bits + 10 + + + + + + Const + + + Value + 488 + + + Bits + 10 + + + intFormat + dec + + + + + + Comparator + + + Bits + 10 + + + + + + Const + + + Value + 751 + + + Bits + 10 + + + intFormat + dec + + + + + + Comparator + + + Bits + 10 + + + + + + Const + + + Value + 654 + + + Bits + 10 + + + intFormat + dec + + + + + + Comparator + + + Bits + 10 + + + + + + Const + + + Value + 491 + + + Bits + 10 + + + intFormat + dec + + + + + + Tunnel + + + NetName + VSYNC + + + + + + NAnd + + + + + Tunnel + + + NetName + HSYNC + + + + + + NAnd + + + + + VGA + + + + + Tunnel + + + rotation + + + + NetName + PCLK + + + + + + Tunnel + + + rotation + + + + NetName + HSYNC + + + + + + Tunnel + + + rotation + + + + NetName + VSYNC + + + + + + Tunnel + + + rotation + + + + NetName + PR + + + + + + Tunnel + + + rotation + + + + NetName + PG + + + + + + Tunnel + + + rotation + + + + NetName + PB + + + + + + In + + + Description + Pixel clock + + + Label + PCLK + + + + + + Tunnel + + + NetName + PCLK + + + + + + Add + + + Bits + 10 + + + + + + Const + + + Bits + 10 + + + + + + In + + + Description + CPU clock + + + Label + CLK + + + + + + Tunnel + + + NetName + CLK + + + + + + Ground + + + + + BarrelShifter + + + Bits + 10 + + + direction + right + + + + + + Const + + + Bits + 4 + + + + + + BarrelShifter + + + Bits + 10 + + + direction + right + + + + + + Const + + + Bits + 4 + + + + + + Splitter + + + Input Splitting + 10 + + + Output Splitting + 2,8 + + + + + + Splitter + + + Input Splitting + 10 + + + Output Splitting + 1,9 + + + + + + Out + + + Description + Index of next scanline + + + Label + SCANLINE + + + Bits + 9 + + + + + + Register + + + Label + VWORD + + + Bits + 16 + + + + + + Const + + + Value + 16927 + + + Bits + 16 + + + intFormat + hex + + + + + + VDD + + + rotation + + + + + + + Tunnel + + + rotation + + + + NetName + CLK + + + + + + Splitter + + + Input Splitting + 16 + + + Output Splitting + 4*4 + + + + + + Multiplexer + + + Selector Bits + 2 + + + Bits + 4 + + + + + + Splitter + + + Input Splitting + 4 + + + Output Splitting + 1*4 + + + + + + Tunnel + + + NetName + PG + + + + + + Tunnel + + + NetName + PB + + + + + + Tunnel + + + NetName + PR + + + + + + Add + + + Bits + 2 + + + + + + Ground + + + + + Splitter + + + Input Splitting + 10 + + + Output Splitting + 2,8 + + + + + + Tunnel + + + NetName + SCAN_L2 + + + + + + Tunnel + + + rotation + + + + NetName + SCAN_L2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.3