Gigatron emulator in a µC

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice.
Post Reply
jwolfram
Posts: 13
Joined: 07 Jan 2019, 20:11

Gigatron emulator in a µC

Post by jwolfram » 07 Jan 2019, 20:40

Hello, a new Gigatron emulator is alive:

http://www.jcwolfram.de/projekte/gtmicro_en/main.php

It emulates a cycle accurate gigatron with 64K RAM in a overclocked STM32F405, the 'external' hardware is nearly identical to the original (except for the lower voltage levels).

gigatron_tinybasic2.jpg
gigatron_tinybasic2.jpg (59.29 KiB) Viewed 971 times

monsonite
Posts: 62
Joined: 17 May 2018, 07:17

Re: Gigatron emulator in a µC

Post by monsonite » 28 Jan 2019, 18:11

Hi Joerg,

That is really cool!

A Gigatron emulated with so little hardware!

Did you work out first that you needed 36 ARM instructions to emulate the most complex Gigatron instruction - so that set your clock at 36x6.25MHz = 225MHz.

225MHz is about 34% increase in clock speed for the normally 168MHz STM32F405 - were there any concerns about achieving this- or are STM32 frequently overclocked?

I like the description of "small islands of code" for each emulated instruction. So you allocated 256 bytes to each emulated instruction - which takes up 64K of the on chip flash. That's elegant in its simplicity :) It makes you wonder how many other 8 bit cpus could be emulated in this way.

STM have some good deals on their 400MHz STM32H750VBT6 (Farnell 2980947) for under $10. 128Kbytes of Flash and 1Mbyte of RAM. That would allow up to 64 clock cycles per emulated instruction without overclocking, plus the opportunity for a much larger video buffer.

Inspiring work


regards


Ken

jwolfram
Posts: 13
Joined: 07 Jan 2019, 20:11

Re: Gigatron emulator in a µC

Post by jwolfram » 30 Jan 2019, 09:32

Hi Ken,

at the beginning, I started with 175MHz which was only slightly above the 168MHz. The most timing critical instructions are the conditional branches. They require branches on the host side which causes additional wait cycles. With a small test program and some measuring I found out, that 225MHz was the lowest usable multiple of 6,25MHz. But my '405 worked also at 250MHz.

With a STM32H7 and its enough RAM it should be possible to achieve higher speed, but with the code written in C it will not be sufficient. The gtemu2.c code on the same controller (with activated cache) was about 4.5 times slower.

Joerg

Post Reply