12.07.2015 Views

Atari ST System-on-Chip in VHDL (Author: Lyndon Amsdon) [undated]

Atari ST System-on-Chip in VHDL (Author: Lyndon Amsdon) [undated]

Atari ST System-on-Chip in VHDL (Author: Lyndon Amsdon) [undated]

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> <str<strong>on</strong>g>System</str<strong>on</strong>g>-<strong>on</strong>-<strong>Chip</strong> <strong>in</strong> <strong>VHDL</strong>Individual ProjectUFEEJ4-40-3<strong>Author</strong>: Lynd<strong>on</strong> Amsd<strong>on</strong>Student Number: 05500164Word Count15116


Table of C<strong>on</strong>tentsParagraph Number Title Page NumberChapter 1 - Introducti<strong>on</strong>1.1 Preface 1-11.2 Introducti<strong>on</strong> 1-11.2.1 TV Boy 1-11.2.2 Flashback 2 1-21.2.3 NOAC 1-21.2.4 MSX Bazix 1-31.2.5 M<strong>in</strong>imig 1-31.2.6 C-One/C64DTV 1-4Chapter 2 - In Depth Introducti<strong>on</strong>2.1 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> History 2-12.1.1 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Models 2-12.2 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Hardware 2-22.2.1 MC68000 CPU 2-42.2.2 GLUE custom semic<strong>on</strong>ductor 2-42.2.3 MMU custom semic<strong>on</strong>ductor 2-52.2.4 SHIFTER custom semic<strong>on</strong>ductor 2-52.2.5 DMA custom semic<strong>on</strong>ductor 2-52.2.6 MFP MC68901 2-62.2.7 Yamaha YM2149 2-62.2.8 ACIA MC6850 2-62.2.9 FDC WD1772 2-62.3 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> 2-8Paragraph Number Title Page Number


2.3.1 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Boot Up Operati<strong>on</strong> 2-8Chapter 3 – Research3.1 FPGA 3-13.2 Base Hardware 3-23.3 IP Cores 3-33.4 Software Suite 3-33.5 Processor 3-33.6 Books and literature 3-43.7 Debugg<strong>in</strong>g 3-53.8 Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> Versi<strong>on</strong>s 3-63.9 <str<strong>on</strong>g>System</str<strong>on</strong>g> Memory 3-73.10 Serial Port 3-83.11 Video Output 3-9Chapter 4 – Design4.1 Comp<strong>on</strong>ents 4-14.1.1 Base Hardware 4-14.1.2 MC68SEC000 CPU 4-24.1.3 Static RAM 4-34.1.4 Debugg<strong>in</strong>g 4-34.1.5 OS and Flash Memory 4-44.1.6 5v PCI I/O 4-54.1.7 VGA 4-54.1.8 Floppy Disk Drive 4-64.1.9 RS232 Serial 4-74.1.10 Keyboard and Mouse 4-8Paragraph Number Title Page Number


4.2 Design Differences 4-84.3 Process of Implementati<strong>on</strong> 4-11Chapter 5 – Implementati<strong>on</strong>5.1 Flash<strong>in</strong>g LED 5-15.2 VGA Colour pattern 5-15.3 Writ<strong>in</strong>g bytes to Flash Memory 5-25.4 Writ<strong>in</strong>g file to Flash Memory 5-55.5 CPU 5-55.6 Reset 5-65.7 Clock 5-65.8 Synchr<strong>on</strong>ous Bus <strong>in</strong>terface 5-75.9 Flash data bus resiz<strong>in</strong>g 5-85.10 7 Segment Display 5-95.11 S<strong>in</strong>gle Step 5-105.12 Glue IP core 5-105.13 MMU IP core 5-135.14 Hardware Breakpo<strong>in</strong>t 5-165.15 Shifter IP Core 5-175.16 MFP IP Core 5-175.17 ACIA IP Core 5-195.18 YM2149 IP Core 5-205.19 DMA IP Core 5-215.20 FDC IP Core 5-225.21 Eiffel PS/2 C<strong>on</strong>versi<strong>on</strong> 5-245.22 IDE Compact Flash 5-26


Paragraph Number Title Page NumberChapter 6 – Test<strong>in</strong>g and verificati<strong>on</strong>6.1 Benchmark<strong>in</strong>g 6-z6.2 Colour Palette 6-z6.3 Sound Techniques 6-z6.4 Software Over Scan 6-zChapter 7 – Future ideas7.1 Floppy Drive Emulati<strong>on</strong> 7-17.2 MIDI 7-17.3 IDE 7-27.4 Unificati<strong>on</strong> of mass storage 7-27.5 Rec<strong>on</strong>figurable systems 7-37.6 Commercial viability 7-3Chapter 8 – Summary8.1 Summary 8-1


List of Illustrati<strong>on</strong>sFigure Number Title Page Number1 TV Boy 1-12 Flashback 2 PCB 1-23 NOAC SOC 1-24 MSX Bazix Unit 1-35 M<strong>in</strong>imig PCB 1-36 C64DTV 1-47 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> CPU Prototype 2-28 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>fm Motherboard 2-39 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> boot up sequence 2-710 Xil<strong>in</strong>x FPGA block layout 3-111 Flash memory organisati<strong>on</strong> 3-612 DAC us<strong>in</strong>g resistor ladders 3-913 Specialised video DAC 3-1014 Enterpo<strong>in</strong>t Raggedst<strong>on</strong>e 4-115 VGA video tim<strong>in</strong>g 4-516 RS232 to TTL level translator 4-717 ATX p<strong>in</strong> descripti<strong>on</strong> 4-918 Design Block diagram 4-1019 Architecture for LED Flash 5-120 Colour test display 5-221 Flash Programmer menu 5-222 MCS file format 5-523 Synchr<strong>on</strong>ous bus <strong>in</strong>terface 5-824 Flash state mach<strong>in</strong>e 5-825 7 segment display 5-926 Address decod<strong>in</strong>g <strong>in</strong> Glue 5-1127 MC68000 start up sequence 5-11


Figure Number Title Page Number28 SRAM and adapter PCB 5-1329 Refresh Address removal 5-1330 Refresh RAS removal 5-1431 SRAM signal creati<strong>on</strong> 5-1432 S<strong>in</strong>gle Step DTACK creati<strong>on</strong> 5-1633 Photo of Desktop 5-1834 Xil<strong>in</strong>x ISE DLL error 5-1835 PWM Sound 5-2036 Excerpt from OS 5-2237 FDCSn from wf25913ip_ctrl.vhd 5-2238 T1_VERIFY_CRC state 5-2339 WD1772 delay state 5-2440 Playstai<strong>on</strong> c<strong>on</strong>troller protocol 5-2541 Degas Elite 6-142 Change to Shifter 6-243 SND Player 6-344 Envelope Shapes 6-345 Old enveloper generator 6-446 New enveloper generator 6-447 Screen borders 6-4


List of TablesTable Number Title Page Number1 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> models 2-22 Xil<strong>in</strong>x development boards 3-23 MC68000 family processors 3-44 TOS versi<strong>on</strong>s 3-65 Serial port p<strong>in</strong> descripti<strong>on</strong> 4-76 Flash memory commands 5-47 FPGA c<strong>on</strong>necti<strong>on</strong>s to 7 segment display 5-98 Start of Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> 5-119 Memory C<strong>on</strong>figurati<strong>on</strong> register 5-1610 IPL Encod<strong>in</strong>g 5-1811 Playstati<strong>on</strong> c<strong>on</strong>troller packet 5-2412 Colour palette error 6-2


Chapter 1Preface1.1With<strong>in</strong> this pers<strong>on</strong>al project is a complete guide to the research, development,implementati<strong>on</strong> and c<strong>on</strong>clusi<strong>on</strong>s to creat<strong>in</strong>g a <str<strong>on</strong>g>System</str<strong>on</strong>g> <strong>on</strong> <strong>Chip</strong>, based <strong>on</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>series of home microcomputer which spanned a producti<strong>on</strong> date of 1985-1993 [1]. Theproject is designed to be left open to c<strong>on</strong>t<strong>in</strong>ual work and extensi<strong>on</strong>s bey<strong>on</strong>d the orig<strong>in</strong>al<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> design.This document assumes prior knowledge of Microsystems design and the MotorolaMC68000 CPU, and go<strong>in</strong>g <strong>in</strong> depth <strong>in</strong>to these topics is bey<strong>on</strong>d the scope of thisdocument.Introducti<strong>on</strong> and Overview1.2This project is <strong>in</strong>spired by other enthusiast’s attempts at creat<strong>in</strong>g systems <strong>on</strong> chip thatfaithfully reproduce early home microcomputers and arcade mach<strong>in</strong>es. The development<strong>in</strong> the last few years <strong>in</strong> programmable logic devices, with <strong>in</strong>creased logic elements andlow development costs, has meant it is possible to fit entire computers <strong>in</strong>to <strong>on</strong>esemic<strong>on</strong>ductor.1.2.1TV BoyOne of the first commercially available products has tobe the ‘TV Boy’, which was an unlicensed reverseeng<strong>in</strong>eered copy of the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> 2600. It first went <strong>on</strong> salearound the mid 1990s. The orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> 2600 used4Kbyte game cartridges whereas the TV Boy used aFigure 1 - TV Boy


512Kbyte ROM as storage for the 127 <strong>in</strong>ternal games [2]. A spare 4Kbyte slot was usedas the game menu selecti<strong>on</strong>. As it was unlicensed by <str<strong>on</strong>g>Atari</str<strong>on</strong>g> the games had differentnames and some had very small changes to the graphical details. All the digitalelectr<strong>on</strong>ics were designed <strong>in</strong>to a s<strong>in</strong>gle ASIC, <strong>in</strong>tended for mass producti<strong>on</strong> and low cost.1.2.2Flashback 2There have been some officiallicensed <str<strong>on</strong>g>Atari</str<strong>on</strong>g> c<strong>on</strong>soles recreated<strong>in</strong> modern silic<strong>on</strong>. The Flashback2 is another <str<strong>on</strong>g>Atari</str<strong>on</strong>g> 2600 with 40games <strong>in</strong>cluded. The design of thecase is rem<strong>in</strong>iscent of the orig<strong>in</strong>al<str<strong>on</strong>g>Atari</str<strong>on</strong>g> 2600, but be<strong>in</strong>g somewhat Figure 2 - Flashback 2 Ma<strong>in</strong> PCBsmaller and lighter. The Flashback2 was designed by Curt Vendel and Legacy Eng<strong>in</strong>eer<strong>in</strong>g, and <strong>in</strong> an <strong>in</strong>terview Curt Vendelremarked that the "Flashback 2 did excepti<strong>on</strong>ally well with 860,000 sold <strong>in</strong> theU.S./domestic" [3].1.2.3NOACAnother unlicensed reversed eng<strong>in</strong>eered copy of a c<strong>on</strong>soleexists, based <strong>on</strong> N<strong>in</strong>tendo’s NES (N<strong>in</strong>tendo Enterta<strong>in</strong>ment<str<strong>on</strong>g>System</str<strong>on</strong>g>). These are known as NOAC (N<strong>in</strong>tendo On A <strong>Chip</strong>)and orig<strong>in</strong>ate from a variety of manufactures <strong>in</strong> Ch<strong>in</strong>a and are<strong>in</strong>accurate <strong>in</strong> many ways to an orig<strong>in</strong>al NES [4]. The IntegratedCircuit is supplied without a real physical package, <strong>in</strong>stead be<strong>in</strong>gcovered with an epoxy glue material.Figure 3 - NOAC SOC


A brief look <strong>on</strong> the <strong>in</strong>ternet at current and past projects <strong>in</strong> this particular field has shownthe follow<strong>in</strong>g popular home computers be<strong>in</strong>g implemented <strong>in</strong>to FPGAs.Msx Bazix – MSX (Japanese home computer)M<strong>in</strong>imig – Amiga A500Suska – <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>/<str<strong>on</strong>g>ST</str<strong>on</strong>g>EC-One – Rec<strong>on</strong>figurable Commodore 64 & Commodore VIC-201.2.4MSX BazixThe MSX Bazix [5] was a project led to createprimarily a cl<strong>on</strong>e of the technically advanced MSXhome computer, which was very popular <strong>in</strong> Japan <strong>in</strong>the 1980s. The MSX Bazix was also designed topave the way for other developers to create projects<strong>on</strong>, with the design of the hardware be<strong>in</strong>g opensource and an array of I/O ports to cater for mostneeds. It’s future and success is unknown with n<strong>on</strong>ews <strong>on</strong> their website for over 2 years.Figure 4 - MSX Bazix Unit1.2.5M<strong>in</strong>imigThe M<strong>in</strong>imig (short for M<strong>in</strong>i Amiga) is based arounda Xil<strong>in</strong>x FPGA and MC68SEC000 CPU. It has somekey changes from the orig<strong>in</strong>al Amiga 500, <strong>in</strong>clud<strong>in</strong>gsupport for a PS/2 mouse and keyboard and gamesthat load from a removable MMC Flash memorydevice [6]. The source code for both the FPGA andPIC microc<strong>on</strong>troller became available to download<strong>on</strong> 24/07/2007 and the hardware is available to buythrough <strong>on</strong>l<strong>in</strong>e resellers.Figure 5 - M<strong>in</strong>imig PCB


1.2.6C-One/C64DTVMany other exist, at various stages of completi<strong>on</strong>. What are more <strong>in</strong>terest<strong>in</strong>g are theresults of some of these projects. The best example of this is the C-One. The C-<strong>on</strong>e wasdesigned by Jeri Ellsworth <strong>in</strong> 2002, to replicate a Commodore 64 us<strong>in</strong>g an Altera FPGA[7]. By 2004 a market<strong>in</strong>g company had approached Jeri Ellsworth to use the design <strong>in</strong> alow cost hand held c<strong>on</strong>sole to plug directly <strong>in</strong>to a TV, the result be<strong>in</strong>g the C64DTV.The C64DTV hardware is all based <strong>on</strong> an ASIC, orApplicati<strong>on</strong> Specific Integrated Circuit, which is like afixed design FPGA. These are comm<strong>on</strong>ly used <strong>in</strong> massproduced products. The software comprised of 30games, orig<strong>in</strong>ally produced for the Commodore 64 <strong>in</strong>the mid to late eighties and licensed to be used. TheC64DTV was very successful <strong>on</strong> release, sell<strong>in</strong>g70,000 units <strong>in</strong> a s<strong>in</strong>gle day via a TV shopp<strong>in</strong>g channelpriced around £20[8].Figure 6 - C64DTV


Chapter 2In Depth Introducti<strong>on</strong>2.1<str<strong>on</strong>g>Atari</str<strong>on</strong>g> was founded <strong>in</strong> 1972 by Nolan Bushnell and Ted Dabney firstly creat<strong>in</strong>g arcadegames, and then mov<strong>in</strong>g <strong>on</strong>to home computers and home video game c<strong>on</strong>soles. <str<strong>on</strong>g>Atari</str<strong>on</strong>g> atthe time had created groundbreak<strong>in</strong>g games like P<strong>on</strong>g, and also designed an affordable 8bit home video game c<strong>on</strong>sole, called the 2600 based around the Motorola 6502 CPU.By 1976 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> was sold to Time-Warner and work had started <strong>on</strong> a replacement for the2600 video game c<strong>on</strong>sole. A shift towards people want<strong>in</strong>g to do more than play gamesmeant the next computers, the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> 800 & 400, had keyboards and the term ‘homecomputers’ arrived.In the early eights there was the crash of the US Video Games <strong>in</strong>dustry, where manycompanies produc<strong>in</strong>g video game c<strong>on</strong>soles and home computers <strong>in</strong> North America eitherwent bankrupt or lost a lot of m<strong>on</strong>ey. Some of the reas<strong>on</strong>s for this were too muchcompetiti<strong>on</strong>, a flood of poor software titles and not enough compatibility betweenc<strong>on</strong>soles, even <strong>on</strong>es made by the same manufactures.It was then <strong>in</strong> 1984 <str<strong>on</strong>g>Atari</str<strong>on</strong>g> was sold by Time Warner to Jack Tramiel, who was the founderof Commodore. <str<strong>on</strong>g>Atari</str<strong>on</strong>g> was restructured sell<strong>in</strong>g off old stock at reduced prices to fund anew home computer, which would be called the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> and was released <strong>in</strong> 1985[9],[10].2.1.1<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> ModelsThe <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> was particularly str<strong>on</strong>g <strong>in</strong> the music <strong>in</strong>dustry, with MIDI (MusicalInstrument Digital Interface) ports be<strong>in</strong>g built <strong>in</strong>. One of the video modes, be<strong>in</strong>gm<strong>on</strong>ochrome high resoluti<strong>on</strong> (for the time) also meant the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> found its way <strong>in</strong> DTP(Desktop Publish<strong>in</strong>g) and CAD (Computer Aided Design).


The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> stands for Sixteen/Thirty-two, as it was based around the powerfulMotorola MC68000 which had a 16bit external data bus, but <strong>in</strong>ternal 32bit registers.The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> range came <strong>in</strong> quite a few different flavours [10].<str<strong>on</strong>g>ST</str<strong>on</strong>g> Orig<strong>in</strong>al<str<strong>on</strong>g>ST</str<strong>on</strong>g>M RF modulator for TV output<str<strong>on</strong>g>ST</str<strong>on</strong>g>F Internal floppy drive<str<strong>on</strong>g>ST</str<strong>on</strong>g>FM RF Modulator for TV output, <strong>in</strong>ternal floppy drive<str<strong>on</strong>g>ST</str<strong>on</strong>g>E DMA Sound, Blitter chip, enhanced graphics, RF Modulator, <strong>in</strong>ternalfloppy driveMega <str<strong>on</strong>g>ST</str<strong>on</strong>g> Detachable keyboard, Blitter <strong>Chip</strong>, <strong>in</strong>ternal floppy drive, <strong>in</strong>ternal expansi<strong>on</strong>busMega <str<strong>on</strong>g>ST</str<strong>on</strong>g>E Detachable keyboard, Blitter <strong>Chip</strong>, <strong>in</strong>ternal floppy drive, <strong>in</strong>ternal VMEexpansi<strong>on</strong> bus, opti<strong>on</strong>al FPU, 16 MHz CPU with L2 CacheStacy Portable Laptop versi<strong>on</strong>, <strong>in</strong>ternal floppy drive, m<strong>on</strong>ochrome 9” LCDscreenTable 1. List of different models <str<strong>on</strong>g>Atari</str<strong>on</strong>g> produced based around the orig<strong>in</strong>al <str<strong>on</strong>g>ST</str<strong>on</strong>g> hardware<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Hardware2.2The orig<strong>in</strong>al prototype of the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> wasbuilt by hand us<strong>in</strong>g discrete TTL logicdevices us<strong>in</strong>g wire wrapp<strong>in</strong>g and prototyp<strong>in</strong>gpr<strong>in</strong>ted circuit boards. These were then<strong>in</strong>tegrated <strong>in</strong>to four custom ASICs <strong>on</strong> theproducti<strong>on</strong> models [11].Figure 7 - <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> CPU Board Prototype


Figure 8 - <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>fm Motherboard1. Reset circuitry c<strong>on</strong>sist<strong>in</strong>g of NE555 m<strong>on</strong>ostable2. FPM DRAM, c<strong>on</strong>sist<strong>in</strong>g of two banks of 512kbytes3. RF Modulator to c<strong>on</strong>vert composite video and audio to RF4. Custom DMA chip5. Western Digital WD1772 Floppy Disk C<strong>on</strong>troller6. Yamaha YM2149 Sound <strong>Chip</strong>7. Motorola MC68901 MFP8. Motorola MC6850 ACIA <strong>on</strong>e for keyboard <strong>in</strong>terface and another for MIDI9. Custom SHIFTER Video chip <strong>in</strong>side shielded enclosure10. Bus transceivers to bridge between Data Bus and RAM Data Bus11. Custom GLUE chip12. Motorola MC68000 CPU13. Custom MMU chip14. EPROM’s c<strong>on</strong>ta<strong>in</strong><strong>in</strong>g TOS (The Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g>)15. Cartridge Port for additi<strong>on</strong>al EPROM’s


2.2.1MC68000 CPUThe <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> was built around the Motorola 68000 CPU. Some of the MC68000 featuresare listed below.16 bit data bus24 bit address busAsynchr<strong>on</strong>ous bus cycles (to allow for wait states)Synchr<strong>on</strong>ous bus cycles to <strong>in</strong>terface to older 8 bit 6800 peripherals32 bit <strong>in</strong>ternal registers7 Interrupt levelsByte, Word and L<strong>on</strong>g data transfersListed below are the four custom <strong>in</strong>tegrated circuits, which are all closely l<strong>in</strong>ked together,and to operate rely <strong>on</strong> each other.2.2.2GLUEAs the name suggests, this IC glues the system together. It is resp<strong>on</strong>sible for addressdecod<strong>in</strong>g and provid<strong>in</strong>g chip select l<strong>in</strong>es. It also handles the c<strong>on</strong>trol of <strong>in</strong>terrupt l<strong>in</strong>es tothe CPU, and bus arbitrati<strong>on</strong> between CPU and DMA. It also creates the video tim<strong>in</strong>gsignals.2.2.3MMUThis <strong>in</strong>tegrated circuit c<strong>on</strong>trols the Dynamic RAM signals. It is not as powerful as thename suggests, it doesn’t do any memory protecti<strong>on</strong>, translati<strong>on</strong> from virtual to physicaladdress or pag<strong>in</strong>g. This would be better called a Memory C<strong>on</strong>troller Unit. It multiplexesthe CPU address l<strong>in</strong>es to Column and Rows. It also c<strong>on</strong>ta<strong>in</strong>s a counter for send<strong>in</strong>g videodata from RAM to the SHIFTER and also a counter for DMA transfers.


2.2.4SHIFTERThis <strong>in</strong>tegrated circuit takes the data supplied by the MMU and uses a lookup table todisplay the colour from a palette. All the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> video modes are based <strong>on</strong> bit planes.There are 3 video modes, 320x200 16 colours (4 bit planes), 320x400 4 colours (2 bitplanes) and 640x400 (1 bit plane). The reas<strong>on</strong> for us<strong>in</strong>g this method was because thememory bandwidth is not enough to support “chunky” graphic modes where each byterepresents a pixel <strong>on</strong> the screen.2.2.5DMAThe DMA (Direct Memory Access) c<strong>on</strong>troller is resp<strong>on</strong>sible for transferr<strong>in</strong>g chunks ofdata between the RAM and DMA port, which is used for c<strong>on</strong>necti<strong>on</strong> of hard drives. Italso resizes the 16 bit data bus to the external 8 bit bus featured <strong>on</strong> the DMA port. It isalso used to carry out DMA transfers to and from the Western Digital WD1772 FDC(Floppy disk c<strong>on</strong>troller).2.2.6MFPThe MFP is a MC68901 manufactured by Motorola and is an abbreviati<strong>on</strong> for MultiFuncti<strong>on</strong> Peripheral <strong>Chip</strong>. In the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> it is used to provide a RS232 serial port. Italso serves as an <strong>in</strong>terrupt c<strong>on</strong>troller, allow<strong>in</strong>g more <strong>in</strong>terrupt sources than the MotorolaMC68000 CPU provides. It also c<strong>on</strong>ta<strong>in</strong>s four universal timers.2.2.7YM2149The YM2149 is manufactured by Yamaha and is primarily the sound generator. Itc<strong>on</strong>ta<strong>in</strong>s 3 <strong>in</strong>dependent t<strong>on</strong>e generators. It also has two general purpose 8 bit data ports.In the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> these are used for the Centr<strong>on</strong>ics pr<strong>in</strong>ter <strong>in</strong>terface and the other is used tohelp c<strong>on</strong>trol the floppy disk and RS232 hardware flow c<strong>on</strong>trol.2.2.8


ACIAThe ACIA is an abbreviati<strong>on</strong> for Asynchr<strong>on</strong>ous Communicati<strong>on</strong>s Interface Adapter. The<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> c<strong>on</strong>ta<strong>in</strong>s two MC6850. Their task is to serialize data to communicate with theKeyboard and MIDI devices. They were designed as a peripheral chip to the MC6800processor, and so they <strong>on</strong>ly feature an 8 bit wide bus and use the legacy synchr<strong>on</strong>ous busthat the MC68000 CPU can offer.2.2.9FDCThe FDC is an abbreviati<strong>on</strong> for Floppy Disk C<strong>on</strong>troller. It is a WD1772 made byWestern Digital. It is c<strong>on</strong>nected to the DMA chip so that all transfers are via DMAreliev<strong>in</strong>g the CPU from disk transfers. It c<strong>on</strong>ta<strong>in</strong>s the logic for precise tim<strong>in</strong>g of thefloppy disk drive heads and motors and sterilizati<strong>on</strong> of data.<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g>2.3


After the hardware came close to be<strong>in</strong>g completed an operat<strong>in</strong>g system was needed.<str<strong>on</strong>g>Atari</str<strong>on</strong>g> decided to use a new operat<strong>in</strong>g system with a GUI (Graphical User Interface) fromDigital Research, provid<strong>in</strong>g a WIMP (W<strong>in</strong>dows, Ic<strong>on</strong>s, Menu, Po<strong>in</strong>t<strong>in</strong>g Device)envir<strong>on</strong>ment, much like the Apple Mac<strong>in</strong>tosh. This was essentially a port from the Intel8088 versi<strong>on</strong> they had developed for the IBM compatible mach<strong>in</strong>es. The operat<strong>in</strong>gsystem was called TOS (The Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g>), and provided the programmer withmany system calls by us<strong>in</strong>g the TRAP software excepti<strong>on</strong> calls. In TOS there are threelayers, called the BIOS, XBIOS and GEMDOS. The BIOS and XBIOS are hardwaredependant, while the GEMDOS layer is hardware <strong>in</strong>dependent. The operat<strong>in</strong>g system <strong>on</strong>very early <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> models came <strong>on</strong> floppy disk, but the more comm<strong>on</strong> later versi<strong>on</strong>splaced this operat<strong>in</strong>g system <strong>on</strong> PROM memory devices [12].With this project be<strong>in</strong>g ma<strong>in</strong>ly hardware based <strong>on</strong>ly the low level parts of the operat<strong>in</strong>gsystem, and particularly how the operat<strong>in</strong>g system starts up and boot straps.2.3.1<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Boot Up Operati<strong>on</strong>The Motorola 68000 <strong>on</strong> boot up requires <strong>in</strong>itialvalues to load <strong>in</strong>to its supervisor stack po<strong>in</strong>terand reset vector address. These come <strong>in</strong> theform of two l<strong>on</strong>g words at address 0x000000 to0x000007.Figure 9 shows the path the operat<strong>in</strong>g systemtakes <strong>on</strong> boot up. It was drawn from thereverse eng<strong>in</strong>eered commented source code[13],[14].Figure 9 - <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> boot up sequenceBoot up sequence


(1) Load SSP with l<strong>on</strong>g word value from 0xFC0000. Load PC with l<strong>on</strong>g word value from 0xFC0004 (Garbage value, memory not yetsized). CPU Supervisor Mode Interrupts disabled (IPL=7). RESET <strong>in</strong>structi<strong>on</strong> to reset all peripheral chips. Check for magic number 0xFA52235F <strong>on</strong> cartridge port, if present jump todiagnostic cartridge.(2). Test for warm start, if memvalid (0x000420) and memval2 (0x00043A) c<strong>on</strong>ta<strong>in</strong>the Magic numbers 0x7520191F3 and 0x237698AA respectively, then load thememc<strong>on</strong>f (0xFF8001) c<strong>on</strong>tents with data from memctrl (0x000424).(3)If the resvalid (0x000426) c<strong>on</strong>ta<strong>in</strong>s the Magic number 0x31415926, jump to resetvector taken from Resvector (0x00042A).(4) YM2149 sound chip <strong>in</strong>itialized (Floppy deselected). The vertical synchr<strong>on</strong>izati<strong>on</strong> frequency <strong>in</strong> syncmode (0xFF820A) is adjusted to50Hz or 60Hz depend<strong>in</strong>g <strong>on</strong> regi<strong>on</strong>. Shifter palette <strong>in</strong>itialized. Shifter Base register (0xFF8201 and 0xFF8203) are <strong>in</strong>itialized to 0x010000. The follow<strong>in</strong>g steps 5 to 8 are <strong>on</strong>ly d<strong>on</strong>e <strong>on</strong> a coldstart to <strong>in</strong>itialize memory.(5)Write 0x000a (2 Mbyte & 2 Mbyte) to the MMU Memory C<strong>on</strong>figurati<strong>on</strong> Register0xff8001).(6)


Write Pattern to 0x000000 - 0x000lff. Read Pattern from 0x000200 - 0x0003ff. If Match then Bank0 c<strong>on</strong>ta<strong>in</strong>s 128 Kbyte; goto step 7. Read Pattern from 0x000400 - 0x0005ff. If Match then Bank0 c<strong>on</strong>ta<strong>in</strong>s 512 Kbyte; goto step 7. Read Pattern from 0x000000 - 0x0001ff. If Match then Bank0 c<strong>on</strong>ta<strong>in</strong>s 2 Mbyte; goto step 7. panic: RAM error <strong>in</strong> Bank0.(7) Write Pattern to 0x200000 - 0x200lff. Read Pattern from 0x200200 - 0x2003ff. If Match then Bank1 c<strong>on</strong>ta<strong>in</strong>s 128 Kbyte; goto step 8. Read Pattern from 0x200400 - 0x2005ff. If Match then Bank1 c<strong>on</strong>ta<strong>in</strong>s 512 Kbyte; goto step 8. Read Pattern from 0x200000 - 0x2001ff. If Match then Bank1 c<strong>on</strong>ta<strong>in</strong>s 2 Mbyte; goto step 8. note: Bank1 not fitted.(8)Write C<strong>on</strong>figurati<strong>on</strong> to MMU Memory C<strong>on</strong>figurati<strong>on</strong> Register (0xff8001).Note Total Memory Size (Top of RAM) for future reference <strong>in</strong> phystop(0x00042E).Set magic values <strong>in</strong> memvalid (0x000420) and memval2 (0x00043A).(9) Clear the first 64 Kbytes of RAM from top of operat<strong>in</strong>g system variables(0x00093A) to Shifter base address (0x010000). Initialize operat<strong>in</strong>g system variables. Change and locate Shifter Base register to 32768 bytes from top of physical ram. Initialize <strong>in</strong>terrupt CPU vector table.


Initialize BIOS.Initialize MFP.(10)Cartridge port checked, if software with bit 2 set <strong>in</strong> CA_INIT then start.(11) Identify type of m<strong>on</strong>itor attached for mode of operati<strong>on</strong> for the Shifter video chipand <strong>in</strong>itialize.(12) Cartridge port checked, if software with CA_INIT clear (execute prior to displaymemory and <strong>in</strong>terrupt vector <strong>in</strong>itializati<strong>on</strong>) then start.(13)CPU Interrupt level (IPL) lowered to 3 (HBlank <strong>in</strong>terrupts rema<strong>in</strong> masked).(14) Cartridge port checked, if software with bit 1 set <strong>in</strong> CA_INIT (Execute prior toGEMDOS <strong>in</strong>itializati<strong>on</strong>) then start.(15)The GEMDOS Initializati<strong>on</strong> rout<strong>in</strong>es are completed.(16)Attempt boot from floppy disk if operat<strong>in</strong>g system variable _bootdev (0x000446)smaller than 2 (for floppy disks) is. Before a boot attempt is made bit 3 <strong>in</strong>CA_INIT (Execute prior to boot disk) checked, if set, start cartridge.The ACSI Bus is exam<strong>in</strong>ed for devices, if successful search and load boot sector.


If system variable _cmdload (0x000482) is 0x0000, skip step 17.(17) Turn screen cursor <strong>on</strong> Start any program <strong>in</strong> AUTO folder of boot device Start COMMAND.PRG for a shell(18) Start any program <strong>in</strong> AUTO folder of boot device AES (<strong>in</strong> the ROM) starts.


Chapter 3Research3.1FPGAAn FPGA is a programmable logic device, with the c<strong>on</strong>figurati<strong>on</strong> be<strong>in</strong>g volatile. TheFPGA c<strong>on</strong>ta<strong>in</strong>s many complex logic blocks that have <strong>in</strong>terc<strong>on</strong>nects runn<strong>in</strong>g betweenthem <strong>in</strong> a grid like fashi<strong>on</strong>. There are also dedicated <strong>in</strong>terc<strong>on</strong>nects like global clock l<strong>in</strong>es.The c<strong>on</strong>figurati<strong>on</strong> is often programmed <strong>in</strong> a high level HDL (Hardware descriptiveLanguage) like Verilog or <strong>VHDL</strong>, or sometimes as a schematic. The majority of modernFPGAs c<strong>on</strong>ta<strong>in</strong> embedded functi<strong>on</strong>s, such as adders, multipliers, memory, digital PLLsand even DSP cores. There has been a recent trend <strong>in</strong> push<strong>in</strong>g soft core processors <strong>in</strong>todesigns for FPGA creat<strong>in</strong>g complete systems <strong>on</strong> chip that can be f<strong>in</strong>e tuned for specifictasks [15].Figure 10 –Xil<strong>in</strong>x FPGA block layout


3.2Base HardwareThe design is to be based around a Xil<strong>in</strong>x FPGAs, as there are special free versi<strong>on</strong>s of theIDE (Integrated Development Envir<strong>on</strong>ment) which are <strong>on</strong>ly slightly limited from thecommercial versi<strong>on</strong>s. The type of Xil<strong>in</strong>x fitted to the board needs to be large enough (<strong>in</strong>terms of logic elements) to fit the whole project, which is not someth<strong>in</strong>g that can beestimated easily. The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> is based <strong>on</strong> a 5 volt logic platform, and so hav<strong>in</strong>g some 5volt capabilities <strong>on</strong> the chosen development board will be a real b<strong>on</strong>us.Board FPGA I/O’s Notes PriceXil<strong>in</strong>x Spartan-3Starter KitXC3S200 100 Programm<strong>in</strong>gCable, PS/2ports, VGA£80 plusshipp<strong>in</strong>g andcustomsEnterpo<strong>in</strong>tRaggedst<strong>on</strong>eXC3S1500 120 plus 505v tolerant<strong>on</strong> PCIheaderProgramm<strong>in</strong>gCable, 7segment display£120 <strong>in</strong>cshipp<strong>in</strong>g(special studentprice)Inrevium TB-3S-1400A-IMGXC3S1400A 128 4Mbyte DDRSDRAM,RS232£650 plusshipp<strong>in</strong>g andcustomsPhilips PXPDKSP3 XC3S1000 80 PCI ExpressBridge,Prototype Area.£700 plusshipp<strong>in</strong>g andcustomsDigilent Inc. Nexys-2XC3S500E 59 Programm<strong>in</strong>gCable, ps2ports, vga,£50 plusshipp<strong>in</strong>g andcustomsSDRAMTable 2 - Comparis<strong>on</strong> of some of the available Xil<strong>in</strong>x development boards


3.3IP CoresIP Core stands for Intellectual Property Core. They are a block of logic as an element todesign reuse, a trend towards repeated use of previously designed comp<strong>on</strong>ents. IP coresmay be licensed to another party or can also be owned and used by a s<strong>in</strong>gle party al<strong>on</strong>e.Some cores are <strong>on</strong>ly offered as netlists, to protect the vendor aga<strong>in</strong>st reverse-eng<strong>in</strong>eer<strong>in</strong>g.Others are offered as synthesizable cores <strong>in</strong> hardware descriptive languages like Verilogor <strong>VHDL</strong> [16].There are already a couple of projects for putt<strong>in</strong>g an <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> <strong>in</strong>side an FPGA, thankfullyboth <strong>in</strong> the <strong>VHDL</strong> language. There is MikeJ’s project, although <strong>on</strong>ly the source to hisYM2149 Sound <strong>Chip</strong> is available. There is also Wolfgang Forester’s project, which<strong>in</strong>cludes an IP Core of every <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> semic<strong>on</strong>ductor.3.4Software SuiteThe Xil<strong>in</strong>x IDE comes <strong>in</strong> two flavours, ISE Foundati<strong>on</strong> and ISE Webpack where thelatter is a free versi<strong>on</strong>. The free ISE WebPack is <strong>on</strong>ly restricted <strong>in</strong> the devices it supports,and that is generally the newest or largest devices like the Virtex 5 SXT family [17].There are a range of tools <strong>in</strong>cluded like Simulators, Tim<strong>in</strong>g Analysers and PowerAnalysis. There are additi<strong>on</strong>al opti<strong>on</strong>s that can be bought for some of the more advancedfeatures like <strong>Chip</strong>Scope (FPGA probe) and Modelsim (Powerful Simulator).3.5ProcessorThe processor can either be an IP Core or real genu<strong>in</strong>e Motorola (now Freescale) 68000.At the time of writ<strong>in</strong>g no free 68000 IP Core is available that has been tested and verified.There are a few different <strong>in</strong>carnati<strong>on</strong>s of the 68000 to help keep it up to date asproducti<strong>on</strong> has spanned almost 30 years now [18].


Model Technology Voltage Details Manufactured68000 NMOS 5v Orig<strong>in</strong>al No68HC000 CMOS 5v Low Power Yes68HC001 CMOS 5v Low Power, 8/16bit data Yesbus68EC000 CMOS 5v Embedded versi<strong>on</strong>, 8/16bit Nodata bus68SEC000 CMOS 3.3v Embedded versi<strong>on</strong>, 8/16bit Yesdata bus, static clock68008 NMOS 5v 8bit data bus, 20/22bit Noaddress bus68010 NMOS 5v Virtual mach<strong>in</strong>e & virtual Nomemory <strong>in</strong>structi<strong>on</strong>sTable 3 - Comparis<strong>on</strong> of 68000 family processors3.6Books and literature• <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Internals ISBN : 0-916439-46-1• <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Profibuch ISBN : 3-88745-563-0• 68000 Microsystems Design ISBN : 0-534-94822-7• MC68000 Hardware Datasheet• MC68000 Programmers Reference Manual


3.7Debugg<strong>in</strong>gThere are many ways to debug and fault f<strong>in</strong>d hardware. These range from the very basicup to m<strong>on</strong>itor<strong>in</strong>g registers <strong>in</strong> a CPU and data flow.A set of LEDs can be used to check that an FPGA has been programmed correctly. Byus<strong>in</strong>g a clock signal and div<strong>in</strong>g it down to a signal of a <strong>on</strong>e or two Hz this can be used todrive an LED and make it flash. Another use of LEDs is to show the status of signals,like a reset l<strong>in</strong>e or processor state. They are very often the first th<strong>in</strong>g to get work<strong>in</strong>gwhen start<strong>in</strong>g <strong>on</strong> a new development board.A 7 segment display can be used much <strong>in</strong> the same way as a s<strong>in</strong>gle LED but allow<strong>in</strong>gdisplay of whole bytes, words of even l<strong>on</strong>g words if enough segments are available. Abit more functi<strong>on</strong>ality is need <strong>in</strong> an FPGA to achieve this as quite often 7 segmentdisplays need to be scanned <strong>on</strong>e segment at a time at a fast enough rate for the eye not tosee any flicker.S<strong>in</strong>gle Stepp<strong>in</strong>g is a way of stepp<strong>in</strong>g through the boot up code of a board, <strong>on</strong>e <strong>in</strong>structi<strong>on</strong>at a time. It will usually be used <strong>in</strong> comb<strong>in</strong>ati<strong>on</strong> with a method to display bus signals toverify or diagnose a problem with the board. Us<strong>in</strong>g this method needs hardware than cansupport halt<strong>in</strong>g the system.Xil<strong>in</strong>x <strong>Chip</strong>scope and Altera SignalTap are pieces of software to view any <strong>in</strong>ternal signalof an FPGA. They manage this by us<strong>in</strong>g the JTAG <strong>in</strong>terface and modify<strong>in</strong>g the FPGAbitstream with some additi<strong>on</strong>al logic.A M<strong>on</strong>itor program is a utility that is loaded from ROM <strong>in</strong>to an available processor. It isdesigned to use little or no resources so it can run when some hardware isn’t fullyfuncti<strong>on</strong><strong>in</strong>g. It usually communicates over a simple RS232 implementati<strong>on</strong> and allows


the user to write small assembl<strong>in</strong>g programs. These can be used to test various parts of asystem.3.8Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> Versi<strong>on</strong>s and storageThe operat<strong>in</strong>g system for the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> went through various versi<strong>on</strong>s from TOS 1.00 toTOS 2.06 [19].Versi<strong>on</strong> Date Computer Details1.00 20 th November 1985 <str<strong>on</strong>g>ST</str<strong>on</strong>g> Orig<strong>in</strong>al Versi<strong>on</strong>1.02 22 nd April 1987 <str<strong>on</strong>g>ST</str<strong>on</strong>g>, Mega <str<strong>on</strong>g>ST</str<strong>on</strong>g> Mega <str<strong>on</strong>g>ST</str<strong>on</strong>g> Blitter & RTC support1.04 6 th April 1989 <str<strong>on</strong>g>ST</str<strong>on</strong>g>, Mega <str<strong>on</strong>g>ST</str<strong>on</strong>g>, Bug Fixes, faster disk I/OStacy1.60 Unknown <str<strong>on</strong>g>ST</str<strong>on</strong>g>E Support for <str<strong>on</strong>g>ST</str<strong>on</strong>g>E hardware1.62 1 st January 1990 <str<strong>on</strong>g>ST</str<strong>on</strong>g>E Bug Fixes2.05 Unknown Mega <str<strong>on</strong>g>ST</str<strong>on</strong>g>E Support for Mega <str<strong>on</strong>g>ST</str<strong>on</strong>g>E hardware2.06 14 th November 1991 Mega <str<strong>on</strong>g>ST</str<strong>on</strong>g>E Features added to GUI, supportfor all <str<strong>on</strong>g>ST</str<strong>on</strong>g> rangeTable 4 - Comparis<strong>on</strong> of different TOS versi<strong>on</strong>sThe Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> <strong>on</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>is stored <strong>in</strong> PROMs which are ratherout dated these days and not ideal forearly stages of design. N<strong>on</strong> VolatileFlash memory is now the norm and isbe<strong>in</strong>g used as a replacement toPROM, many of the FPGAdevelopment boards c<strong>on</strong>ta<strong>in</strong> someFlash memory.Figure 11 – Flash memory organisati<strong>on</strong>


Read<strong>in</strong>g from Flash is the same as a PROM, but writ<strong>in</strong>g to Flash takes a little more work.Before writ<strong>in</strong>g to Flash memory command sequences need to be issued. Also the data <strong>in</strong>the flash is organised <strong>in</strong>to Blocks as shown <strong>in</strong> figure x.From the Atmel data sheet for the AT49BV040A 4-megabit flash memory chip it’s alsoworth not<strong>in</strong>g that it is not possible to write bits that are currently 0s back to 1s, <strong>on</strong>ly erasecommands can do that. Below is the list of commands that the Atmel Flash memoryuses.ReadFull <strong>Chip</strong> eraseSector erase (block erase)Byte program (Write byte)Boot block lockoutProduct ID entryProduct ID Exit3.9<str<strong>on</strong>g>System</str<strong>on</strong>g> memoryThere are many types of RAM available, but they can be split <strong>in</strong>to two types depend<strong>in</strong>g<strong>on</strong> the technology used to store the data. Dynamic RAM uses capacitance to store acharge represent<strong>in</strong>g a bit of data, therefore it needs to be refreshed periodically. StaticRAM uses flip flops, and thus need more logic per data bit of storage [20].Fast Page Mode (FPM) DRAM is the type of memory fitted to the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>. A rowaddress <strong>on</strong>ly needs to be sent <strong>on</strong>ce, for many accesses to adjacent memory locati<strong>on</strong>s.They are <strong>on</strong>ly comm<strong>on</strong>ly available <strong>in</strong> 5v and usually come <strong>in</strong> a package called a SIMMwith either 30 or 72 p<strong>in</strong>s provid<strong>in</strong>g 8 bits or 32 bits respectively.


EDO DRAM is essentially the same as FPM, except that the tim<strong>in</strong>g has altered slightlyfor a small access time improvement. They are available <strong>in</strong> 5v and 3.3v and usuallycome packaged <strong>in</strong> a 32 bit wide 72 p<strong>in</strong> SIMM.Synchr<strong>on</strong>ous Dynamic RAM (SDRAM) was the first type of synchr<strong>on</strong>ous ram, spawn<strong>in</strong>gmany newer types like Double Data Rate (DDR) SDRAM. Data transfers aresynchr<strong>on</strong>ised to the system clock. To access the SDRAM commands are issued to beexecuted. Due to their command structure and high clock speed (66Mhz and above) theyare <strong>in</strong>herently more difficult to <strong>in</strong>terface to. They are available <strong>in</strong> 5v and more comm<strong>on</strong>ly3.3v and usually come packaged <strong>in</strong> a 64 bit wide 168 p<strong>in</strong> DIMM.Static RAM (SRAM) is quite different from dynamic memory. Rather than us<strong>in</strong>gcapacitors to hold a charge to represent a state of a bit it uses flip flops. This also meansthat it does not need the usual periodic refresh that dynamic RAM needs. It is alsoaddressed by its full address width <strong>in</strong> <strong>on</strong>e transacti<strong>on</strong>, the column and row decod<strong>in</strong>g isd<strong>on</strong>e <strong>in</strong>ternally. The disadvantage of static RAM is the cost. It is generally faster thandynamic RAM and so is often used for cache memory.3.10Serial PortAn RS232 serial port can have many uses from debugg<strong>in</strong>g, transferr<strong>in</strong>g data from a hostcomputer and communicati<strong>on</strong>s. In the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> it was primarily used forcommunicati<strong>on</strong>s with Modem’s. Interfac<strong>in</strong>g a serial port to an FPGA is quite simple, thevoltage levels of RS232 sw<strong>in</strong>g from -12 to +12v so a voltage level translator is neededlike a Maxim MAX232. The software overheads are very small which is why serial isstill favoured over USB and other communicati<strong>on</strong> buses. Serial Ports can beimplemented by <strong>on</strong>ly three wires, ground, transmit and receive.


3.11Video OutputC<strong>on</strong>versi<strong>on</strong>s for video from digital to analogue are usually d<strong>on</strong>e by <strong>on</strong>e of two methods, aspecialist Video DAC or an <strong>in</strong>expensive resistor ladder. An example of the resistorladder was found <strong>in</strong> the schematics of the Xil<strong>in</strong>x Spartan 3A start kit.Figure 12 – Digital to Analogue us<strong>in</strong>g resistor laddersThe resistor ladder is easy to implement and is <strong>in</strong>expensive but suffers from bad picturequality especially when used at higher resoluti<strong>on</strong>s, requir<strong>in</strong>g higher video bandwidth.The resistors used <strong>in</strong> the schematic above are n<strong>on</strong> standard values that appear <strong>in</strong> the E48and <strong>on</strong>wards range of resistor values. They need to be of good quality and high degree oftolerance, but are still susceptible to drift<strong>in</strong>g <strong>in</strong> value with temperature. The video<strong>in</strong>tensity will also change depend<strong>in</strong>g <strong>on</strong> the load that the resistor ladders are driv<strong>in</strong>g <strong>in</strong>to.An example of a Video DAC was found <strong>in</strong> the schematics of the Xil<strong>in</strong>x Spartan-3 PCIExpress Starter Kit. It uses a Philips TDA8777 Video DAC and although requires littleexternal circuitry, it does cost more than the resistor ladder. It has a maximumc<strong>on</strong>versi<strong>on</strong> frequency of 330 MHz. It also helps to protect the FPGA from possibleelectrical damage, as it is bad practice to use n<strong>on</strong> buffered FPGA signals <strong>on</strong>to externalports or c<strong>on</strong>nectors.


Figure 13 – Digital to Analogue us<strong>in</strong>g specialised DAC


Chapter 4Design4.1Comp<strong>on</strong>entsThis secti<strong>on</strong> describes the comp<strong>on</strong>ents chosen and how they will <strong>in</strong>terc<strong>on</strong>nect with eachother. The comp<strong>on</strong>ents chosen have been based <strong>on</strong> the previous research and <strong>on</strong>availability.4.1.1Base HardwareIt has been decided to use the Enterpo<strong>in</strong>t RaggedSt<strong>on</strong>e development board. Theirreduced student price, large FPGA, and plentiful I/O <strong>in</strong>clud<strong>in</strong>g opti<strong>on</strong>al 5v I/O headerwill be ideal. The RaggedSt<strong>on</strong>e was also designed to accept plug <strong>in</strong> daughterboardmodules, <strong>on</strong>e <strong>on</strong> each end of the board.Figure 14 – Enterpo<strong>in</strong>t RaggedSt<strong>on</strong>e FPGA development board


The board has the follow<strong>in</strong>g features:4 Digit 7 Segment Display4Mbit Flash memory (524288 x 8) Atmel AT49BV040A16k Serial EEPROMTemperature SensorOscillator Socket4 LED’s and 2 momentary push switchesVoltage selectors for modules and associated FPGA bank (3.3v and 2.5v)Self resett<strong>in</strong>g Poly fuses4.1.2ProcessorThe CPU chosen is the MC68SEC000, purely because it is the <strong>on</strong>ly versi<strong>on</strong> that is 3.3v.It is object-code compatible with the MC68000 but not entirely hardware compatible.Bus Arbitrati<strong>on</strong> (a method for allow<strong>in</strong>g other devices <strong>on</strong> the system bus to take c<strong>on</strong>trol) ishandled with a 2 wire protocol, <strong>in</strong>stead of the orig<strong>in</strong>al overly complex 3 wire protocol.The differences are covered <strong>in</strong> depth <strong>in</strong> the MC68000 datasheet.The MODE p<strong>in</strong> selects 8 or 16 bit data bus operati<strong>on</strong>, and is sampled at reset.Support for legacy MC6800 synchr<strong>on</strong>ous peripherals has been completely removed. Themiss<strong>in</strong>g signals are the E Clock, VPA (Valid Peripheral Address) and VMA (ValidMemory Address). A <strong>VHDL</strong> comp<strong>on</strong>ent will replicate these signals, creat<strong>in</strong>g asynchr<strong>on</strong>ous bus from the more comm<strong>on</strong>ly used asynchr<strong>on</strong>ous MC68000 bus [21].The processor will fit <strong>on</strong>to a daughterboard <strong>in</strong>stalled <strong>on</strong> the RHS (Right Hand Side) I/Op<strong>in</strong>s. One of the momentary push switches will act as the system reset.


4.1.3<str<strong>on</strong>g>System</str<strong>on</strong>g> memoryThe memory chosen is SRAM (Static RAM), because it simplifies a design and isavailable <strong>in</strong> a variety of voltages. The ability to use it without refresh<strong>in</strong>g means it is greatfor prototypes or <strong>in</strong> debugg<strong>in</strong>g situati<strong>on</strong>s, as the whole design can be halted withoutloos<strong>in</strong>g the c<strong>on</strong>tents of the memory.The memory will fit <strong>on</strong>to a daughterboard <strong>in</strong>stalled <strong>on</strong> the LHS (Left Hand Side) I/Op<strong>in</strong>s.Us<strong>in</strong>g SRAM for the memory will be transparent to the user and all software, and will notcreate any problems.4.1.4Debugg<strong>in</strong>gThe follow<strong>in</strong>g features will aid <strong>in</strong> debugg<strong>in</strong>g the systemA 7 segment display will show the current status of the CPU data and address bus. Asthe display can <strong>on</strong>ly show a maximum of 4 hexadecimal characters, the display willscroll.One of the <strong>on</strong>board switches will be used to step through the operat<strong>in</strong>g system. This willbe achieved by <strong>in</strong>tercept<strong>in</strong>g DTACK and BERR bus cycle term<strong>in</strong>ati<strong>on</strong> signals. This isan <strong>in</strong>terpretati<strong>on</strong> of the design from Microprocessor <str<strong>on</strong>g>System</str<strong>on</strong>g>s Design by Alan Clements.The four <strong>on</strong>board LED’s will be used to show the status of the CPU or other parts of thedesign. One useful signal is HALT which the CPU drives when it has encountered asituati<strong>on</strong> from which it can’t recover. In this state it drives all its p<strong>in</strong>s to high impedance.


A set of 5 header p<strong>in</strong>s will be dedicated as po<strong>in</strong>ts to c<strong>on</strong>nect a dual channel oscilloscope.This will assist <strong>in</strong> f<strong>in</strong>d<strong>in</strong>g tim<strong>in</strong>gs errors, phase and cycle time of clock signals andgeneral verificati<strong>on</strong>.4.1.5Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> Versi<strong>on</strong>s and storageTOS 1.00 has been chosen as the <strong>in</strong>itial Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> to use. Although is suffersfrom many bugs, the BIOS has been listed and fully commented <strong>in</strong> the book “<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>Internals” by Data Becker. Comb<strong>in</strong>ed with the ability to s<strong>in</strong>gle step through each<strong>in</strong>structi<strong>on</strong> will undoubtedly help f<strong>in</strong>d<strong>in</strong>g any problems <strong>in</strong> the design.The operat<strong>in</strong>g system will be stored <strong>in</strong> the Flash memory that is part of the RaggedSt<strong>on</strong>edevelopment board. The Flash memory data bus is <strong>on</strong>ly 8 bits wide, therefore it will benecessary to design a <strong>VHDL</strong> comp<strong>on</strong>ent to wrap around the Flash memory and resize thedata bus to 16 bit that the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> uses.There also needs to be a way to load the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> <strong>in</strong>to the Flash memory. Asthe Flash memory is n<strong>on</strong>-volatile <strong>on</strong>ce this has been programmed, the c<strong>on</strong>tents rema<strong>in</strong>even after power is removed. Xil<strong>in</strong>x have created for their own Spartan developmentboard an FPGA design that uses the RS232 serial port to receive data from a hostcomputer and load <strong>in</strong>to the Flash memory. Their design is based around the PicoBlazesystem <strong>on</strong> chip and us<strong>in</strong>g the <str<strong>on</strong>g>ST</str<strong>on</strong>g> Microelectr<strong>on</strong>ics M29DW323DT Flash memory chip[22].


4.1.65v PCI I/OThe 5v tolerant I/O will be attached to a custom PCB at the rear of the enclosure for thefollow<strong>in</strong>g use:VGA <strong>in</strong>terface portFloppy Disk Drive portRS232 Serial portKeyboard/Mouse <strong>in</strong>terface4.1.7VGAVGA is a mix of analogue and digital. The colour <strong>in</strong>tensity is carried over three analoguesignals for Red Green and Blue. The horiz<strong>on</strong>tal and vertical synchr<strong>on</strong>isati<strong>on</strong> signals aredigital 5v.Figure 15 – VGA video tim<strong>in</strong>g


The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> can display colours from a palette of 4096 different colours. Thereforeeach colour comp<strong>on</strong>ent can have 2^4 levels of <strong>in</strong>tensity. To c<strong>on</strong>vert from the digitaloutput from an FPGA to the analogue <strong>in</strong>put of a VGA m<strong>on</strong>itor, a DAC (Digital toAnalogue) c<strong>on</strong>verter will be used.4.1.8Floppy Disk DriveThe floppy drive requires a m<strong>in</strong>imum of 11 signals to functi<strong>on</strong>. In the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> thesewere the follow<strong>in</strong>g, with reference to the p<strong>in</strong> number <strong>on</strong> the 34 p<strong>in</strong> 0.1” pitch IDC header[23].To Floppy Drive• 10: Drive Select• 16: Motor On• 18: Step Directi<strong>on</strong> When you step the head, this l<strong>in</strong>e must tell the drive whether tostep <strong>in</strong> or out.• 20: Step. This l<strong>in</strong>e is briefly signaled to step the drive <strong>on</strong>e track <strong>in</strong> the directi<strong>on</strong>step directi<strong>on</strong> specifies (<strong>in</strong> or out).• 22: Write Data. This is a bit stream data for the disk track at around 100,000 baud.• 24: Read/Write. When +5, the drive is read<strong>in</strong>g. When +0, the drive is writ<strong>in</strong>g.• 32: Side Select. Pull to +0 volts to write to back side of diskette.From Floppy Drive• 8: Index Pulse. Goes to ground briefly each rotati<strong>on</strong>, five times per sec<strong>on</strong>d (300RPM). Otherwise +5.• 26: Track 0. +5 unless drive is at track 0, when this p<strong>in</strong> goes to +0 volts. This ishow the drive tells the FDC to stop stepp<strong>in</strong>g it towards track 0.• 28: Write Protect. +0 volts if the write protect tab is set <strong>on</strong> the diskette; +5 volts ifit is okay to write to the diskette.


• 30: Read Data: This is the bit stream data from the track, at 100,000 baud,complete with wow and flutter.The floppy drive used <strong>in</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> was <strong>in</strong> fact the same as used <strong>in</strong> many IBM Cl<strong>on</strong>ePCs. The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> from TOS v1.02 <strong>on</strong>wards even uses the FAT12 fil<strong>in</strong>g system,compatible with a PC formatted disk.4.1.9RS232 SerialThe RS232 will serve two purposes. Firstly it is used asan <strong>in</strong>terface to a host computer to transfer the operat<strong>in</strong>gsystem <strong>in</strong>to the Flash Memory. Sec<strong>on</strong>dly, it will be usedfor the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> serial port. The more comm<strong>on</strong> 9 p<strong>in</strong>female D-Type c<strong>on</strong>nector will be used, <strong>in</strong>stead of the<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> 25p<strong>in</strong> D-Type c<strong>on</strong>nector. Flow c<strong>on</strong>trol andspecialist MODEM <strong>on</strong>ly signals will be omitted to reducethe number of FPGA I/Os needed from 9 down to <strong>on</strong>ly 2.Table 5 – Serial port p<strong>in</strong>descripti<strong>on</strong>Figure 16 – RS232 to TTL level translator


4.1.10Keyboard and MouseThe <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> communicates to the keyboard via a simple serial <strong>in</strong>terface. The orig<strong>in</strong>alkeyboard c<strong>on</strong>ta<strong>in</strong>s a small Hitachi microc<strong>on</strong>troller that scans the keyboard matrix and thestatus of the mouse and joysticks. It then creates packets of data to be sent over the serialc<strong>on</strong>necti<strong>on</strong> to the MC6850 UART <strong>on</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> motherboard. The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> keyboard andmouse c<strong>on</strong>ta<strong>in</strong> mechanical comp<strong>on</strong>ents, and are <strong>on</strong>e of the first parts to break or becomefaulty. For this reas<strong>on</strong> it has been decided to implement a c<strong>on</strong>versi<strong>on</strong> from PC PS2keyboard and mouse protocol. A project called ‘Eiffel’ by Laurent Favard, and laterDidier Méquign<strong>on</strong> does just that, us<strong>in</strong>g an <strong>in</strong>expensive PIC Microc<strong>on</strong>troller [24].4.2Other differences between the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> and the designThe <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> as menti<strong>on</strong>ed previously has 3 different resoluti<strong>on</strong>s. The m<strong>on</strong>ochrome highresoluti<strong>on</strong> has vertical and horiz<strong>on</strong>tal tim<strong>in</strong>gs that are close to the VGA specificati<strong>on</strong>.The Low and Medium colour resoluti<strong>on</strong>s, which were designed to be displayed <strong>on</strong> atelevisi<strong>on</strong>, do not meet the VGA tim<strong>in</strong>g specificati<strong>on</strong>. The problem arises from the slowpixel clock, result<strong>in</strong>g <strong>in</strong> a horiz<strong>on</strong>tal synchr<strong>on</strong>isati<strong>on</strong> frequency of 15 KHz, which is halfof VGA tim<strong>in</strong>g. To use the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> <strong>in</strong> all three resoluti<strong>on</strong>s it meant you either need tohave both a televisi<strong>on</strong> and high resoluti<strong>on</strong> m<strong>on</strong>itor, or a very expensive ‘Multisync’m<strong>on</strong>itor. To overcome this, a device known as a ‘scan doubler’ will be designed to bufferthe RGB data and resynchr<strong>on</strong>ise it to a higher pixel clock.The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> didn’t have the facility for an <strong>in</strong>ternal hard drive, to keep the costs low.However, a DMA port was available for c<strong>on</strong>nect<strong>in</strong>g to external hard drives. The <str<strong>on</strong>g>Atari</str<strong>on</strong>g><str<strong>on</strong>g>ST</str<strong>on</strong>g> was designed just before the SCSI (Small Computer <str<strong>on</strong>g>System</str<strong>on</strong>g> Interface) commandprotocol was f<strong>in</strong>alised, and thus <str<strong>on</strong>g>Atari</str<strong>on</strong>g> used the ACSI (<str<strong>on</strong>g>Atari</str<strong>on</strong>g> Computer <str<strong>on</strong>g>System</str<strong>on</strong>g> Interface)command protocol.


As the IDE (Integrated Disk Electr<strong>on</strong>ics) hard drives became popular <strong>on</strong> IBM PC Cl<strong>on</strong>es,their price dropped compared to the SCSI equivalent. <str<strong>on</strong>g>Atari</str<strong>on</strong>g> realized that and <strong>on</strong> their lasthome computers, the Falc<strong>on</strong> and Stacy, they added IDE support.The design will use a simple IDE <strong>in</strong>terface, to use a Compact Flash card <strong>in</strong> IDE mode asthey are 3.3v tolerant which enables direct l<strong>in</strong>k<strong>in</strong>g to the Xil<strong>in</strong>x FPGA. As an IDE<strong>in</strong>terface is to be designed, the orig<strong>in</strong>al ACSI port will be left out of the design [25].The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> featured a port for a cartridge, sometimes known as the ROM port. As thename suggests this is a read <strong>on</strong>ly direct c<strong>on</strong>necti<strong>on</strong> to the CPU data and address bus. Thedesign will not <strong>in</strong>clude this, as although easy to implement <strong>in</strong> logic, the required 2mmpitch edge c<strong>on</strong>nector is not available. It is also not needed for the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> to functi<strong>on</strong>, itrarely used for software protecti<strong>on</strong> d<strong>on</strong>gles and most recently Ethernet and USB<strong>in</strong>terfaces.The MIDI ports are <strong>on</strong>ly use by music sequenc<strong>in</strong>g software and are not an essential partof the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> design. They are based around the same UART that the keyboard uses.MIDI uses a current loop, where the current, not the voltage level def<strong>in</strong>es the logic state.Therefore, MIDI ports require quite a bit of additi<strong>on</strong>al external circuitry.The external 2 nd floppy drive port will not beimplemented as no software requires twodrives. The <strong>on</strong>ly case where <strong>on</strong>e may beuseful is duplicat<strong>in</strong>g floppy disks, but themajority of floppy disk copy<strong>in</strong>g software usethe system RAM as temporary storage offiles.The design will be built <strong>in</strong>to a standard MicroATX enclosure. This will provide physicalprotecti<strong>on</strong> for the delicate electr<strong>on</strong>ics and Figure 17 – ATX p<strong>in</strong> descripti<strong>on</strong>


allow use of an ATX power supply. The ATX power supply provides a wide range ofvoltages. One <strong>in</strong> particular, the +5v Standby can be used to provide power to additi<strong>on</strong>alcircuitry <strong>on</strong> a motherboard. This is used to support soft-off or standby and can be used forremote wake up through Wake-<strong>on</strong>-R<strong>in</strong>g or Wake-<strong>on</strong>-LAN. It has been chosen that the‘Eiffel’ Keyboard and Mouse microc<strong>on</strong>troller will be powered from this +5v standbyvoltage and use modified firmware to c<strong>on</strong>trol the ATX power supply. This allows thePower On key <strong>on</strong> many extended PS2 keyboards to turn <strong>on</strong> the computer.Figure 18 – Design Block diagramTo summarise, the design will follow the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>, but make use of morecomm<strong>on</strong> and readily available comp<strong>on</strong>ents from IBM PC Cl<strong>on</strong>es.


4.3Process of Implementati<strong>on</strong>The implementati<strong>on</strong> will be created <strong>in</strong> stages, logically from a small system with m<strong>in</strong>imalIP Cores to the f<strong>in</strong>al versi<strong>on</strong>. Below is a brief proposal of stages <strong>in</strong>volved. The ordermay change dur<strong>in</strong>g implementati<strong>on</strong> due to certa<strong>in</strong> stages requir<strong>in</strong>g later parts of thedesign.A simple LED FlashVerify Video Digital to Analogue worksA project to transfer Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> <strong>in</strong>to Flash memoryTest read<strong>in</strong>g from Flash memoryA new project with support logic, reset and clock generati<strong>on</strong>A debug c<strong>on</strong>trol and displayAdd Glue IP Core and verifyAdd MMU IP Core, SRAM memory and verifyAdd Shifter IP Core and verifyAdd MFP IP Core and verifyAdd Yamaha IP Core and verifyAdd Keyboard/Mouse ACIA IP CoreAdd Eiffel <strong>in</strong>terface and verifyAdd DMA IP Core and verifyAdd FDC IP Core and verify


Chapter 5Implementati<strong>on</strong>5.1Flash<strong>in</strong>g LEDThe first task was to make sure that the oscillator clock works and that the JTAGprogramm<strong>in</strong>g works. To do this a simple LED flash rout<strong>in</strong>e was written. However,before this was d<strong>on</strong>e, c<strong>on</strong>stra<strong>in</strong>ts for the I/O p<strong>in</strong> mapp<strong>in</strong>g and a top level comp<strong>on</strong>entneeded to be written. This was d<strong>on</strong>e by look<strong>in</strong>g at the schematics of the RaggedSt<strong>on</strong>edevelopment board and laboriously assign<strong>in</strong>g names for each I/O p<strong>in</strong>. Appendix A liststhe c<strong>on</strong>stra<strong>in</strong>ts file and comp<strong>on</strong>ent file.Shown right was the <strong>VHDL</strong>architecture for flash<strong>in</strong>g anLED at approximately 1Hzus<strong>in</strong>g a 32MHz oscillatorclock.architecture Behavioral of ma<strong>in</strong> wassignal counter : std_logic_vector(24 downto 0);beg<strong>in</strong>process(clock) wasbeg<strong>in</strong>if ris<strong>in</strong>g_edge(clock) thencounter


development board, so us<strong>in</strong>g the project <strong>on</strong> the Raggedst<strong>on</strong>e will not work as the p<strong>in</strong>c<strong>on</strong>stra<strong>in</strong>ts are wr<strong>on</strong>g. To rectify this, the top level of the project was <strong>in</strong>stantiated as acomp<strong>on</strong>ent us<strong>in</strong>g the same c<strong>on</strong>stra<strong>in</strong>ts from the previous LED Flasher stage.Another change that needed to be madewas to exchange the 32 MHz oscillatorfor a 50 MHz oscillator as menti<strong>on</strong>ed <strong>in</strong>the comments <strong>in</strong> the colour patterngenerator project. If this isn’t changed thesignals will not adhere to the VGAspecificati<strong>on</strong> and a m<strong>on</strong>itor will unlikelybe able to ‘sync’ to the reducedfrequencies.Figure 20 – Colour test displayOnce the project was built a colourful test pattern was displayed <strong>on</strong> an attached VGAm<strong>on</strong>itor. This verifies that the video DAC was functi<strong>on</strong><strong>in</strong>g correctly and the c<strong>on</strong>versi<strong>on</strong>from 3.3v to 5v works well, even for high speed digital signals.5.3Writ<strong>in</strong>g bytes to Flash MemoryNext <strong>on</strong> the list was to load data <strong>in</strong>to theRaggedSt<strong>on</strong>e <strong>on</strong>board Flash memory.A design was found <strong>on</strong> the Xil<strong>in</strong>xwebsite for the Spartan-3A/3ANDevelopment Starter Kit. This designwas <strong>in</strong>tended to be used with the <str<strong>on</strong>g>ST</str<strong>on</strong>g>Microelectr<strong>on</strong>ics M29DW323DT Flashmemory that was featured <strong>on</strong> the Xil<strong>in</strong>xSpartan-3A/3AN development board. Itthe Xil<strong>in</strong>x Picoblaze embeddedFigure 20 –Flash Programmer menuuses


microc<strong>on</strong>troller, and by us<strong>in</strong>g a simple term<strong>in</strong>al program over an RS232 serial c<strong>on</strong>necti<strong>on</strong>you can manually program <strong>in</strong>dividual bytes, download complete files, erase the flash,read the memory to verify c<strong>on</strong>tents, and display the Flash memory device identifier and64-bit unique device numbers.An RS232 serial port was added as menti<strong>on</strong>ed <strong>in</strong> the Design. (Paragraph 4.1.9)After build<strong>in</strong>g the project for the RaggedSt<strong>on</strong>e board, it became apparent that it didn’twork. The menu choices were available prov<strong>in</strong>g the serial c<strong>on</strong>necti<strong>on</strong> worked f<strong>in</strong>e butprogramm<strong>in</strong>g a s<strong>in</strong>gle byte didn’t work, let al<strong>on</strong>e the entire Flash memory space. The<strong>on</strong>ly real difference between the Xil<strong>in</strong>x Spartan-3A/3AN development board and theRaggedSt<strong>on</strong>e was the type of Flash memory device. The RaggedSt<strong>on</strong>e uses an AtmelAT49BV040A and the Xil<strong>in</strong>x board uses an <str<strong>on</strong>g>ST</str<strong>on</strong>g> Microelectr<strong>on</strong>ics M29DW323DT, bothc<strong>on</strong>figured as 8 bit wide data bus. The difference becomes quite clear when read<strong>in</strong>g thedata sheets provided by the manufacturers.


Table 6 – Comparis<strong>on</strong> of different Flash memory commandsFlash Memory works with commands that are passed <strong>on</strong> the address bus, and it can beseen that the commands vary from different manufacturers. However, as the project usesa PicoBlaze microc<strong>on</strong>troller it was quite easy to change the software that it runs to usedifferent commands. Luckily, the assembler source code for the PicoBlaze was providedand was commented and structured cleanly. The commands with ‘AAA’ are changed to‘555’ and the commands with ‘555’ are changed to ‘AAA’. The assembler source wasthen assembled with the PicoBlaze assembler which generates a <strong>VHDL</strong> ROM file.


After these changes were made the <strong>in</strong>dividual bytes of the Flash memory could beprogrammed and read back. However, the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> operat<strong>in</strong>g system was 192K bytes, sothere needs to be a method of programm<strong>in</strong>g an entire file to the Flash memory.5.4Writ<strong>in</strong>g file to Flash MemoryThe programmer menu does accept entire files, but of the MCS type. MCS was a fileformat by Xil<strong>in</strong>x for stor<strong>in</strong>g the FPGA c<strong>on</strong>figurati<strong>on</strong> <strong>in</strong>side a PROM. It’s formatted as anASCII file with each l<strong>in</strong>e follow<strong>in</strong>g the format below.: [ Address ] [ Data ] [ CR ] [ LF ]Figure 22 – MCS file formatThe PicoBlaze project expects this file format, so the project was changed with a newchoice <strong>in</strong> the menu to read raw bytes from the serial port and program the Flash memory,<strong>in</strong>crement<strong>in</strong>g the address <strong>on</strong> each byte. A test was then d<strong>on</strong>e after each byte programmedto see if the address had reached 196608. This way a raw b<strong>in</strong>ary file can be transferredand programmed. Appendix C shows the assembler source code for this part of theprogram.It’s important to use a term<strong>in</strong>al program that is capable of send<strong>in</strong>g raw b<strong>in</strong>ary data. Itwas found Microsoft’s HyperTerm<strong>in</strong>al <strong>in</strong>terprets some of the raw data as term<strong>in</strong>al c<strong>on</strong>trolcodes and these w<strong>on</strong>’t get sent out over the serial port. A rather good freeware programcalled Realterm which has a vast array of opti<strong>on</strong>s was used <strong>in</strong>stead of HyperTerm<strong>in</strong>al.After these changes were made the Flash memory was successfully programmed with the<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> operat<strong>in</strong>g system, versi<strong>on</strong> 1.00.


5.5CPUNow it was time for the CPU to be c<strong>on</strong>nected to the FPGA. A daughter board wascreated to be used <strong>on</strong> the RaggedSt<strong>on</strong>es right hand I/O bank. The MC68EC000 andMC68SEC000 feature a MODE p<strong>in</strong> which selects the data bus, and as the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> usesa 16 bit data bus this was tied to VCC. Any bidirecti<strong>on</strong>al signals, like the CPU data busare term<strong>in</strong>ated with Xil<strong>in</strong>x <strong>in</strong>ternal pull-ups that were added as c<strong>on</strong>stra<strong>in</strong>ts <strong>in</strong>to thedesign.5.6ResetNext was to provide the new CPU with a clock and reset. The <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> uses an NE555timer chip to produce the reset signal. This is activated <strong>on</strong> power up and whenever thereset butt<strong>on</strong> is pressed. A <strong>VHDL</strong> comp<strong>on</strong>ent was created with a couple of counters, <strong>on</strong>efor a power up reset signal and the other to produce a reset signal when the reset butt<strong>on</strong> ispressed.It is important to have these two different reset signals, as some parts of the design <strong>on</strong>lyneed to be reset <strong>on</strong> power up to known states. One of these comp<strong>on</strong>ents was the clocksignal comp<strong>on</strong>ent. It was important for the CPU that the clock was runn<strong>in</strong>g while a resetis issued, and that the reset was active for at least 132 clock cycles [27].Appendix D lists the <strong>VHDL</strong> reset comp<strong>on</strong>ent with the RaggedSt<strong>on</strong>e switch S1 used as thereset butt<strong>on</strong>.5.7ClockThe clock comp<strong>on</strong>ent was necessary for generati<strong>on</strong> of clock signals from the masterclock, which <strong>in</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> was 32 MHz. Below, was the clock frequencies that eachcomp<strong>on</strong>ent of the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> needs.• CPU – 8 MHz• GLUE – 8 MHz


• MMU – 16 MHz• SHIFTER – 32MHz• MFP – 4 MHz and 2.4576 MHz• YM2149 – 2 MHz• ACIA – E Clock and 0.5 MHz• FDC – 8 MHz• DMA – 8 MHzIt was found that it’s very important to use the dedicated DCM (Digital ClockManagement) PLLs (Phase Locked Loops) that are provided <strong>in</strong>side the Xil<strong>in</strong>x Spartan.Us<strong>in</strong>g these reduces clock skew and jitter, and also use dedicated global clock routes<strong>in</strong>side the FPGA. This was to help prevent the clock edges arriv<strong>in</strong>g at different times tovarious comp<strong>on</strong>ents <strong>in</strong> the FPGA. The DCM can divide a clock from the masterfrequency and/or multiply it. Without us<strong>in</strong>g DCMs the Xil<strong>in</strong>x ISE software wasproduc<strong>in</strong>g warn<strong>in</strong>gs about n<strong>on</strong> dedicated clock rout<strong>in</strong>g, and build<strong>in</strong>g the project with <strong>on</strong>lysmall changes was result<strong>in</strong>g <strong>in</strong> very significant changes <strong>in</strong> system stability. As a result ofus<strong>in</strong>g DCM and dedicated clock rout<strong>in</strong>g there was a twofold <strong>in</strong>crease <strong>in</strong> maximum clockfrequency [28], [29], [30].The MFP <strong>in</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> used a dedicated crystal to achieve the 2.4576 MHz frequency.This was used by the MFP for the serial port baud rate. In the FPGA it was possible touse a DCM to create this frequency. The most accurate was to synthesize a 27 MHzclock from the 32 MHz master clock and then divide by 11 to get 2.4545 MHz.5.8Synchr<strong>on</strong>ous Bus <strong>in</strong>terfaceThe ACIA uses the E Clock, which unfortunately the MC68SEC000 CPU doesn’tprovide. The E Clock was at <strong>on</strong>e tenth of the CPU frequency with a 60/40 duty cycle.The 68SEC000 also doesn’t have c<strong>on</strong>necti<strong>on</strong>s for the VPA or VMA signals.


The E Clock was created bya counter that counts from 0to 9 and then rolls over. Ifthe value of the counter was0 to 5 then the E clock was0, otherwise it will be 1. TheGlue comp<strong>on</strong>ent of the <str<strong>on</strong>g>Atari</str<strong>on</strong>g><str<strong>on</strong>g>ST</str<strong>on</strong>g> then asserts the VPAsignal to tell the CPU anaccess to a 6800 synchr<strong>on</strong>ousdevice has been made, whichFigure 23 – Synchr<strong>on</strong>ous bus <strong>in</strong>terface<strong>in</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> was an access to the Keyboard or Midi ACIA MC6850. The VPAsignal was checked when the E Clock counter was 2, and if it was active then VMA wasasserted. DTACK was then asserted later when the E Clock counter was 8 or 9 to endthe bus cycle. By assert<strong>in</strong>g DTACK late, the CPU automatically <strong>in</strong>serts wait states.Appendix E shows the Clock <strong>VHDL</strong> comp<strong>on</strong>ent.5.9Flash data bus resiz<strong>in</strong>gNow that the clock and reset was provided to the CPU, next was to make the c<strong>on</strong>necti<strong>on</strong>between CPU and Flash memorywhere the operat<strong>in</strong>g system waslocated. As previouslymenti<strong>on</strong>ed, the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> had 16bit wide ROM, but theRaggedst<strong>on</strong>e Flash memory was<strong>on</strong>ly 8 bit wide.Figure 24 – Flash State mach<strong>in</strong>e


As the MC68000 completes a bus cycle <strong>in</strong> 4 cycles (500ns at 8 MHz), and the AtmelAT49BV040A has an access time of 70ns it’s quite possible to fit two 8 bit accesses tothe Flash to make it appear 16 bit wide to the CPU. To achieve this, a wrapper <strong>VHDL</strong>comp<strong>on</strong>ent was created with a FSM (F<strong>in</strong>ite State Mach<strong>in</strong>e) c<strong>on</strong>troll<strong>in</strong>g latch<strong>in</strong>g of dataand the LSB of the address. Appendix F shows the <strong>VHDL</strong> comp<strong>on</strong>ent.5.107 Segment DisplayAs part of debugg<strong>in</strong>g, a <strong>VHDL</strong> comp<strong>on</strong>ent was created to use the RaggedSt<strong>on</strong>e <strong>on</strong>board7 segment display. The RaggedSt<strong>on</strong>e has four of these 7 segment displays, enabl<strong>in</strong>g 4hex characters (or 16 bits) to be displayed. This was perfect for display<strong>in</strong>g the 16 bit databus, but not the 24 bit address bus. To overcome this limitati<strong>on</strong>, the display willsequence through the upper porti<strong>on</strong> of the address bus, then the lower porti<strong>on</strong> of theaddress bus and lastly the data bus.The <strong>VHDL</strong> comp<strong>on</strong>ent will also be resp<strong>on</strong>siblefor chang<strong>in</strong>g the 4 bit hex value <strong>in</strong>to a value todrive the 7 segment display. The 7 segmentdisplays <strong>on</strong> the RaggedSt<strong>on</strong>e, are just a set ofLEDs with no <strong>in</strong>telligence. Another part it willcater for was scann<strong>in</strong>g the digits of the 7 Figure 25 – 7 segment displaysegment display. Only <strong>on</strong>e digit can be displayed at <strong>on</strong>e time, and thus it needs to scanthrough the digits quick enough for the human eye not to see any flicker. Appendix Gshows this <strong>VHDL</strong> comp<strong>on</strong>ent. One problem encountered was that the mapp<strong>in</strong>g for thedigits to FPGA p<strong>in</strong>s listed <strong>in</strong> the RaggedSt<strong>on</strong>e user manual appears to be wr<strong>on</strong>g. Thetable below shows the correct p<strong>in</strong> mapp<strong>in</strong>g.Digit 1 Digit 2 Digit 3 Digit 5FPGA U14 FPGA AA17 FPGA U17 FPGA U16Table 7 – FPGA c<strong>on</strong>necti<strong>on</strong>s for 7 segment display


5.11S<strong>in</strong>gle StepHav<strong>in</strong>g the address and data bus displayed was <strong>on</strong>ly good if there was a way to slow thesystem down, or even s<strong>in</strong>gle step through each <strong>in</strong>structi<strong>on</strong>. A soluti<strong>on</strong> was available,with the idea taken from ‘Microprocessors <str<strong>on</strong>g>System</str<strong>on</strong>g> Design’ by Alan Clements. AlanClements design was for a s<strong>in</strong>gle board computer based <strong>on</strong> the MC68000, where <strong>on</strong>e canpause the CPU and by press<strong>in</strong>g a push butt<strong>on</strong>, s<strong>in</strong>gle step through <strong>in</strong>structi<strong>on</strong>s. Hisdesign was based <strong>on</strong> four TTL logic flip flops. Appendix H shows the schematic design.Quite simply there was a switch to bypass and let the system run normally. In s<strong>in</strong>gle stepmode the DTACK signal was <strong>in</strong>tercepted. When the MC68000 starts a bus cycle it will<strong>in</strong>sert wait states until it receives the DTACK signal.A momentary push switchc<strong>on</strong>trols the asserti<strong>on</strong> of DTACK , with flip flops used to de-bounce the push butt<strong>on</strong> and<strong>in</strong>sure <strong>on</strong>ly <strong>on</strong>e bus cycle was executed no matter how l<strong>on</strong>g or short the butt<strong>on</strong> was helddown for.The <strong>VHDL</strong> comp<strong>on</strong>ent <strong>in</strong> Appendix I for s<strong>in</strong>gle step works <strong>on</strong> the same pr<strong>in</strong>ciples.However, the BERR signal was also <strong>in</strong>tercepted as this signal was also used to term<strong>in</strong>atea bus cycle <strong>in</strong> the event of a bus cycle error, e.g. no device at address specified. One ofthe RaggedSt<strong>on</strong>e butt<strong>on</strong>s, S2 was used as the s<strong>in</strong>gle step butt<strong>on</strong>. The Run/Stop wasimplemented as a ‘jumper’ across two spare I/O p<strong>in</strong>s <strong>on</strong> the RaggedSt<strong>on</strong>e.5.12Glue IP coreBefore try<strong>in</strong>g the system the Glue <strong>VHDL</strong> IP Core had to be added. It was at this po<strong>in</strong>tthat I noticed the IP Cores at the top level used bit and bit_vector signal types and all theother comp<strong>on</strong>ents that I had written used std_logic and std_logic_vector. It is possible toc<strong>on</strong>vert between the two types, but this can become untidy because it is no possible to dothe c<strong>on</strong>versi<strong>on</strong> with<strong>in</strong> the comp<strong>on</strong>ent port maps. A decisi<strong>on</strong> was made to alter the


previous comp<strong>on</strong>ents to use bit and bit_vector which creates a cleaner implementati<strong>on</strong>.The <strong>on</strong>ly parts to use std_logic and std_logic_vector are when the signals leave the FPGAand need to be bi-directi<strong>on</strong>al or tri-state.The Glue is needed for address decod<strong>in</strong>g, and it is resp<strong>on</strong>sible for generat<strong>in</strong>g the chipselect for the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> ROM space. An excerpt from the Glue comp<strong>on</strong>entwf25915ip_adrdec.vhd is shown <strong>in</strong> figure 24.ROM_2n = x"FC" and ADR_HI < x"FD" else-- <str<strong>on</strong>g>ST</str<strong>on</strong>g> TOS ROM LOW.'0' when READx = '1' and ADR_INT < x"000008" else '1';-- TOS mirror<strong>in</strong>g.ROM_1n = x"FD" and ADR_HI < x"FE" else-- <str<strong>on</strong>g>ST</str<strong>on</strong>g> TOS ROM MID.ROM_0n = x"FE" and ADR_HI < x"FF" else'1'; -- <str<strong>on</strong>g>ST</str<strong>on</strong>g> TOS ROM HI.Figure 26 – Address decod<strong>in</strong>g <strong>in</strong> GlueThe <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> used 6 small 8 bit wide 32KB PROMs to make up the 192KB size of theoperat<strong>in</strong>g system. With the ROM be<strong>in</strong>g accessed as 16 bit, this requires the three chipselect l<strong>in</strong>es shown <strong>in</strong> the above <strong>VHDL</strong> code. The ROM space was located from0xFC0000 to 0xFEFFFF. A special mirror, or sometimes known as shadow was createdfor the first 8 bytes of the operat<strong>in</strong>g system, located at address 0x000000 to 0x000007.The purpose of this was expla<strong>in</strong>ed <strong>in</strong> the 9 th Editi<strong>on</strong> of the MC68000 User ManualFigure 27 – MC68000 Start up sequenceInspect<strong>in</strong>g the start of the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> with a hexadecimal editor shows the valuesthat get loaded <strong>in</strong>to the SSP (Supervisor Stack Po<strong>in</strong>ter) and PC (Program Counter). After


the CPU has fetched these two l<strong>on</strong>g words, it c<strong>on</strong>t<strong>in</strong>ues executi<strong>on</strong> from the address <strong>in</strong> thePC. The address was 0xFC0020 which was a jump <strong>in</strong>to the ROM space. It can be seenthat absolute addresses are 32 bit, even though the external address bus was <strong>on</strong>ly 24 bit.The RaggedSt<strong>on</strong>e has four <strong>on</strong>board LEDs. Theseare assigned to the follow<strong>in</strong>g signals, BERR ,DTACK , RESET and HALT . The systemwas then powered up and the start up sequence ofTable 8 – Start of Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g>the RESET and HALT rema<strong>in</strong><strong>in</strong>g active for 1 sec<strong>on</strong>d was observed. The 7 segmentdisplay then shows the address as 0x000000 and data as 0x601E. Press<strong>in</strong>g the s<strong>in</strong>gle stepbutt<strong>on</strong> showed the address change to 0x000002 and the data as 0x0100.The comp<strong>on</strong>ents verified as work<strong>in</strong>g are the CPU, GLUE address decod<strong>in</strong>g, 7 segmentdebug display, Flash memory and the s<strong>in</strong>gle step comp<strong>on</strong>ent. At this stage other subcomp<strong>on</strong>ents of the GLUE, like the <strong>in</strong>terrupt c<strong>on</strong>troller and video tim<strong>in</strong>g generati<strong>on</strong> areleft unc<strong>on</strong>nected, or <strong>in</strong> <strong>VHDL</strong> terms ‘open’ <strong>in</strong> the port map.When build<strong>in</strong>g the project with the Glue added to the project, the Xil<strong>in</strong>x ISE softwarewould crash with an excepti<strong>on</strong> error and c<strong>on</strong>sequently exit. After a lot of trial and error itwas found that upgrad<strong>in</strong>g from Xil<strong>in</strong>x ISE v8.2 to Xil<strong>in</strong>x ISE v9.2 solved this problem!The system can now be stepped through, up until the address 0xFC05DA. At this po<strong>in</strong>t aBERR (bus error) is signalled for the bus cycle. Look<strong>in</strong>g through the commentedassembler source code of the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> it can be seen that a read was attemptedfrom RAM. Without the MMU implemented to generate a DTACK resp<strong>on</strong>se, theGLUE time out counter issues a BERR resp<strong>on</strong>se.


5.13MMU IP coreNext to implement was the MMU toenable the system to run further throughthe operat<strong>in</strong>g system. The SRAM ma<strong>in</strong>memory chosen was the BS616LV8017512K by 16 bit SRAM used <strong>in</strong>c<strong>on</strong>juncti<strong>on</strong> with a Roth Elektr<strong>on</strong>ikTSOP to DIL adapter. This wasmounted <strong>on</strong>to the RaggedSt<strong>on</strong>es lefthand I/O bank.Figure 28 – SRAM and adapter PCBOne of the MMUs tasks was to keep the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> DRAM memory refreshed. As thedesign was us<strong>in</strong>g SRAM this refresh<strong>in</strong>g must be disabled. This also makes debugg<strong>in</strong>g fareasier as the <strong>on</strong>ly accesses to RAM will be memory accesses, not refresh cycles as well.To remove the refresh<strong>in</strong>g the refresh address counter was removed from the multiplexer<strong>in</strong> wf25912ip_ram_adrmux.vhd.M_ADR '0');Figure 29 – Removed refresh address generati<strong>on</strong>


Also, when <strong>in</strong> the MCU_PHASE = REFRESH state the asserti<strong>on</strong> of RAS was removed <strong>in</strong>wf25912ip_ctrl.vhd.--RAS0n


c<strong>on</strong>figurati<strong>on</strong>. It does this many times; therefore s<strong>in</strong>gle stepp<strong>in</strong>g through this secti<strong>on</strong>would be laborious.A problem was found <strong>in</strong> the RAM test however which took a great deal of time to figureout. The CPU has its Stack Po<strong>in</strong>ter loaded right at the start up<strong>on</strong> reset, and with TOS 1.00that is 0x601E0100 (paragraph 5.12). In TOS 1.00 there is a complex RAM test thatfollows from 0xFC014A <strong>on</strong>wards. It first modifies the bus error vector to po<strong>in</strong>t to ahander rout<strong>in</strong>e (0xFC0188). It starts at 128k and <strong>in</strong>crements by 128k read<strong>in</strong>g and writ<strong>in</strong>gcheck<strong>in</strong>g if the RAM is there. When it reaches 1MB or more it goes out of the RAMrange and a BERR is signalled to the CPU from the MMU.The CPU then goes to save the program counter and copy the status register <strong>on</strong>to thestack, before it fetches the vector address from address 0x000008. The problem is thatthe stack po<strong>in</strong>ter is still 0x601E0100 and that creates another bus error. Two bus errors<strong>in</strong> close successi<strong>on</strong> create what Motorola call a double bus fault happens, and the CPUsignal it has halted [27].To mitigate this issue the MMU was fixed to generate a DTACK for a small addressregi<strong>on</strong> from 0x1E0100 to 0x1E00F0.At this stage it was also evident that the SRAM memory can hold its c<strong>on</strong>tents for a fewsec<strong>on</strong>ds after power has been removed. On the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> a ‘cold reset’ can beperformed by power<strong>in</strong>g <strong>on</strong> and off the power supply, and with the refresh<strong>in</strong>g of theDRAM not be<strong>in</strong>g performed, the c<strong>on</strong>tents are lost. With the SRAM memory and the factthat the design takes less power than the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> power<strong>in</strong>g <strong>on</strong> and off the powersupply may not be enough to force a cold reset.


5.14Hardware Breakpo<strong>in</strong>tA change was made to the s<strong>in</strong>gle step unit, add<strong>in</strong>g <strong>in</strong> address ranges to qualify for thes<strong>in</strong>gle step mode. In other words, some porti<strong>on</strong>s of the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> can run atnormal speed and when a certa<strong>in</strong> address was encountered a break was made <strong>in</strong>to S<strong>in</strong>gleStep mode. To enable this, the follow<strong>in</strong>g code was entered <strong>in</strong>to the top level of theproject.CPU_DTACK = x"FC0200")else'0' when ss_dtack = '0'else'1';Figure 32 – S<strong>in</strong>gle Step DTACK generati<strong>on</strong>With this modificati<strong>on</strong> <strong>in</strong> place the system was <strong>on</strong>ce aga<strong>in</strong> tested. After a brief flicker <strong>on</strong>the 7 segment display the breakpo<strong>in</strong>t was hit at address 0xFC01AA after the memory test,but before the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> programs the MMU with the RAM c<strong>on</strong>figurati<strong>on</strong>. It’snow possible to s<strong>in</strong>gle step and view the value written to the MMU register at address0xFF8001. The value was 0x05 which accord<strong>in</strong>g to the memory map from ‘<str<strong>on</strong>g>ST</str<strong>on</strong>g> Internals’is a total of 1MB, arranged as two banks of 512KB.Table 9 – Memory C<strong>on</strong>figurati<strong>on</strong> register


S<strong>in</strong>gle stepp<strong>in</strong>g further through the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> shows the system variablesMEMTOP and PHY<str<strong>on</strong>g>ST</str<strong>on</strong>g>OP be<strong>in</strong>g correctly set to 0x0F8000 and 0x100000 respectively.The 32KB gap between the top of available RAM and the physical top of RAM is due toreserved space for the graphics screen buffer.A bug was discovered <strong>in</strong> the 7 segment display at this po<strong>in</strong>t, where it doesn’t display theodd addresses. This is because the MC68000 CPU doesn’t have A0, but <strong>in</strong>stead two datastrobes ( UDS and LDS ). The Upper Data Strobe ( UDS ) can be used to identify anodd address bus cycle.5.15Shifter IP CoreNow the RAM test was passed it was time to implement the Shifter graphics chip. TheShifter takes the data directly from RAM bypass<strong>in</strong>g the data bridge transceiver. It wasimportant at this stage to recognise that the FPGA can not have <strong>in</strong>ternal tri state logicstates. All the data buses are driven by multiple <strong>in</strong>ternal comp<strong>on</strong>ents and externaldevices, and for this a large multiplexer was used. Tri-state buffers are used when thedata bus leaves the FPGA to become an external data bus for the CPU and SRAM.Test<strong>in</strong>g the Shifter at this stage was not possible, as the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> sets up thescreen late <strong>in</strong> the boot up sequence. The next po<strong>in</strong>t where the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> fails wasat address 0xFC21B4 where it attempts to <strong>in</strong>itialise the currently unimplemented MFP.5.16MFP IP CoreImplement<strong>in</strong>g the MFP allowed the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> to boot further, but a c<strong>on</strong>t<strong>in</strong>uousloop was occurr<strong>in</strong>g at address 0xFC0CE4 to 0xFC0D1E. Inspect<strong>in</strong>g the commentedsource code shows the MFP <strong>in</strong>ternal Timer B was loaded with the value of 240 and ispolled to ensure the value has changed. The Timer was not runn<strong>in</strong>g due to an error <strong>in</strong> theIP Core. It was found the strobe signal that was resp<strong>on</strong>sible for decrement<strong>in</strong>g the timerwas not runn<strong>in</strong>g. This was verified by tak<strong>in</strong>g the strobe signal out to an external FPGA


I/O p<strong>in</strong> and us<strong>in</strong>g an oscilloscope to view the signal, which clearly identifies the signalwas always at logic level ‘0’.The strobe goes to ‘1’ when the counter value was “00”. However, at the po<strong>in</strong>t of be<strong>in</strong>gless than “01”, it was immediately loaded with the prescale value. Therefore the MFPimplementati<strong>on</strong> requires a small change to the IP Core as listed <strong>in</strong> Appendix J. The samechange was made to all four <strong>in</strong>stances of the Timer strobe signal generati<strong>on</strong>. The resultwas verified with an oscilloscope <strong>in</strong> relati<strong>on</strong> to the master clock.Now the system was restarted and the MFP test passes f<strong>in</strong>e. Remov<strong>in</strong>g the breakpo<strong>in</strong>t fordebugg<strong>in</strong>g the MFP allows the Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> to start and load the AES (Applicati<strong>on</strong>Envir<strong>on</strong>ment <str<strong>on</strong>g>System</str<strong>on</strong>g>). The AES was the graphical envir<strong>on</strong>ment that the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> uses.At this po<strong>in</strong>t it was worth not<strong>in</strong>g that the design has managed to boot up to a desktopenvir<strong>on</strong>ment without the follow<strong>in</strong>g comp<strong>on</strong>ents.• Keyboard/Mouse ACIA• Yamaha YM2149 sound chip• Midi ACIA• DMA• WD1772 floppy c<strong>on</strong>troller• Interrupts still disabledFigure 33 – Photo of DesktopIn the middle of implement<strong>in</strong>g the MFP, the Xil<strong>in</strong>x ISE software began to report an error.FATAL_ERROR:Portability:PortDynamicLib.c:358:1.27 - dll open of library failed due to an unknownreas<strong>on</strong>.Process will term<strong>in</strong>ate. For more <strong>in</strong>formati<strong>on</strong> <strong>on</strong> this error, pleasec<strong>on</strong>sultthe Answers Database or open a WebCase with this project attached athttp://www.xil<strong>in</strong>x.com/support.Figure 34 – Xil<strong>in</strong>x ISE DLL error


Even revert<strong>in</strong>g back to a previous build versi<strong>on</strong> this error kept <strong>on</strong> appear<strong>in</strong>g when try<strong>in</strong>gto build the project. The Xil<strong>in</strong>x ISE software was re<strong>in</strong>stalled, but this didn’t fix theproblem. It was found that the AVG antivirus software had miss detected <strong>on</strong>e of theXil<strong>in</strong>x DLLs as a Trojan horse virus and stored it <strong>in</strong> the AVG virus vault. Mark<strong>in</strong>g theDLL as safe and restor<strong>in</strong>g it to its previous locati<strong>on</strong> prevented the error.5.17ACIA IP CoreAt this stage the keyboard ACIA was added to the project. Interrupts are required for thiscomp<strong>on</strong>ent to work, so the relevant c<strong>on</strong>necti<strong>on</strong>s between the Glue (which c<strong>on</strong>ta<strong>in</strong>s asimple <strong>in</strong>terrupt priority encoder) and the CPU IPL(2..0) signals are made. Only three ofthe CPU <strong>in</strong>terrupt levels are used <strong>in</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> as shown <strong>in</strong> the table below. The MFPacts as an additi<strong>on</strong>al cascaded <strong>in</strong>terrupt c<strong>on</strong>troller.Level Source CPU IPL(2..0)2 Horiz<strong>on</strong>tal Blank 1014 Vertical Blank 0116 MFP 001Table 10 – IPL encod<strong>in</strong>gNow the ACIA was built <strong>in</strong>to the project and an orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> keyboard wasc<strong>on</strong>nected, the keyboard and mouse worked but screen redraws were not occurr<strong>in</strong>gproperly. Screen redraws are part of the VBL ISR (Interrupt Service Rout<strong>in</strong>e) and anerror was found <strong>in</strong> the Glue comp<strong>on</strong>ent wf25915ip_<strong>in</strong>terrupts.vhd. The error was that theHBL and VBL encod<strong>in</strong>g was the wr<strong>on</strong>g way around. Appendix K shows the fix for theGlue subcomp<strong>on</strong>ent.


5.18YM2149 IP CoreNext to implement was the Yamaha YM2149 soundgenerator. This IP core differs <strong>in</strong> the fact that theorig<strong>in</strong>al semic<strong>on</strong>ductor has an analogue output stage,but <strong>in</strong> a Xil<strong>in</strong>x Spartan FPGA (and the vast majority ofother FPGAs) are not mixed signal. Instead the IP coreuses a fast PWM (Pulse Width Modulati<strong>on</strong>) and anexternal low pass discrete filter to create the ‘shape’.In the implementati<strong>on</strong> the 3 channels of sound areexternally mixed with resistors and then <strong>in</strong>to a simpleRC low pass filter.Figure 35 – PWM soundThe first test of the sound chip didn’t work very well with a lot of background noise. Itlater turned out that the Glue address decoded chip select had not been c<strong>on</strong>nected to theYM2149 chip select, so the YM2149 was enabled all the time and act<strong>in</strong>g <strong>on</strong> all therandom data bus signals.After fix<strong>in</strong>g the previous issue, and power<strong>in</strong>g up the system, each time a key was presseda ‘bell’ sound was clearly heard as per the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> but this wasn’t test<strong>in</strong>g all thedifferent envelope shapes. Further test<strong>in</strong>g can <strong>on</strong>ly be achieved by us<strong>in</strong>g a program, andwithout a floppy drive implemented to load a program <strong>in</strong>, further test<strong>in</strong>g had to wait.While add<strong>in</strong>g the YM2149 IP Core more problems crept up with the <strong>in</strong>ternal FPGA clockrout<strong>in</strong>g. Small <strong>in</strong>significant changes were mak<strong>in</strong>g the system refuse to boot up. Whilelook<strong>in</strong>g at differences <strong>in</strong> a previous work<strong>in</strong>g versi<strong>on</strong>, and a n<strong>on</strong> work<strong>in</strong>g new versi<strong>on</strong> itbecame apparent that the placement tool was mov<strong>in</strong>g a lot of the global clock routes andDCM usage around the FPGA. A test was made by revert<strong>in</strong>g back to a previous versi<strong>on</strong>and lock<strong>in</strong>g the usage of DCMs and global clock routes as a c<strong>on</strong>stra<strong>in</strong>t to the project.This fixed the issues, but <strong>on</strong>ly warns of the importance of fixed and dedicated clock


signals with<strong>in</strong> the FPGA and how difficult it could be <strong>in</strong> very high speed FPGA designs[31].5.19DMA IP CoreAt this po<strong>in</strong>t the DMA IP Core was added. The requirement for the DMA to take overand master the system bus required quite a large change to the way the comp<strong>on</strong>ents werec<strong>on</strong>nected together at the top level. Instead of just the CPU driv<strong>in</strong>g the c<strong>on</strong>trol signals forbus cycles ( AS , R/ W , UDS and LDS ) the Glue also needs to be able to drive thesesignals. Even <strong>on</strong> a DMA bus cycle, it is the Glue that drives the c<strong>on</strong>trol signals and doesthe bus arbitrati<strong>on</strong> with the CPU. The MMU also helps out by provid<strong>in</strong>g the address andDMA counter. It’s at this po<strong>in</strong>t that you realise how closely l<strong>in</strong>ked all the customsemic<strong>on</strong>ductors <strong>in</strong> the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> are. The c<strong>on</strong>trol signals from the CPU and Glue are nowfed through a multiplexer.The DMA IP core is implemented and the signals for bus arbitrati<strong>on</strong> between the CPUand Glue are jo<strong>in</strong>ed, with a test made to make sure the system still functi<strong>on</strong>s as it didbefore. Without anyth<strong>in</strong>g currently c<strong>on</strong>nected to the ACSI DMA bus, no further testscan be d<strong>on</strong>e.Just after add<strong>in</strong>g this comp<strong>on</strong>ent IP core the RaggedSt<strong>on</strong>e board developed a fault.While try<strong>in</strong>g to identify devices <strong>on</strong> the JTAG boundary scan, the RaggedSt<strong>on</strong>e kept <strong>on</strong>report<strong>in</strong>g an <strong>in</strong>f<strong>in</strong>ite number of ‘unknown devices’. The three devices <strong>in</strong> the cha<strong>in</strong>(Xil<strong>in</strong>x Spartan, XCF02 c<strong>on</strong>figurati<strong>on</strong> PROM and XCF04 c<strong>on</strong>figurati<strong>on</strong> PROM) wereseparated and scanned <strong>in</strong>dividually. The fault was identified as the XCF02 c<strong>on</strong>figurati<strong>on</strong>PROM and luckily it was not the FPGA. The faulty XCF02 was simply removed and anew <strong>on</strong>e soldered <strong>in</strong> place.


5.20FDC IP CoreThe Floppy Drive C<strong>on</strong>troller (FDC) IP Core was added to the project, al<strong>on</strong>g with thephysical port for the floppy disk drive to attach to. In the project the FDC c<strong>on</strong>nectsdirectly to the ACSI DMA bus as <strong>in</strong> the design there is no external ACSI bus, unlike theorig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>.After add<strong>in</strong>g the FDC IP Core to the project the system now failed to boot to a desktopenvir<strong>on</strong>ment. The <strong>in</strong>terrupts to the CPU had to be disabled, and breakpo<strong>in</strong>ts set up <strong>in</strong>hardware to start debugg<strong>in</strong>g the operat<strong>in</strong>g system at the po<strong>in</strong>t it <strong>in</strong>itialises the floppy diskdrive c<strong>on</strong>troller. After a lot of time trac<strong>in</strong>g through pages of the operat<strong>in</strong>g systemassembly code it appeared the CPU could not read from the FDC status register. Theread is attempted at address 0xFC1CA6 as shown <strong>in</strong> figure 36.Figure 36 – Excerpt from OSWith the help of an attached oscilloscope it was found the tim<strong>in</strong>g of the chip select(FDCSn) <strong>in</strong> relati<strong>on</strong> to the w<strong>in</strong>dow of valid data was wr<strong>on</strong>g and this was changed asshown below. The CTRL_MASK signal is essentially a counter to synthesise signaltim<strong>in</strong>gs for the DMA ACSI bus. The alterati<strong>on</strong> makes the FDCSn signal active forl<strong>on</strong>ger.-- with CTRL_MASK select FDCSn


Up<strong>on</strong> power<strong>in</strong>g up the system the floppy drive was detected and the desktop appearedwith the floppy drive ic<strong>on</strong>s. Try<strong>in</strong>g to read a floppy disk still failed however, with thefloppy drive light rema<strong>in</strong><strong>in</strong>g <strong>on</strong> and the system lock<strong>in</strong>g up by not resp<strong>on</strong>d<strong>in</strong>g to mouse ofkeyboard acti<strong>on</strong>s.The FDC IP Core was exam<strong>in</strong>ed and the ma<strong>in</strong> c<strong>on</strong>trol is implemented as a very largestate mach<strong>in</strong>e with 73 possible states <strong>in</strong> a file called wf1772ip_c<strong>on</strong>trol.vhd. A decisi<strong>on</strong>was made to see if it was this state mach<strong>in</strong>e that was lock<strong>in</strong>g up. The four LEDs <strong>on</strong> theRaggedSt<strong>on</strong>e were used to show the current state of the state mach<strong>in</strong>e, but that <strong>on</strong>lyprovide a maximum of 16 different states. The 73 states were split <strong>in</strong>to groups of 16states and the project re-built each time to test the next group. The offend<strong>in</strong>g state wasT1_VERIFY_CRC and the <strong>on</strong>ly acti<strong>on</strong> that c<strong>on</strong>trols the exit from this state are DELAY =True as shown <strong>in</strong> figure 38.when T1_VERIFY_CRC =>-- The CRC logic starts dur<strong>in</strong>g T1_SPINDOWN (miss<strong>in</strong>g clock transiti<strong>on</strong>s).if DELAY = true thenif CRC_ERR = '1' thenNEXT_CMD_<str<strong>on</strong>g>ST</str<strong>on</strong>g>ATE


settle <strong>in</strong> the correct place. After read<strong>in</strong>g the WD1772 data sheet it became clear the 30mssettl<strong>in</strong>g delay is <strong>on</strong>ly true for the WD1770 device, for the WD1772 it is 15ms[23],[32],[33],[34].when DELAY_30ms | T1_VERIFY_DELAY =>case DELCNT is-- when x"75300" => DELAY DELAY DELAY DELAY


send commands to the Playstati<strong>on</strong> c<strong>on</strong>troller and receive status data of the c<strong>on</strong>troller.The ATT stands for attenti<strong>on</strong>, and this is a signal to def<strong>in</strong>e the start of the sequence. TheACK stands for Acknowledge, and is a c<strong>on</strong>firmati<strong>on</strong> that the c<strong>on</strong>troller received thecommand byte. The data and commands are sent LSB (Least Significant Bit) first.Figure 40 – Playstai<strong>on</strong> c<strong>on</strong>troller protocolThe first three bytes of the transmissi<strong>on</strong> are used for a handshake protocol. The next twobytes of the transmissi<strong>on</strong> are used to transmit the data represent<strong>in</strong>g the butt<strong>on</strong> presses.An extensi<strong>on</strong> was made to the protocol when S<strong>on</strong>y released the dual analogue versi<strong>on</strong> oftheir c<strong>on</strong>troller, and this uses the last four bytes with each byte represent<strong>in</strong>g the positi<strong>on</strong>[36].Table 11 – Playstati<strong>on</strong> c<strong>on</strong>troller packetThe digital directi<strong>on</strong>al pad was used to emulate the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> joystick directi<strong>on</strong>, andthe X butt<strong>on</strong> for the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> fire butt<strong>on</strong>.


5.22IDE Compact FlashThis was not implemented as there was not an easy way to implement the 40 way headeranywhere <strong>on</strong> the RaggedSt<strong>on</strong>e board. There are just enough I/O p<strong>in</strong>s, but these areseparated across the board and would require a lot of trail<strong>in</strong>g wires runn<strong>in</strong>g to thesevarious po<strong>in</strong>ts. The IDE bus is simply memory mapped <strong>in</strong>to the address space from0xF00000 to 0xF00039 and used <strong>in</strong> PIO (Programmed Input Output) Mode [37],[38].The <strong>in</strong>terrupt request from IDE is made with a logical OR with the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> ACSIhard disk <strong>in</strong>terface.


Chapter 6Verificati<strong>on</strong> and Test<strong>in</strong>g6.1Benchmark<strong>in</strong>gBenchmark<strong>in</strong>g software are useful tools to identify the performance of a computer. Byrunn<strong>in</strong>g benchmark software <strong>on</strong> the system, it should be possible to identify any errorseither <strong>in</strong> performance or functi<strong>on</strong>ality. The program used is called Gembench written byOfir Gal <strong>in</strong> 1995, al<strong>on</strong>g with another program called SysInfo by Thorsten Bergner <strong>in</strong>1997. Gembench benchmarks the AES (open<strong>in</strong>g dialog boxes, scroll<strong>in</strong>g text etc), CPUspeed (maths rout<strong>in</strong>es) and memory bandwidth. SysInfo reports <strong>in</strong>formati<strong>on</strong> <strong>on</strong> systemvariables, memory c<strong>on</strong>figurati<strong>on</strong> and size. Appendix M shows the results of these twotests. The Gembench scored 99% of a real <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>, probably due to the real PAL <str<strong>on</strong>g>Atari</str<strong>on</strong>g><str<strong>on</strong>g>ST</str<strong>on</strong>g> hav<strong>in</strong>g a 32.08 MHz master clock. The 102% score for VDI Scroll is probably due tous<strong>in</strong>g TOS v1.04 where certa<strong>in</strong> areas of the operat<strong>in</strong>g system were optimised slightly.The SysInfo results are exactly the same as a 1MB <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>, and this verifies it hasdetected the size of SRAM memory correctly and set up all the associated systemvariables and c<strong>on</strong>figurati<strong>on</strong> registers.6.2Colour PaletteIn the colour resoluti<strong>on</strong> modes thecolours were <strong>in</strong>correct compared to an<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>. At first the c<strong>on</strong>necti<strong>on</strong>between the FPGA and Video DACwere checked and these were correct.The c<strong>on</strong>necti<strong>on</strong>s between the VideoDAC and VGA c<strong>on</strong>nector were alsocorrect. With the floppy drive nowoperati<strong>on</strong>al, it was possible to loadFigure 41 – Degas Elite


programs <strong>in</strong>. An art draw<strong>in</strong>g program called “Degas Elite” written by Tom Huds<strong>on</strong> <strong>in</strong>1987 was loaded from the floppy drive. With this program it is possible to change theshade of colour <strong>in</strong> the palette registers of the Shifter graphics IP Core. It was found thatadjust<strong>in</strong>g certa<strong>in</strong> palettes changed the wr<strong>on</strong>g colour <strong>on</strong> the screen. A table was made tofigure out what was happen<strong>in</strong>g.Palette changedBit patternBit patternActual change(3..0)(3..0)Correct?0 0000 0 0000 YES1 0001 4 0100 NO2 0010 2 0010 YES3 0011 6 0110 NO4 0100 1 0001 NO5 0101 5 0101 YES6 0110 3 0011 NO7 0111 7 0111 YES8 1000 8 1000 YES9 1001 12 1100 NO10 1010 10 1010 YES11 1011 14 1110 NO12 1100 9 1001 NO13 1101 13 1101 YES14 1110 11 1011 NO15 1111 15 1111 YE<str<strong>on</strong>g>ST</str<strong>on</strong>g>able 12 – Colour palette errorBy look<strong>in</strong>g at the bit patterns orbit planes, it can be seen bits 0and 2 are around the wr<strong>on</strong>g way.The Shifter IP Core has a fileif SH_MOD = "00" then -- Low resoluti<strong>on</strong>.-- SR(3)


called wf25914ip_cr_shift_reg.vhd and with<strong>in</strong> that is a process called shift_out where thecolour creati<strong>on</strong> is made. This was modified based <strong>on</strong> the previous f<strong>in</strong>d<strong>in</strong>gs.6.3Sound TechniquesThe sound from the YM2149 IP Core is nexttested. The sound generator is very simple,just 3 channels of square wave, which can bemixed with white noise and fed <strong>in</strong>to envelopefilters. Many programmers developed newways of us<strong>in</strong>g the YM2149 to produce bettersounds by carefully timed writes to theYM2149 registers.Figure 43 – SND PlayerThe program used to test it is a freeware program called ‘SND Player’ written by OddSkancke and Anders Erikss<strong>on</strong> <strong>in</strong> 2006 and comes with a few demo s<strong>on</strong>gs to try. Afterplay<strong>in</strong>g a few of the demo s<strong>on</strong>gs and compar<strong>in</strong>g to a real <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>, it was apparent somehad problems with some channels nothav<strong>in</strong>g the right sound. One of theses<strong>on</strong>gs was ‘Chu Chu Rocket’ byMalcolm Grant which was chosen as theproblem is evident while <strong>on</strong>ly us<strong>in</strong>g <strong>on</strong>esound channel. The envelope registerwas routed to be displayed <strong>on</strong> the four Figure 44 – Envelope ShapesLEDs <strong>on</strong> the RaggedSt<strong>on</strong>e board. It wasfound the sound was <strong>in</strong>correct <strong>on</strong>ly <strong>on</strong> some envelope shapes, namely ‘1010’ which is arepeat<strong>in</strong>g sawtooth.From look<strong>in</strong>g at the process which generates the envelope shape (<strong>in</strong> the filewf2149_wave.vhd) it became apparent what the error was. On the ris<strong>in</strong>g slope of theenvelope when it reaches the highest peak (VOL_ENV = “11111”) it should start fall<strong>in</strong>g


ack down aga<strong>in</strong>. The way the <strong>VHDL</strong>is structured, the signal to c<strong>on</strong>trol thevolume decrement occurs too late andthe VOL_ENV rolls over. The effect isa very fast repeat<strong>in</strong>g square wave, ratherthan the desired sawtooth wave. Thechanges made are shown <strong>in</strong> figure 46.when "1110" | "1010" =>if ENV_UP_DNn = '0' thenVOL_ENV


It was discovered <strong>in</strong> 1988 by a team of people called ‘TNT’ that by switch<strong>in</strong>g graphicsmodes (<str<strong>on</strong>g>ST</str<strong>on</strong>g> Low/Medium/High or 50/60Hz) <strong>on</strong> certa<strong>in</strong> l<strong>in</strong>e numbers the graphics subsystem can be fooled <strong>in</strong>to display<strong>in</strong>g graphics with<strong>in</strong> the borders.A good piece of test software was found called ‘Halluc<strong>in</strong>ati<strong>on</strong>s’ released by RG <strong>in</strong> 2003(although the over scan technique is much older). The current implementati<strong>on</strong> of the<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> failed try<strong>in</strong>g to run this software, with the screen borders rema<strong>in</strong><strong>in</strong>g <strong>in</strong>tact.From look<strong>in</strong>g at the hardware the DE (Display Enable) signal generated by the Glue<strong>in</strong>forms the Shifter and MMU when to display the graphics, otherwise they will displaythe border. Inside the Glue IP Core (file wf25915ip_video_tim<strong>in</strong>g.vhd), there are twoma<strong>in</strong> counters, <strong>on</strong>e for the horiz<strong>on</strong>tal positi<strong>on</strong> and the other for the vertical l<strong>in</strong>e number.The DE signal is c<strong>on</strong>trolled by relati<strong>on</strong>al operators (less than and greater than) as shown<strong>in</strong> Appendix N and this precisely where the problem stems from. In a real <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>, if thesoftware switches to a different screen mode at precisely the right time, the Glue thenmisses the qualifier to end the DE signal, and it rema<strong>in</strong>s active for l<strong>on</strong>ger display<strong>in</strong>g morepixels from RAM. Because the IP Core of the Glue uses less than and greater than, thisdoesn’t work. After chang<strong>in</strong>g all these to simple equality relati<strong>on</strong> operators, and bas<strong>in</strong>gall the tim<strong>in</strong>gs <strong>on</strong> a document by Dr Sengan Bar<strong>in</strong>g-Gould published <strong>in</strong> the French ‘<str<strong>on</strong>g>ST</str<strong>on</strong>g>Magaz<strong>in</strong>e’ <strong>in</strong> 1991 the system now correctly displayed the over scan technique [40]!Another po<strong>in</strong>t that backs up the use of equality operators is that they require a lot lesstransistors, and this would be how the orig<strong>in</strong>al <str<strong>on</strong>g>Atari</str<strong>on</strong>g> semic<strong>on</strong>ductors would have beenc<strong>on</strong>structed. As well as chang<strong>in</strong>g the generati<strong>on</strong> of the DE signal, the V Sync, H Syncand video Blank<strong>in</strong>g were changed.


Future Additi<strong>on</strong>s and Possibilities7.1Floppy Drive Emulati<strong>on</strong>Nowadays floppy drives are be<strong>in</strong>g phased out. Many PC manufactures d<strong>on</strong>’t supplyfloppy drives, and Apple Inc scrapped the floppy drive <strong>in</strong> 1998 with <strong>in</strong>troducti<strong>on</strong> of iMac.It is quite easy to see why after implement<strong>in</strong>g the floppy drive and read<strong>in</strong>g the WesternDigital WD1772 data sheet. Many commands given to the floppy drive have to befollowed by delays. It is advised to wait for five Index Pulses after the Sp<strong>in</strong> Upcommand before read<strong>in</strong>g data. At a disk revoluti<strong>on</strong> of 300 rpm, five <strong>in</strong>dex pulses areequal to <strong>on</strong>e sec<strong>on</strong>d. More delays are needed when stepp<strong>in</strong>g the floppy drive head to adifferent track, 15ms for the WD1772. 15ms <strong>in</strong> computer terms is a l<strong>on</strong>g time, theMC68000 can execute up to 30,000 <strong>in</strong>structi<strong>on</strong>s <strong>in</strong> that time.There exists a project called hXc (that replaces the physical floppy drive and allows ahost computer to mimic a floppy drive [41]. Go<strong>in</strong>g <strong>on</strong>e step further it would be possibleto remove the WD1772 floppy c<strong>on</strong>troller altogether, with an image of a floppy diskstored <strong>on</strong> a removable media like an SD (Secure Digital) Card communicat<strong>in</strong>g directly tothe DMA bus. The delays could be added for possible compatibility problems, orallowed to run at full speed.7.2MIDIMidi was <strong>in</strong>cluded as standard from the very first <str<strong>on</strong>g>Atari</str<strong>on</strong>g> St throughout the entire series andplayed an important role <strong>in</strong> establish<strong>in</strong>g the computer as a serious computer for musicproducti<strong>on</strong>. In the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> MIDI is implemented with another ACIA MC6850 as used tocommunicate with the keyboard. It uses a 31250 baud serial protocol over a current loopand is optically isolated. The MIDI could be provided with another <strong>in</strong>stance of theMC6850 IP Core. The game port to MIDI adapters that is comm<strong>on</strong>ly available for PCscould easily be used to provide the electrical specificati<strong>on</strong> MIDI needs. The game port is


a 15 way D-Type c<strong>on</strong>nector and the panel cut out is provided <strong>on</strong> many PC cases, unlikethat of the 5 p<strong>in</strong> DIN c<strong>on</strong>nectors MIDI uses.7.3IDEAlthough there exists a simple IDE <strong>in</strong>terface for the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> that is compatible to the<str<strong>on</strong>g>Atari</str<strong>on</strong>g> Falc<strong>on</strong>s IDE port, it <strong>on</strong>ly works <strong>in</strong> programmed I/O mode. This is where the CPUhas to do the work of mov<strong>in</strong>g the data to and from the IDE bus to RAM. Although this isf<strong>in</strong>e for most small chunks of data, large files will <strong>in</strong>evitably tie up the CPU stopp<strong>in</strong>g itfrom do<strong>in</strong>g more useful process<strong>in</strong>g. A soluti<strong>on</strong> could exist <strong>in</strong> us<strong>in</strong>g the orig<strong>in</strong>al DMAcomp<strong>on</strong>ent with a bridge layer to IDE protocol. This would provide complete softwarecompatibility, appear<strong>in</strong>g as a DMA device to the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> but us<strong>in</strong>g plentiful and<strong>in</strong>expensive IDE drives. The c<strong>on</strong>versi<strong>on</strong> from <str<strong>on</strong>g>Atari</str<strong>on</strong>g>’s own protocol of the DMA bus,ACSI could be c<strong>on</strong>verted to IDE <strong>in</strong>ternally as a custom IP Core. It also opens up thepossibility for more than <strong>on</strong>e IDE port, as ACSI protocol can support 7 devices.7.4Unificati<strong>on</strong> of mass storageIn the design there were a lot of areas and different device technologies for storage ofdata.• Floppy drive us<strong>in</strong>g 3.5” floppy disks• C<strong>on</strong>figurati<strong>on</strong> of the FPGA held <strong>in</strong> custom Xil<strong>in</strong>x serial PROM• Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> held <strong>in</strong> parallel FLASH memory• PIC microc<strong>on</strong>troller firmware held with<strong>in</strong> itselfEach of the above could be c<strong>on</strong>ta<strong>in</strong>ed <strong>in</strong> <strong>on</strong>e s<strong>in</strong>gle device like an <strong>in</strong>expensive SD Card.The PIC microc<strong>on</strong>troller could c<strong>on</strong>ta<strong>in</strong> firmware to read a FAT 32 formatted SD Card toprogram its self with new firmware, program the FPGA c<strong>on</strong>figurati<strong>on</strong> and store theOperat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g> <strong>in</strong> a porti<strong>on</strong> of RAM. The floppy drive image could be retrieved <strong>on</strong>


equest from the Floppy Drive C<strong>on</strong>troller with the PIC act<strong>in</strong>g as a bridge. This greatlyreduces cost and comp<strong>on</strong>ent count at the expensive of development time to guaranteecorrect functi<strong>on</strong>ality [42], [43].7.5Rec<strong>on</strong>figurable systemsThe previous paragraph leads nicely <strong>on</strong>to the ability for rec<strong>on</strong>figurable systems. Byallow<strong>in</strong>g the PIC to read from an SD Card, it is possible to store multiple versi<strong>on</strong>s foreach part of the system. This could allow the system to change functi<strong>on</strong>ality entirelywith<strong>in</strong> sec<strong>on</strong>ds. Us<strong>in</strong>g an SD Card also removes the need for special programm<strong>in</strong>ghardware for the various parts <strong>on</strong>board and simplifies any updates needed to a system. Itwould be as simple as <strong>in</strong>sert<strong>in</strong>g the SD Card <strong>in</strong>to a PC to copy new firmware packages <strong>on</strong>[44], [45].7.6Commercial viabilityThere is scope for a design like this to be made <strong>in</strong> to a sellable item. By hav<strong>in</strong>g a designthat supports many projects needs, and a framework wrapper to ease migrati<strong>on</strong> andport<strong>in</strong>g from other development boards it could attract many designers. From look<strong>in</strong>g atother FPGA development boards and needs for projects the follow<strong>in</strong>g specificati<strong>on</strong> ahsbeen c<strong>on</strong>cluded.• Composite Video/ S Video for c<strong>on</strong>necti<strong>on</strong> to domestic Televisi<strong>on</strong>s• VGA c<strong>on</strong>necti<strong>on</strong> with high quality DAC for high resoluti<strong>on</strong> m<strong>on</strong>itors• SD Card for storage of data• One fixed clock, <strong>on</strong>e software programmable for pixel clocks etc• PS/2 mouse and keyboard ports• LCD header p<strong>in</strong>s for embedded designs• Ethernet port• Audio Codec for sound <strong>in</strong> and out


• IDE <strong>in</strong>terface port• CPU expansi<strong>on</strong> slot to allow for different CPU architectures and/or additi<strong>on</strong> IO• SDRAM ma<strong>in</strong> memory• PIC Microc<strong>on</strong>troller for standby operati<strong>on</strong>A design with these features opens the market to many diverse applicati<strong>on</strong>s, not just an<str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> design. The additi<strong>on</strong> of a wrapper for us<strong>in</strong>g the <strong>in</strong>expensive Analogue andDigital S<strong>on</strong>y Playstati<strong>on</strong> c<strong>on</strong>trollers could very be useful for the c<strong>on</strong>trol <strong>in</strong> robotics.Even with an <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> design, it is possible to run the 68k Debian L<strong>in</strong>ux port, or uCl<strong>in</strong>uxare even <str<strong>on</strong>g>Atari</str<strong>on</strong>g>’s own UNIX derivative, MultiTOS/MINT.


Chapter 8Summary8.1I pers<strong>on</strong>ally found implement<strong>in</strong>g an entire computer system <strong>in</strong> an FPGA highlychalleng<strong>in</strong>g and <strong>in</strong>credibly reward<strong>in</strong>g. From the overall design blocks to the <strong>in</strong>tricatedetails at logic gate level presented many opportunities for problem solv<strong>in</strong>g.Every IP Core (bar the ACIA) of the system had to be studied <strong>in</strong> great detail tounderstand the <strong>in</strong>ner work<strong>in</strong>gs and fix<strong>in</strong>g numerous problems. Not every detail that waschanged could be menti<strong>on</strong>ed, as some of them took so l<strong>on</strong>g to discover the root of theproblem and the length of detail<strong>in</strong>g the soluti<strong>on</strong>. The best example of this is the FloppyDrive C<strong>on</strong>troller IP Core. Even <strong>in</strong> its current state it is not fully functi<strong>on</strong>al, it hasproblems with games that have complex copy protecti<strong>on</strong> techniques or formatted withn<strong>on</strong> standard numbers of sectors per track. Writ<strong>in</strong>g to a disk was not even attempted andwas disabled <strong>in</strong> hardware for fear of ru<strong>in</strong><strong>in</strong>g many disks. The FDC IP Core is by far themost complex IP Core <strong>in</strong> the design, hav<strong>in</strong>g to deal with a MFM encoded bit stream fromthe floppy drive that varies every so slightly <strong>in</strong> bit rate as the disk drive motor RPMfluctuates.One po<strong>in</strong>t I found from do<strong>in</strong>g this project is understand<strong>in</strong>g how far comput<strong>in</strong>g has come,the amount of complexities there are <strong>in</strong> modern computer chipsets, graphics and microprocessors. One th<strong>in</strong>g I feel is that by understand<strong>in</strong>g the past, an <strong>in</strong>sight <strong>in</strong>to the future ofcomput<strong>in</strong>g can be seen clearer and many ideas will come back around.A few th<strong>in</strong>gs that could have helped greatly would be better access to tools. Hav<strong>in</strong>gsometh<strong>in</strong>g al<strong>on</strong>g the l<strong>in</strong>es of a logic analyser embedded <strong>in</strong>to the design, like Xil<strong>in</strong>x’sown <strong>Chip</strong>Scope would have been <strong>in</strong>credibly useful. A normal logic analyser would helpto some extent, but every time you want to view a different <strong>in</strong>ternal signal it requires arebuild of the project. On that po<strong>in</strong>t, even <strong>on</strong> my relatively new computer the process of


uild<strong>in</strong>g the project and programm<strong>in</strong>g through the JTAG <strong>in</strong>terface took approximately 20m<strong>in</strong>utes. In total there were approximately 15000 l<strong>in</strong>es of <strong>VHDL</strong> code.I found the <strong>in</strong>ternet a great resource of <strong>in</strong>formati<strong>on</strong>, as there were very few bookspublished about the hardware of the <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>. Much of the <strong>in</strong>formati<strong>on</strong> has come fromarchives of past magaz<strong>in</strong>es articles and documents written about certa<strong>in</strong> aspects of thehardware.Although the design did not feature the CPU as an IP Core, I feel this was a wise decisi<strong>on</strong>as it was the <strong>on</strong>e part of the design that could be trusted as work<strong>in</strong>g from the very start.Try<strong>in</strong>g to debug a CPU IP Core al<strong>on</strong>g with everyth<strong>in</strong>g else would have been <strong>in</strong>crediblytime c<strong>on</strong>sum<strong>in</strong>g.I’ve learnt a lot about the <strong>in</strong>ner work<strong>in</strong>gs of FPGAs, and the <strong>VHDL</strong> language. Mostimportantly is that FPGAs are <strong>in</strong> some ways like a group of <strong>in</strong>dividual <strong>in</strong>tegrated circuits.It is just as important to make sure that the <strong>in</strong>terc<strong>on</strong>necti<strong>on</strong>s between these blocks of logicare c<strong>on</strong>stra<strong>in</strong>ed to certa<strong>in</strong> paths, distances and delays as it is with a traditi<strong>on</strong>al design.Overall I’ve found systems <strong>on</strong> chip <strong>in</strong>credibly <strong>in</strong>terest<strong>in</strong>g and someth<strong>in</strong>g of realimportance for the future. Their ability is to make designs smaller, c<strong>on</strong>sume less powerand most importantly faster.


ReferencesAll <strong>on</strong>l<strong>in</strong>e references sited 29 th April 2008.[1] Old-Computers.com The Museam. [Onl<strong>in</strong>e].Available: http://www.old-computers.com/museum/company.asp?st=1&m=10[2] Wikipedia. (unknown). TV Boy. [Onl<strong>in</strong>e].Available: http://en.wikipedia.org/wiki/TV_Boy[3] Howard Wen. (2007). Curt Vendel: The Escapist Interview. [Onl<strong>in</strong>e].Available: http://www.escapistmagaz<strong>in</strong>e.com/articles/view/issues/issue_100/555-Curt-Vendel-The-Escapist-Interview[4] Benjam<strong>in</strong> J Heckendorn. (2006). Still look<strong>in</strong>g for NES <strong>on</strong> a <strong>Chip</strong>s . [Onl<strong>in</strong>e].Available: http://benheck.com/01-05-2006/still-look<strong>in</strong>g-for-nes-<strong>on</strong>-a-chips-noacs[5] Rieks Warendorp Torr<strong>in</strong>ga/ Sander Zuidema. (2006). Bazix Homepage. [Onl<strong>in</strong>e]Available: http://www.bazix.nl[6] Dennis Van Weeren. (2008). M<strong>in</strong>iMig Homepage. [Onl<strong>in</strong>e].Available: http://home.hetnet.nl/~weeren001/[7] Old-Computers.com The Museam. [Onl<strong>in</strong>e].Available: http://en.wikipedia.org/wiki/Jeri_Ellsworth[8] JOHN MARKOFF. (2004). The New York Times: A Toy With a Story. [Onl<strong>in</strong>e].Available: http://www.nytimes.com/2004/12/20/technology/20joystick.html[9] IGN. (unknown). <str<strong>on</strong>g>Atari</str<strong>on</strong>g> Inc. (1972-1984). [Onl<strong>in</strong>e]Available: http://uk.games.ign.com/objects/764/764953.html[10] Wikipedia. (2008). <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>. [Onl<strong>in</strong>e].Available: http://en.wikipedia.org/wiki/<str<strong>on</strong>g>Atari</str<strong>on</strong>g>_<str<strong>on</strong>g>ST</str<strong>on</strong>g>[11] Bob Lash. (2002). ATARI <str<strong>on</strong>g>ST</str<strong>on</strong>g> Prototype. [Onl<strong>in</strong>e].Available: http://www.bambi.net/atari/atari_st_prototype.html[12] K.Gerits, L.Englisch, R.Bruckmann, “The <str<strong>on</strong>g>ST</str<strong>on</strong>g> Operat<strong>in</strong>g <str<strong>on</strong>g>System</str<strong>on</strong>g>” <strong>in</strong> <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>Internals, 3 rd ed. , Miami: Abacus Software Inc., May 1988, pp. 105-106[13] Hans-Dieter Jankowski, Julian F.Reschke,Dietmar Rabich, “Der “Power-UPAblaufplan” <strong>in</strong> <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Profibuch, 2 nd ed. , Düsseldorf: Sybex-Verlag, 1989, pp. 917-919


[14] K.Gerits, L.Englisch, R.Bruckmann, “The BIOS List<strong>in</strong>g” <strong>in</strong> <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g> Internals, 3 rded. , Miami: Abacus Software Inc., May 1988, pp. 271-461[15] Kev<strong>in</strong> Morris. (2005). World's Best FPGA Article. [Onl<strong>in</strong>e].Available: http://www.fpgajournal.com/articles_2005/20050510_worldsbest.htm[16] Peter Clarke. (1999). Early users of IP cores could ga<strong>in</strong> an edge from design reuse.[Onl<strong>in</strong>e].Available: http://www.eetimes.com/story/OEG19990622S0014[17] Xil<strong>in</strong>x, Inc. (unknown). ISE WebPACK 8.2i FAQ. [Onl<strong>in</strong>e].Available: http://www.xil<strong>in</strong>x.com/ise/logic_design_prod/webpack_faq.htm#3a[18] Gennadiy Shvets. (2007). Motorola 68000 microprocessor family. [Onl<strong>in</strong>e].Available: http://www.cpu-world.com/CPUs/68000/[19] John Townsend/Richard Davey. (unknown). Town's Little Guide to TOS Revisi<strong>on</strong>s.[Onl<strong>in</strong>e].Available: http://www.atari.st/c<strong>on</strong>tent.php?type=t&file=toslist[20] Micr<strong>on</strong> Technology, Inc. (2000). Migrat<strong>in</strong>g from FPM/EDO To SDRAM. [Onl<strong>in</strong>e].Available: http://download.micr<strong>on</strong>.com/pdf/technotes/ZT07.pdf[21] Freescale Semic<strong>on</strong>ductor, Inc. (1997). Addendum to MC68000 User Manual.[Onl<strong>in</strong>e].Available: http://www.freescale.com/files/32bit/doc/ref_manual/M68000UMAD.pdf[22] Ken Chapman. (2007). M29DW323DT <str<strong>on</strong>g>ST</str<strong>on</strong>g> Microelectr<strong>on</strong>ics FLASH Programmer.[Onl<strong>in</strong>e].Available: http://www.xil<strong>in</strong>x.com/products/boards/s3astarter/reference_designs.htm[23] David Small. (1986). Prob<strong>in</strong>g the FDC, <str<strong>on</strong>g>ST</str<strong>on</strong>g>ART Vol.1,No.2,Page 96. [Onl<strong>in</strong>e].Available: http://www.atarimagaz<strong>in</strong>es.com/startv1n2/Prob<strong>in</strong>gTheFDC.html[24] Didier Méquign<strong>on</strong>, Laurent Favard. (2005). <str<strong>on</strong>g>Atari</str<strong>on</strong>g> Eiffel 3 Interface PS/2. [Onl<strong>in</strong>e].Available: http://pagesperso-orange.fr/didierm/eiffel-e.htm[25] Pera Putnik. (1998). <str<strong>on</strong>g>Atari</str<strong>on</strong>g> IDE disk <strong>in</strong>terface. [Onl<strong>in</strong>e].Available: http://members.tripod.com/~piters/atari/astide.htm[26] Mike J. (2006). VGA Display Test. [Onl<strong>in</strong>e].Available: http://home.freeuk.com/fpgaarcade/displaytest.htm[27] Freescale Semic<strong>on</strong>ductor, Inc. (2006). MC68000 User Manual. [Onl<strong>in</strong>e].Available: http://www.freescale.com/files/32bit/doc/ref_manual/M68000UM.pdf


[28] Sam Duncan. (2003). Article 53214. [Onl<strong>in</strong>e].Available: www.fpga-faq.com/archives/53100.htm[29] Craig Abrams<strong>on</strong>. (unknown). Determ<strong>in</strong><strong>in</strong>g Clock Skew when the Virtex DLL DrivesMultiple Copies of a Clock Off <strong>Chip</strong>. [Onl<strong>in</strong>e].Available:http://www.nalanda.nitc.ac.<strong>in</strong>/<strong>in</strong>dustry/appnotes/xil<strong>in</strong>x/documents/xcell/xl32/xl32_53.pdf[30] Xil<strong>in</strong>x, Inc. (2000). Us<strong>in</strong>g Delay-Locked Loops <strong>in</strong> Spartan-II FPGAs. [Onl<strong>in</strong>e].Available: http://www.xil<strong>in</strong>x.com/support/documentati<strong>on</strong>/applicati<strong>on</strong>_notes/xapp174.pdf[31] Brian Jacks<strong>on</strong>. (2007). Improv<strong>in</strong>g FPGA <strong>on</strong> PCB Integrati<strong>on</strong> with PlanAheadDesign and Analysis Tool. [Onl<strong>in</strong>e].Available: http://www.fpgajournal.com/whitepapers_2007/q2_xil<strong>in</strong>x_1.htm[32] David Gahris. (1995). WD1772 Programm<strong>in</strong>g <strong>in</strong>formati<strong>on</strong>. [Onl<strong>in</strong>e].Available: http://www.buchty.net/ens<strong>on</strong>iq/files/wd1772.txt[33] Greg Cook. (2005). Register summary for Western Digital FDC. [Onl<strong>in</strong>e].Available: http://homepages.tesco.net/~ra<strong>in</strong>storm/fdc-comb<strong>in</strong>ed.htm[34] Western Digital Corporati<strong>on</strong>. (unknown). WD177X-00 Floppy Disk C<strong>on</strong>troller.[Onl<strong>in</strong>e].Available: http://dev-docs.atariforge.org/files/WD1772.pdf[35] Andries Brouwer. (2004). Keyboard scancodes. [Onl<strong>in</strong>e].Available: http://www.w<strong>in</strong>.tue.nl/~aeb/l<strong>in</strong>ux/kbd/scancodes.html[36] Andrew J McCubb<strong>in</strong>. (1998). S<strong>on</strong>y PlayStati<strong>on</strong> C<strong>on</strong>troller Informati<strong>on</strong>. [Onl<strong>in</strong>e].Available: http://www.gamesx.com/c<strong>on</strong>troldata/psxc<strong>on</strong>t/psxc<strong>on</strong>t.htm[37] Dan Hollis. (1994). <str<strong>on</strong>g>Atari</str<strong>on</strong>g> <str<strong>on</strong>g>ST</str<strong>on</strong>g>/<str<strong>on</strong>g>ST</str<strong>on</strong>g>e/M<str<strong>on</strong>g>ST</str<strong>on</strong>g>e/TT/F030 Hardware Register List<strong>in</strong>g.[Onl<strong>in</strong>e].Available: http://dev-docs.atariforge.org/files/hardware.zip[38] CompactFlash Associati<strong>on</strong>. (2008). CF and CompactFlash FAQ. [Onl<strong>in</strong>e].Available: http://www.compactflash.org/faqs/faq.htm[39] Arnaud Carré. (unknown). YM2149 Special Effects. [Onl<strong>in</strong>e].Available: http://le<strong>on</strong>ard.oxg.free.fr/ymformat.html[40] Dr Sengan Bar<strong>in</strong>g-Gould. (1991). Overscan Techniques. [Onl<strong>in</strong>e].Available: http://alive.atari.org/alive9/ovrscn1.php[41] Jean François. (2008). Emulateur de lecteur de disquette. [Onl<strong>in</strong>e].Available: http://jeanfrancoisdelnero.free.fr/floppy_drive_emulator/


[42] Claudi Chiculita. (2007). T<strong>in</strong>y PIC bootloader. [Onl<strong>in</strong>e].Available: http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm[43] Philip Freid<strong>in</strong>. (2003). C<strong>on</strong>figur<strong>in</strong>g an FPGA from a processor. [Onl<strong>in</strong>e].Available: http://www.fpgafaq.com/FAQ_Pages/0038_C<strong>on</strong>fig_FPGA_from_a_processor.htm[44] Lauro Rizzatti. (2002). Hardware emulati<strong>on</strong> for every<strong>on</strong>e. [Onl<strong>in</strong>e].Available:http://www.eetimes.com/news/design/columns/eda/showArticle.jhtml?articleID=17407881[45] Wikipedia. (2008). Hardware emulati<strong>on</strong>. [Onl<strong>in</strong>e].Available: http://en.wikipedia.org/wiki/Hardware_emulati<strong>on</strong>


AppendicesAMAIN.UCF c<strong>on</strong>stra<strong>in</strong>ts fileMAIN.VHD comp<strong>on</strong>ent file#PACE: Start of C<strong>on</strong>stra<strong>in</strong>ts generated by PACE#PACE: Start of PACE I/O P<strong>in</strong> AssignmentsNET "CLK_PCI" LOC = "A11" ;NET "EEPROM_SCL" LOC = "U7" ;NET "EEPROM_SDA" LOC = "U10" ;NET "EEPROM_WP" LOC = "V7" ;NET "FLASH_A" LOC = "Y10" ;NET "FLASH_A" LOC = "U12" ;NET "FLASH_A" LOC = "AB15" ;NET "FLASH_A" LOC = "AB9" ;NET "FLASH_A" LOC = "AB14" ;NET "FLASH_A" LOC = "AA13" ;NET "FLASH_A" LOC = "AB10" ;NET "FLASH_A" LOC = "AB11" ;NET "FLASH_A" LOC = "AB13" ;NET "FLASH_A" LOC = "Y12" ;NET "FLASH_A" LOC = "W10" ;NET "FLASH_A" LOC = "V10" ;NET "FLASH_A" LOC = "W9" ;NET "FLASH_A" LOC = "W8" ;NET "FLASH_A" LOC = "AB8" ;NET "FLASH_A" LOC = "AA8" ;NET "FLASH_A" LOC = "AA9" ;NET "FLASH_A" LOC = "V9" ;NET "FLASH_A" LOC = "AA15" ;NET "FLASH_CE" LOC = "V14" ;NET "FLASH_IO" LOC = "AA10" ;NET "FLASH_IO" LOC = "W11" ;NET "FLASH_IO" LOC = "Y11" ;NET "FLASH_IO" LOC = "U11" ;NET "FLASH_IO" LOC = "W13" ;NET "FLASH_IO" LOC = "V13" ;NET "FLASH_IO" LOC = "Y13" ;NET "FLASH_IO" LOC = "W14" ;NET "FLASH_OE" LOC = "U13" ;NET "FLASH_WE" LOC = "W12" ;NET "J01_2" LOC = "AA12" ;NET "J01_3" LOC = "AB12" ;NET "J01_4" LOC = "V16" ;NET "J01_5" LOC = "W16" ;NET "J02_2" LOC = "V8" ;NET "J02_3" LOC = "Y6" ;NET "J02_4" LOC = "AA6" ;NET "J02_5" LOC = "U6" ;NET "J2_1" LOC = "B19" ;


NET "J2_10" LOC = "C17" ;NET "J2_11" LOC = "B17" ;NET "J2_12" LOC = "E15" ;NET "J2_13" LOC = "D17" ;NET "J2_14" LOC = "E13" ;NET "J2_15" LOC = "D15" ;NET "J2_16" LOC = "F13" ;NET "J2_17" LOC = "D14" ;NET "J2_18" LOC = "A15" ;NET "J2_19" LOC = "F12" ;NET "J2_20" LOC = "B14" ;NET "J2_21" LOC = "B15" ;NET "J2_22" LOC = "F16" ;NET "J2_23" LOC = "A14" ;NET "J2_24" LOC = "D13" ;NET "J2_25" LOC = "F17" ;NET "J2_26" LOC = "A13" ;NET "J2_27" LOC = "C13" ;NET "J2_28" LOC = "E12" ;NET "J2_29" LOC = "B13" ;NET "J2_3" LOC = "A19" ;NET "J2_31" LOC = "A12" ;NET "J2_32" LOC = "D12" ;NET "J2_33" LOC = "A9" ;NET "J2_34" LOC = "B12" ;NET "J2_35" LOC = "B10" ;NET "J2_36" LOC = "C10" ;NET "J2_37" LOC = "A8" ;NET "J2_38" LOC = "B9" ;NET "J2_39" LOC = "F11" ;NET "J2_4" LOC = "C18" ;NET "J2_40" LOC = "E10" ;NET "J2_41" LOC = "F10" ;NET "J2_42" LOC = "E9" ;NET "J2_43" LOC = "F9" ;NET "J2_44" LOC = "B8" ;NET "J2_45" LOC = "D7" ;NET "J2_46" LOC = "E7" ;NET "J2_47" LOC = "C6" ;NET "J2_48" LOC = "B6" ;NET "J2_49" LOC = "E6" ;NET "J2_5" LOC = "D18" ;NET "J2_50" LOC = "D6" ;NET "J2_51" LOC = "A5" ;NET "J2_52" LOC = "B5" ;NET "J2_6" LOC = "B18" ;NET "J2_8" LOC = "E17" ;NET "J2_9" LOC = "A18" ;NET "JL1_10" LOC = "M21" ;NET "JL1_11" LOC = "K19" ;NET "JL1_12" LOC = "K20" ;NET "JL1_13" LOC = "K22" ;NET "JL1_14" LOC = "K21" ;NET "JL1_15" LOC = "G19" ;NET "JL1_16" LOC = "F19" ;NET "JL1_17" LOC = "F20" ;NET "JL1_18" LOC = "F21" ;


NET "JL1_19" LOC = "E21" ;NET "JL1_2" LOC = "Y21" ;NET "JL1_20" LOC = "E22" ;NET "JL1_3" LOC = "T22" ;NET "JL1_4" LOC = "T21" ;NET "JL1_5" LOC = "T18" ;NET "JL1_6" LOC = "R18" ;NET "JL1_7" LOC = "M17" ;NET "JL1_8" LOC = "M18" ;NET "JL1_9" LOC = "M22" ;NET "JL2_1" LOC = "W21" ;NET "JL2_10" LOC = "T17" ;NET "JL2_11" LOC = "M19" ;NET "JL2_12" LOC = "M20" ;NET "JL2_13" LOC = "L20" ;NET "JL2_14" LOC = "L19" ;NET "JL2_15" LOC = "G18" ;NET "JL2_16" LOC = "G17" ;NET "JL2_17" LOC = "F18" ;NET "JL2_18" LOC = "E18" ;NET "JL2_19" LOC = "D19" ;NET "JL2_2" LOC = "W20" ;NET "JL2_20" LOC = "D20" ;NET "JL2_3" LOC = "V22" ;NET "JL2_4" LOC = "V21" ;NET "JL2_5" LOC = "V19" ;NET "JL2_6" LOC = "W19" ;NET "JL2_7" LOC = "V20" ;NET "JL2_8" LOC = "U19" ;NET "JL2_9" LOC = "U18" ;NET "JL3_10" LOC = "L21" ;NET "JL3_11" LOC = "L22" ;NET "JL3_12" LOC = "L18" ;NET "JL3_13" LOC = "L17" ;NET "JL3_14" LOC = "G21" ;NET "JL3_15" LOC = "G22" ;NET "JL3_16" LOC = "E20" ;NET "JL3_17" LOC = "E19" ;NET "JL3_18" LOC = "D22" ;NET "JL3_19" LOC = "D21" ;NET "JL3_2" LOC = "Y22" ;NET "JL3_20" LOC = "C22" ;NET "JL3_3" LOC = "W22" ;NET "JL3_4" LOC = "U21" ;NET "JL3_5" LOC = "U20" ;NET "JL3_6" LOC = "N19" ;NET "JL3_7" LOC = "N20" ;NET "JL3_8" LOC = "N21" ;NET "JL3_9" LOC = "N22" ;NET "JR1_10" LOC = "L2" ;NET "JR1_11" LOC = "L1" ;NET "JR1_12" LOC = "K3" ;NET "JR1_13" LOC = "K4" ;NET "JR1_14" LOC = "G1" ;NET "JR1_15" LOC = "G2" ;NET "JR1_16" LOC = "D3" ;NET "JR1_17" LOC = "D2" ;


NET "JR1_18" LOC = "D1" ;NET "JR1_19" LOC = "C1" ;NET "JR1_2" LOC = "W4" ;NET "JR1_20" LOC = "C2" ;NET "JR1_3" LOC = "W3" ;NET "JR1_4" LOC = "V3" ;NET "JR1_5" LOC = "V4" ;NET "JR1_6" LOC = "N4" ;NET "JR1_7" LOC = "N3" ;NET "JR1_8" LOC = "N2" ;NET "JR1_9" LOC = "N1" ;NET "JR2_1" LOC = "W1" ;NET "JR2_10" LOC = "T6" ;NET "JR2_11" LOC = "M4" ;NET "JR2_12" LOC = "M3" ;NET "JR2_13" LOC = "L3" ;NET "JR2_14" LOC = "L4" ;NET "JR2_15" LOC = "H5" ;NET "JR2_16" LOC = "G5" ;NET "JR2_17" LOC = "G6" ;NET "JR2_18" LOC = "F5" ;NET "JR2_19" LOC = "E4" ;NET "JR2_2" LOC = "W2" ;NET "JR2_20" LOC = "D4" ;NET "JR2_3" LOC = "V5" ;NET "JR2_4" LOC = "U5" ;NET "JR2_5" LOC = "V2" ;NET "JR2_6" LOC = "V1" ;NET "JR2_7" LOC = "U4" ;NET "JR2_8" LOC = "T4" ;NET "JR2_9" LOC = "T5" ;NET "JR3_10" LOC = "M2" ;NET "JR3_11" LOC = "L5" ;NET "JR3_12" LOC = "L6" ;NET "JR3_13" LOC = "K1" ;NET "JR3_14" LOC = "K2" ;NET "JR3_15" LOC = "F4" ;NET "JR3_16" LOC = "E3" ;NET "JR3_17" LOC = "F2" ;NET "JR3_18" LOC = "F3" ;NET "JR3_19" LOC = "E2" ;NET "JR3_2" LOC = "Y1" ;NET "JR3_20" LOC = "E1" ;NET "JR3_3" LOC = "U2" ;NET "JR3_4" LOC = "U3" ;NET "JR3_5" LOC = "T1" ;NET "JR3_6" LOC = "T2" ;NET "JR3_7" LOC = "M6" ;NET "JR3_8" LOC = "M5" ;NET "JR3_9" LOC = "M1" ;NET "LED1_1" LOC = "AA17" ;NET "LED1_11" LOC = "AA18" ;NET "LED1_12" LOC = "Y18" ;NET "LED1_13" LOC = "V18" ;NET "LED1_14" LOC = "AB20" ;NET "LED1_15" LOC = "W18" ;NET "LED1_16" LOC = "AA20" ;


NET "LED1_2" LOC = "U17" ;NET "LED1_3" LOC = "Y17" ;NET "LED1_4" LOC = "V17" ;NET "LED1_5" LOC = "AB18" ;NET "LED1_6" LOC = "U16" ;NET "LED1_7" LOC = "W17" ;NET "LED1_8" LOC = "U14" ;NET "LED2" LOC = "AB5" ;NET "LED3" LOC = "AA5" ;NET "LED4" LOC = "AA4" ;NET "LED5" LOC = "AB4" ;NET "S1" LOC = "AA3" | PULLUP ;NET "S2" LOC = "Y4" | PULLUP ;NET "TEMP_A" LOC = "V12" ;NET "TEMP_A" LOC = "V11" ;NET "TEMP_A" LOC = "V6" ;NET "TEMP_INT" LOC = "W5" ;NET "TEMP_SCL" LOC = "Y5" ;NET "TEMP_SDA" LOC = "W6" ;NET "USER_CLK" LOC = "AA11" ;#PACE: Start of PACE Area C<strong>on</strong>stra<strong>in</strong>ts#PACE: Start of PACE Prohibit C<strong>on</strong>stra<strong>in</strong>ts#PACE: End of C<strong>on</strong>stra<strong>in</strong>ts generated by PACElibrary IEEE;use IEEE.std_logic_1164.ALL;use IEEE.std_logic_ARITH.ALL;use IEEE.std_logic_UNSIGNED.ALL;entity ma<strong>in</strong> isPort(-- JL1 Header (p<strong>in</strong> 1 0v) BANK3&2JL1_2 : <strong>in</strong> std_logic;JL1_3 : <strong>in</strong> std_logic;JL1_4 : <strong>in</strong> std_logic;JL1_5 : <strong>in</strong> std_logic;JL1_6 : <strong>in</strong> std_logic;JL1_7 : <strong>in</strong> std_logic;JL1_8 : <strong>in</strong> std_logic;JL1_9 : <strong>in</strong> std_logic;JL1_10 : <strong>in</strong> std_logic;JL1_11 : <strong>in</strong> std_logic;JL1_12 : <strong>in</strong> std_logic;JL1_13 : <strong>in</strong> std_logic;JL1_14 : <strong>in</strong> std_logic;JL1_15 : <strong>in</strong> std_logic;JL1_16 : <strong>in</strong> std_logic;JL1_17 : <strong>in</strong> std_logic;JL1_18 : <strong>in</strong> std_logic;JL1_19 : <strong>in</strong> std_logic;JL1_20 : <strong>in</strong> std_logic;


-- JL2 Header BANK3&2JL2_1 : <strong>in</strong> std_logic; -- CCLK with R999JL2_2 : <strong>in</strong> std_logic;JL2_3 : <strong>in</strong> std_logic;JL2_4 : <strong>in</strong> std_logic;JL2_5 : <strong>in</strong> std_logic;JL2_6 : <strong>in</strong> std_logic;JL2_7 : <strong>in</strong> std_logic;JL2_8 : <strong>in</strong> std_logic;JL2_9 : <strong>in</strong> std_logic;JL2_10 : <strong>in</strong> std_logic;JL2_11 : <strong>in</strong> std_logic;JL2_12 : <strong>in</strong> std_logic;JL2_13 : <strong>in</strong> std_logic;JL2_14 : <strong>in</strong> std_logic;JL2_15 : <strong>in</strong> std_logic;JL2_16 : <strong>in</strong> std_logic;JL2_17 : <strong>in</strong> std_logic;JL2_18 : <strong>in</strong> std_logic;JL2_19 : <strong>in</strong> std_logic;JL2_20 : <strong>in</strong> std_logic;-- JL3 Header (p<strong>in</strong> 1 3.3v) BANK3&2JL3_2 : <strong>in</strong> std_logic;JL3_3 : <strong>in</strong> std_logic;JL3_4 : <strong>in</strong> std_logic;JL3_5 : <strong>in</strong> std_logic;JL3_6 : <strong>in</strong> std_logic;JL3_7 : <strong>in</strong> std_logic;JL3_8 : <strong>in</strong> std_logic;JL3_9 : <strong>in</strong> std_logic;JL3_10 : <strong>in</strong> std_logic;JL3_11 : <strong>in</strong> std_logic;JL3_12 : <strong>in</strong> std_logic;JL3_13 : <strong>in</strong> std_logic;JL3_14 : <strong>in</strong> std_logic;JL3_15 : <strong>in</strong> std_logic;JL3_16 : <strong>in</strong> std_logic;JL3_17 : <strong>in</strong> std_logic;JL3_18 : <strong>in</strong> std_logic;JL3_19 : <strong>in</strong> std_logic;JL3_20 : <strong>in</strong> std_logic;-- JR1 Header (p<strong>in</strong> 1 0v) BANK6&7JR1_2 : <strong>in</strong> std_logic;JR1_3 : <strong>in</strong> std_logic;JR1_4 : <strong>in</strong> std_logic;JR1_5 : <strong>in</strong> std_logic;JR1_6 : <strong>in</strong> std_logic;JR1_7 : <strong>in</strong> std_logic;JR1_8 : <strong>in</strong> std_logic;JR1_9 : <strong>in</strong> std_logic;JR1_10 : <strong>in</strong> std_logic;JR1_11 : <strong>in</strong> std_logic;JR1_12 : <strong>in</strong> std_logic;JR1_13 : <strong>in</strong>out std_logic;


JR1_14 : <strong>in</strong> std_logic;JR1_15 : <strong>in</strong> std_logic;JR1_16 : <strong>in</strong> std_logic;JR1_17 : <strong>in</strong> std_logic;JR1_18 : <strong>in</strong> std_logic;JR1_19 : <strong>in</strong> std_logic;JR1_20 : <strong>in</strong> std_logic;-- JR2 Header BANK6&7JR2_1 : <strong>in</strong> std_logic;JR2_2 : <strong>in</strong> std_logic;JR2_3 : <strong>in</strong> std_logic;JR2_4 : <strong>in</strong> std_logic;JR2_5 : <strong>in</strong> std_logic;JR2_6 : <strong>in</strong> std_logic;JR2_7 : <strong>in</strong> std_logic;JR2_8 : <strong>in</strong> std_logic;JR2_9 : <strong>in</strong> std_logic;JR2_10 : <strong>in</strong> std_logic;JR2_11 : <strong>in</strong> std_logic;JR2_12 : <strong>in</strong> std_logic;JR2_13 : <strong>in</strong> std_logic;JR2_14 : <strong>in</strong> std_logic;JR2_15 : <strong>in</strong> std_logic;JR2_16 : <strong>in</strong> std_logic;JR2_17 : <strong>in</strong> std_logic;JR2_18 : <strong>in</strong> std_logic;JR2_19 : <strong>in</strong> std_logic;JR2_20 : <strong>in</strong> std_logic;-- JR3 Header (p<strong>in</strong> 1 3.3v) BANK6&7JR3_2 : <strong>in</strong> std_logic;JR3_3 : <strong>in</strong> std_logic;JR3_4 : <strong>in</strong> std_logic;JR3_5 : <strong>in</strong> std_logic;JR3_6 : <strong>in</strong> std_logic;JR3_7 : <strong>in</strong> std_logic;JR3_8 : <strong>in</strong> std_logic;JR3_9 : <strong>in</strong> std_logic;JR3_10 : <strong>in</strong> std_logic;JR3_11 : <strong>in</strong> std_logic;JR3_12 : <strong>in</strong> std_logic;JR3_13 : <strong>in</strong> std_logic;JR3_14 : <strong>in</strong> std_logic;JR3_15 : <strong>in</strong> std_logic;JR3_16 : out std_logic;JR3_17 : out std_logic;JR3_18 : out std_logic;JR3_19 : <strong>in</strong>out std_logic;JR3_20 : <strong>in</strong>out std_logic;-- J01 (p<strong>in</strong> 1 0v) R99 l<strong>in</strong>ks p<strong>in</strong>2&3J01_2 : <strong>in</strong> std_logic;J01_3 : <strong>in</strong> std_logic;J01_4 : <strong>in</strong> std_logic;J01_5 : <strong>in</strong> std_logic;


-- J02 (p<strong>in</strong> 1 3.3v)J02_2 : <strong>in</strong> std_logic;J02_3 : <strong>in</strong> std_logic;J02_4 : <strong>in</strong> std_logic;J02_5 : <strong>in</strong> std_logic;-- JB1-4 ????------------ PCI IO ------------------------- J2 (p<strong>in</strong> 2 is just PCI clock)-- last p<strong>in</strong> is NCJ2_1 : <strong>in</strong> std_logic;--J2_2 : out std_logic;J2_3 : <strong>in</strong> std_logic;J2_4 : <strong>in</strong> std_logic;J2_5 : <strong>in</strong> std_logic;J2_6 : <strong>in</strong> std_logic;--J2_7 : out std_logic; NCJ2_8 : <strong>in</strong> std_logic;J2_9 : out std_logic;J2_10 : out std_logic;J2_11 : <strong>in</strong> std_logic;J2_12 : <strong>in</strong> std_logic;J2_13 : <strong>in</strong> std_logic;J2_14 : <strong>in</strong> std_logic;J2_15 : <strong>in</strong> std_logic;J2_16 : <strong>in</strong> std_logic;J2_17 : out std_logic;J2_18 : out std_logic;J2_19 : <strong>in</strong> std_logic;J2_20 : <strong>in</strong> std_logic;J2_21 : <strong>in</strong> std_logic;J2_22 : <strong>in</strong> std_logic;J2_23 : <strong>in</strong> std_logic;J2_24 : <strong>in</strong> std_logic;J2_25 : out std_logic;J2_26 : out std_logic;J2_27 : out std_logic;J2_28 : out std_logic;J2_29 : <strong>in</strong> std_logic;--J2_30 : out std_logic; NCJ2_31 : <strong>in</strong> std_logic;J2_32 : <strong>in</strong> std_logic;J2_33 : <strong>in</strong> std_logic;J2_34 : <strong>in</strong> std_logic;J2_35 : <strong>in</strong> std_logic;J2_36 : <strong>in</strong> std_logic;J2_37 : <strong>in</strong> std_logic;J2_38 : <strong>in</strong> std_logic;J2_39 : <strong>in</strong> std_logic;J2_40 : <strong>in</strong> std_logic;J2_41 : <strong>in</strong> std_logic;J2_42 : <strong>in</strong> std_logic;J2_43 : <strong>in</strong> std_logic;J2_44 : <strong>in</strong> std_logic;


J2_45 : <strong>in</strong> std_logic;J2_46 : <strong>in</strong> std_logic;J2_47 : <strong>in</strong> std_logic;J2_48 : <strong>in</strong> std_logic;J2_49 : <strong>in</strong> std_logic;J2_50 : <strong>in</strong> std_logic;J2_51 : <strong>in</strong> std_logic;J2_52 : <strong>in</strong> std_logic;--J2_53 : out std_logic;NC---------- Stuff <strong>on</strong>board ------------------ Clocks--CCLK : <strong>in</strong> std_logic;USER_CLK : <strong>in</strong> std_logic;CLK_PCI : <strong>in</strong> std_logic;-- U12 (Flash?)FLASH_A : out std_logic_VECTOR(18 DOWNTO 0);FLASH_WE : out std_logic;FLASH_OE : out std_logic;FLASH_CE : out std_logic;FLASH_IO : <strong>in</strong> std_logic_VECTOR(7 DOWNTO 0);-- Temp SensorTEMP_SDA : <strong>in</strong> std_logic;TEMP_SCL : <strong>in</strong> std_logic;TEMP_INT : <strong>in</strong> std_logic;TEMP_A : <strong>in</strong> std_logic_VECTOR(2 DOWNTO 0);-- Serial EEPROMEEPROM_WP : <strong>in</strong> std_logic;EEPROM_SCL : <strong>in</strong> std_logic;EEPROM_SDA : <strong>in</strong> std_logic;-- On board switchs (active low)S1 : <strong>in</strong> std_logic;S2 : <strong>in</strong> std_logic;-- On board LEDs (active high)LED2 : out std_logic;LED3 : out std_logic;LED4 : out std_logic;LED5 : out std_logic;-- LED displayLED1_1 : out std_logic; --Active high column 1 selectLED1_2 : out std_logic; --Active high column 2 selectLED1_3 : out std_logic; --Active low digit D selectLED1_4 : out std_logic; --Active high dots selectLED1_5 : out std_logic; --Active low digit E selectLED1_6 : out std_logic; --Active high column 3 selectLED1_7 : out std_logic; --Active low DP selectLED1_8 : out std_logic; --Active high column 4 selectLED1_11 : out std_logic; -- Active low digit F selectLED1_12 : out std_logic; -- NC???!!!LED1_13 : out std_logic; -- Active low digit C select


end ma<strong>in</strong>;LED1_14 : out std_logic; -- Active low digit A selectLED1_15 : out std_logic; -- Active low digit G selectLED1_16 : out std_logic -- Active low digit B select);architecture rtl of ma<strong>in</strong> isbeg<strong>in</strong>end;


BSchematic of <str<strong>on</strong>g>ST</str<strong>on</strong>g> Microelectr<strong>on</strong>ics Video DAC for 3 x 4bit colour use


CAn excerpt from the PicoBlaze source code for programm<strong>in</strong>g a 192K byte raw b<strong>in</strong>ary fileto a parallel Flash memory device.;**********************************************************************; Program BIN Command - Program FLASH memory with data def<strong>in</strong>ed <strong>in</strong> an; BIN file;**********************************************************************program_b<strong>in</strong>_command: CALL send_CRCALL send_Wait<strong>in</strong>g_MCS_fileLOAD s9, 00 ;load start address of programm<strong>in</strong>gLOAD s8, 00LOAD s7, 00CALL program_BINCALL send_OKJUMP prompt;**********************************************************************; Program FLASH memory with data def<strong>in</strong>ed <strong>in</strong> an BIN file;**********************************************************************;; Reads the BIN file from the UART and programs the FLASH device at; 00000 locati<strong>on</strong>.;;; This rout<strong>in</strong>e will c<strong>on</strong>t<strong>in</strong>ue until an end of file record is detected.; For each l<strong>in</strong>e of BIN received, the current address will be output so; that progress can be m<strong>on</strong>itored.program_BIN:CALL read_from_UART ;read characterLOAD sB, UART_data; load <strong>in</strong> dataCALL program_byteADD s7, 01ADDCY s8, 00ADDCY s9, 00;<strong>in</strong>crement addressCOMPARE s9, 03;COMPARE s9, 04; check for 196608 bytes; check for 262144 bytesJUMP NZ, program_BINRETURN;f<strong>in</strong>nished


DStartup.vhd, a <strong>VHDL</strong> comp<strong>on</strong>ent for reset and power up reset generati<strong>on</strong>.------------------------------------------------------------------------- Company:-- Eng<strong>in</strong>eer: Lynd<strong>on</strong> Amsd<strong>on</strong>---- Create Date: 00:02:39 10/10/2007-- Design Name:-- Module Name: startup - Behavioral-- Project Name:-- Target Devices:-- Tool versi<strong>on</strong>s:-- Descripti<strong>on</strong>: Holds reset l<strong>in</strong>e low for n clocks <strong>on</strong> powerup or when -- reset pressed---- Dependencies:---- Revisi<strong>on</strong>:-- Revisi<strong>on</strong> 0.01 - File Created-- Revisi<strong>on</strong> 0.02 - Changed to run from master clock-- Revisi<strong>on</strong> 0.03 - Added an extra reset output that <strong>on</strong>ly occurs dur<strong>in</strong>g-- powerup-- Revisi<strong>on</strong> 0.03 - Changed powerup reset to be shorter than normal-- reset-- Additi<strong>on</strong>al Comments:-------------------------------------------------------------------------library IEEE;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_1164.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_ARITH.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_UNSIGNED.ALL;entity startup isPort (RESET_IN : <strong>in</strong> bit;CLOCK : <strong>in</strong> bit;POWER_UP_RESET_OUT : out bit;RESET_OUT : out bit);end startup;architecture Behavioral of startup issignal r_counter : std_logic_vector(24 downto 0);signal pwr_counter : std_logic_vector(25 downto 0);signal <strong>in</strong>t_resetn : bit;beg<strong>in</strong>process(RESET_IN,CLOCK) isbeg<strong>in</strong>if (RESET_IN = '0' or <strong>in</strong>t_resetn = '0') then -- if resetswitch pushed, reset counterr_counter '0');RESET_OUT


elsif r_counter = '1' & x"ffbeef" then -- timerRESET_OUT


EClock.vhd, a <strong>VHDL</strong> comp<strong>on</strong>ent for clock and synchr<strong>on</strong>ous bus cycle generati<strong>on</strong>.------------------------------------------------------------------------- Company:-- Eng<strong>in</strong>eer: Lynd<strong>on</strong> Amsd<strong>on</strong>---- Create Date: 12:22:03 10/10/2007-- Design Name:-- Module Name: clocks - Behavioral-- Project Name:-- Target Devices:-- Tool versi<strong>on</strong>s:-- Descripti<strong>on</strong>: Distributes Clocks of different frequencies from master-- 32MHZ clock-- E_CLK is simulated versi<strong>on</strong> of old 6800 8bit clock. Frequency 1/10 --- of CPU clock,-- Duty cycle 60% low, 40% high.---- Dependencies:---- Revisi<strong>on</strong>:-- Revisi<strong>on</strong> 0.01 - File Created-- Revisi<strong>on</strong> 0.02 - Strange issue <strong>in</strong> simulati<strong>on</strong> us<strong>in</strong>g counter(1) as-- clock for process-- Changed to an <strong>in</strong>ternal signal-- Revisi<strong>on</strong> 0.03 - Changed the 8, 2 and 0.5 MHz clock to be <strong>in</strong>verse <strong>in</strong>-- relati<strong>on</strong> to master clock-- Revisi<strong>on</strong> 0.04 - Changed to use the DCM/PLL for 8 and 16 MHz clocks-- Revisi<strong>on</strong> 0.04 - Added 27Mhz divide by 11 = 2.45 Mhz clock for MFP-- Additi<strong>on</strong>al Comments:-------------------------------------------------------------------------library IEEE;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_1164.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_ARITH.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_UNSIGNED.ALL;entity clocks isPort (RESET : <strong>in</strong> bit;CLOCK_IN : <strong>in</strong> bit;CLOCK32 : out bit;CLOCK16 : out bit;CLOCK8 : out bit;CLOCK4 : out bit;CLOCK2 : out bit;CLOCK0_5 : out bit;CLOCK24576 : out bit;CLOCK_E : out bit;VPAn : <strong>in</strong> bit;VMAn : out bit;DTACKn : out bit);end clocks;


architecture Behavioral of clocks issignal pcounter : std_logic_vector(3 downto 0);signal e_counter : std_logic_vector(3 downto 0);signal dcmreset,dcmclock : std_logic;signal dcm8,dcm16,dcm32 : std_logic;signal <strong>in</strong>t_vman: bit;signal dcm27,dcm24576: std_logic;comp<strong>on</strong>ent dcm_16PORT(CLKIN_IN : IN <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;R<str<strong>on</strong>g>ST</str<strong>on</strong>g>_IN : IN <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;CLKDV_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;CLKFX_OUT : out std_logic;--CLKIN_IBUFG_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;CLK0_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;LOCKED_OUT: OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC);end comp<strong>on</strong>ent;comp<strong>on</strong>ent dcm_8PORT(CLKIN_IN : IN <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;R<str<strong>on</strong>g>ST</str<strong>on</strong>g>_IN : IN <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;CLKDV_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;--CLKIN_IBUFG_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;CLK0_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;LOCKED_OUT: OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC);end comp<strong>on</strong>ent;comp<strong>on</strong>ent dcm_24576PORT(CLKIN_IN : IN <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;R<str<strong>on</strong>g>ST</str<strong>on</strong>g>_IN : IN <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;CLKDV_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;--CLKIN_IBUFG_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;);end comp<strong>on</strong>ent;CLK0_OUT : OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC ;LOCKED_OUT: OUT <str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGICbeg<strong>in</strong>process(dcm8,RESET) isbeg<strong>in</strong>if RESET = '0' thenpcounter


process(RESET,dcm8) isbeg<strong>in</strong>if RESET = '0' thene_counter dcm8,CLK0_OUT => open,LOCKED_OUT => open);I_DCM_24576 : dcm_24576port map(CLKIN_IN => dcm27,R<str<strong>on</strong>g>ST</str<strong>on</strong>g>_IN => dcmreset,CLKDV_OUT => dcm24576,CLK0_OUT => open,LOCKED_OUT => open);--CLOCK16


CLOCK_E


From_c<strong>on</strong>trol.vhd, a <strong>VHDL</strong> comp<strong>on</strong>ent for resiz<strong>in</strong>g 8 bit Flash memory bus to 16 bit.------------------------------------------------------------------------- Company:-- Eng<strong>in</strong>eer: Lynd<strong>on</strong> Amsd<strong>on</strong>---- Create Date: 00:34:12 10/12/2007-- Design Name:-- Module Name: rom_c<strong>on</strong>trol - Behavioral-- Project Name:-- Target Devices:-- Tool versi<strong>on</strong>s:-- Descripti<strong>on</strong>: A small state mach<strong>in</strong>e to use 8 bit flash ROM <strong>on</strong> a 16bit-- bus-- Stores low byte then <strong>in</strong>crements A0-- 2x CPU clock needed---- Dependencies:---- Revisi<strong>on</strong>:-- Revisi<strong>on</strong> 0.01 - Changed Endian as file is transferred to target from-- Intel Host-- Revisi<strong>on</strong> 0.01 - File Created-- Additi<strong>on</strong>al Comments:-------------------------------------------------------------------------library IEEE;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_1164.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_ARITH.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_UNSIGNED.ALL;entity rom_c<strong>on</strong>trol isPort (FLASH_DATA : <strong>in</strong> bit_VECTOR (7 downto 0);FLASH_ADDR : out bit_VECTOR (17 downto 0);D_BUS : out std_logic_VECTOR (15 downto 0);CLOCK : <strong>in</strong> bit;A_BUS : <strong>in</strong> bit_VECTOR (17 downto 1);CS : <strong>in</strong> bit;RESET : <strong>in</strong> bit);end rom_c<strong>on</strong>trol;architecture Behavioral of rom_c<strong>on</strong>trol is-- def<strong>in</strong>e statestype state_type is (idle,botbyte,topbyte,<strong>in</strong>caddr);signal state : state_type;signal a0 : bit;signal lowbyte : bit_vector(7 downto 0);signal highbyte : bit_vector(7 downto 0);beg<strong>in</strong>


process (RESET,CLOCK)beg<strong>in</strong>if RESET = '0' then state


Gled_debug.vhd, a <strong>VHDL</strong> comp<strong>on</strong>ent for driv<strong>in</strong>g the value of the CPU address and databus <strong>on</strong>to 7 segment displays. Hex2seg.vhd is a subcomp<strong>on</strong>ent.------------------------------------------------------------------------- Company:-- Eng<strong>in</strong>eer: Lynd<strong>on</strong> Amsd<strong>on</strong>---- Create Date: 16:41:38 10/12/2007-- Design Name:-- Module Name: led_debug - Behavioral-- Project Name:-- Target Devices:-- Tool versi<strong>on</strong>s:-- Descripti<strong>on</strong>: Displays current data and address but <strong>on</strong> a 7 Segment-- Also provides a flash<strong>in</strong>g led to show clocks are up and runn<strong>in</strong>g---- Dependencies:---- Revisi<strong>on</strong>:-- Revisi<strong>on</strong> 0.09 - Support to show data bus <strong>on</strong> bus error cycles-- Revisi<strong>on</strong> 0.08 - Data byte enables used to display blank character <strong>in</strong>-- byte transfers-- Revisi<strong>on</strong> 0.07 - UDSn used to display miss<strong>in</strong>g A0-- Revisi<strong>on</strong> 0.06 - Improved so data is latched <strong>on</strong>e CPU cycle after-- dtackn low-- Two clocks needed, <strong>on</strong>e for display (slow ~0.5Mhz) and another for-- CPU clock speed-- Revisi<strong>on</strong> 0.05 - Added latch for data bus as data from RAM is cyclic-- Revisi<strong>on</strong> 0.04 - Slowed display down a little bit-- Revisi<strong>on</strong> 0.03 - Modified to display full address and data buses-- Revisi<strong>on</strong> 0.02 - Modified to display current address-- Revisi<strong>on</strong> 0.01 - File Created-- Additi<strong>on</strong>al Comments:-------------------------------------------------------------------------library IEEE;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_1164.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_ARITH.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_UNSIGNED.ALL;entity led_debug isPort (ADDRESS : <strong>in</strong> bit_VECTOR (23 downto 1);DATA : <strong>in</strong> std_logic_VECTOR (15 downto 0);LEDCOL : out bit_VECTOR (4 downto 0);LEDROW : out bit_VECTOR (7 downto 0);CLOCK : <strong>in</strong> bit;CLOCK8 : <strong>in</strong> bit;LEDFLASH : out bit;UDSn: <strong>in</strong> bit;LDSn: <strong>in</strong> bit;DTACKn: <strong>in</strong> bit;BERRn: <strong>in</strong> bit;


RESET : <strong>in</strong> bit);end led_debug;architecture Behavioral of led_debug issignal counter : std_logic_vector(20 downto 0);signal temphex : bit_vector (3 downto 0);signal tempseg : bit_vector (6 downto 0);signal blank : bit;signal temp_latch : bit_vector (15 downto 0);-- def<strong>in</strong>e statestype state_type is (S4,S6,S8);signal state : state_type;-- LED Driverbeg<strong>in</strong>process(RESET,CLOCK) isbeg<strong>in</strong>if (RESET = '0') then -- reset signalscounter '0');elsif CLOCK = '1' and CLOCK' event thencounter


elseblank


------------------------------------------------------------------------- Company:-- Eng<strong>in</strong>eer: Lynd<strong>on</strong> Amsd<strong>on</strong>---- Create Date: 21:53:10 10/15/2007-- Design Name:-- Module Name: hex2seg - Behavioral-- Project Name:-- Target Devices:-- Tool versi<strong>on</strong>s:-- Descripti<strong>on</strong>: C<strong>on</strong>verts a Hex value to a 7 segment display-- Dependencies:-- Revisi<strong>on</strong>:-- Revisi<strong>on</strong> 0.02 - Added opti<strong>on</strong> to display a '-' character-- Revisi<strong>on</strong> 0.01 - File Created-- Additi<strong>on</strong>al Comments:-------------------------------------------------------------------------library IEEE;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_1164.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_ARITH.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_UNSIGNED.ALL;entity hex2seg isPort (BLANK : <strong>in</strong> bit;HEX : <strong>in</strong> bit_vector (3 downto 0);SEG : out bit_vector (6 downto 0));end hex2seg;architecture Behavioral of hex2seg issignal c<strong>on</strong>versi<strong>on</strong> : bit_vector (6 downto 0);beg<strong>in</strong>SEG


HSchematic from ‘Microprocessor <str<strong>on</strong>g>System</str<strong>on</strong>g> Design’ by Alan Clements show<strong>in</strong>g s<strong>in</strong>gle stepc<strong>on</strong>trol of the Motorola MC68000.


IS<strong>in</strong>gle_step.vhd, a <strong>VHDL</strong> comp<strong>on</strong>ent for c<strong>on</strong>troll<strong>in</strong>g s<strong>in</strong>gle stepp<strong>in</strong>g of the CPU throughbus cycles.------------------------------------------------------------------------- Company:-- Eng<strong>in</strong>eer:---- Create Date: 15:09:37 01/15/2008-- Design Name:-- Module Name: s<strong>in</strong>gle_step - Behavioral-- Project Name:-- Target Devices:-- Tool versi<strong>on</strong>s:-- Descripti<strong>on</strong>:-- Used to <strong>in</strong>tercept the bus cycle handshak<strong>in</strong>g to the CPU so-- that a switch can be used to s<strong>in</strong>gle step the SPU---- Dependencies:---- Revisi<strong>on</strong>:-- Revisi<strong>on</strong> 0.04 - Added reset for state mach<strong>in</strong>e-- Revisi<strong>on</strong> 0.03 - Modified to work with puls<strong>in</strong>g dtack <strong>in</strong> (eg from mmu)-- Revisi<strong>on</strong> 0.02 - Gett<strong>in</strong>g stuck <strong>in</strong> Busend State, changed to delay-- rather-- than check<strong>in</strong>g for AS go<strong>in</strong>g high.-- Revisi<strong>on</strong> 0.01 - File Created, use state mach<strong>in</strong>e-- Additi<strong>on</strong>al Comments:-------------------------------------------------------------------------library IEEE;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_1164.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_ARITH.ALL;use IEEE.<str<strong>on</strong>g>ST</str<strong>on</strong>g>D_LOGIC_UNSIGNED.ALL;entity s<strong>in</strong>gle_step isPort ( CLK16 : <strong>in</strong> bit;CLK8 : <strong>in</strong> bit;RESET : <strong>in</strong> bit;RAM : <strong>in</strong> bit;AS : <strong>in</strong> bit;DTACK_I : <strong>in</strong> bit;BERR_I : <strong>in</strong> bit;SWITCH : <strong>in</strong> bit;DTACK_O : out bit;BERR_O : out bit);end s<strong>in</strong>gle_step;architecture Behavioral of s<strong>in</strong>gle_step issignal counter : std_logic_vector(23 downto 0);


-- def<strong>in</strong>e statestype state_type is (idle,butt<strong>on</strong>,busend,delay,ramaccess);signal state : state_type;beg<strong>in</strong>process (CLK16,RESET)beg<strong>in</strong>if reset = '0' thenstate


when ramaccess =>DTACK_O


JChange to MFP IP core wf68901ip_timers.vhd for correct generati<strong>on</strong> of x_CNT<str<strong>on</strong>g>ST</str<strong>on</strong>g>RBwhere x is the Timer letter.Old:wait until CLK = '1' and CLK' event;if PRESCALE > x"00" and XTAL_<str<strong>on</strong>g>ST</str<strong>on</strong>g>RB = '1' thenPRESCALE := PRESCALE - '1';elsecase TACR(2 downto 0) iswhen "111" => PRESCALE := x"C7"; -- Prescaler = 200.when "110" => PRESCALE := x"63"; -- Prescaler = 100.when "101" => PRESCALE := x"3F"; -- Prescaler = 64.when "100" => PRESCALE := x"31"; -- Prescaler = 50.when "011" => PRESCALE := x"0F"; -- Prescaler = 16.when "010" => PRESCALE := x"09"; -- Prescaler = 10.when "001" => PRESCALE := x"03"; -- Prescaler = 4.when "000" => PRESCALE := x"00"; -- Timer stopped or event-- count mode.end case;end if;case PRESCALE iswhen x"00" => A_CNT<str<strong>on</strong>g>ST</str<strong>on</strong>g>RB A_CNT<str<strong>on</strong>g>ST</str<strong>on</strong>g>RB


KChange to Glue IP core wf25915ip_<strong>in</strong>terrupts.vhd for correct generati<strong>on</strong> of IPL levelfrom <strong>in</strong>terrupt sources, MFP, HBL and VBL.Old:PRIODECODER: process(EINT3n, EINT5n, EINT7n, GI_In)beg<strong>in</strong>if EINT7n = '0' then -- Highest priority.IPLn


LSchematic of the revised Eiffel project, to support c<strong>on</strong>trol of an ATX power supply anduse of S<strong>on</strong>y Playstati<strong>on</strong> c<strong>on</strong>trollers.


MGembench and SysInfo Results.


NTwo secti<strong>on</strong>s from wf25915ip_video_tim<strong>in</strong>g.vhd, first is the orig<strong>in</strong>al and the sec<strong>on</strong>d isthe revised versi<strong>on</strong> with equality relati<strong>on</strong>al operators.DE_CTRL: process(CLK, RESETn)beg<strong>in</strong>if RESETn = '0' thenHDE


DE_CTRL: process(CLK, RESETn)beg<strong>in</strong>if RESETn = '0' thenHDE

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!