Developer Sebastian Lederer has developed a ground-up {custom} microprocessor, working on an FPGA, for a Pascal-native laptop: the Tridora System.
“Tridora is a homebrew CPU written in Verilog and an identical software program setting, together with a Pascal compiler and assembler,” Lederer explains of the undertaking. “Every thing was created from the bottom up (besides soldering stuff). Every thing is so simple as doable whereas nonetheless being moderately helpful. Every thing is open supply, so you may learn, perceive and modify the entire system, {hardware} and software program.”
The Tridora’s CPU is a fully-custom and surprisingly compact design, written in simply 500 strains of Verilog {hardware} description language. Working at 83MHz, utilizing an Digilent Arty-A7 FPGA improvement board as its host, the CPU core processes at 4 clocks per instruction — and is, as Lederer admits, “appropriate with nothing,” utilizing because it does a very unique instruction set structure.
That, after all, signifies that no present software program will run on the CPU — which brings within the different a part of the Tridora System, a Pascal compiler written for the core. This, Lederer says, takes up round 9,000 strains of code, is able to compiling itself, and comes with native editor, compiler, and assembler, that means improvement can happen on-device — although there’s additionally a cross-compilation setting too.
“[The] compiler does its personal Pascal dialect,” Lederer explains, referring to a programming language developed by Niklaus Wirth and first launched in 1970 and which misplaced out to BASIC within the house computing market of the Eighties, “with some restrictions and a few extensions.” These extensions embody assist for arbitrary size strings, some options taken from Borland TurboPascal 3.0’s normal library, graphics features, and non-standard file dealing with “as a result of the usual sucks,” Lederer says.
The undertaking is documented in full on Lederer’s GitLab repository, the place the supply code is revealed beneath the permissive BSD three-clause license; demos showcasing its capabilities embody Conway’s Recreation of Life, a picture viewer, a Mandlebrot set visualizer, and a screensaver-like line animation. Digilent Arty-A7-35T homeowners can obtain a construct for his or her boards, whereas these with out appropriate {hardware} can strive the system in emulation.