Last visit was: Fri Dec 12, 2025 9:03 pm
It is currently Fri Dec 12, 2025 9:03 pm



 [ 25 posts ]  Go to page Previous  1, 2
 Tridora-CPU - an FPGA stack machine CPU for Pascal 
Author Message

Joined: Mon Oct 07, 2019 2:41 am
Posts: 882
The CMOS version of the PDP 8 had a stack. IF I was redesigning the 8 , I would have 002X as auto decrement resisters that map to 001x
and Jump to subroutine pushes the PC using 17 as the stack.


Wed May 28, 2025 2:04 am

Joined: Sun Oct 20, 2024 9:43 pm
Posts: 9
oldben wrote:
The CMOS version of the PDP 8 had a stack. IF I was redesigning the 8 , I would have 002X as auto decrement resisters that map to 001x
and Jump to subroutine pushes the PC using 17 as the stack.


Ah, didn't know that, interesting. Come to think of it, the PDP-8 had quite a long lifespan if you count the microprocessor versions and considering the (for the 1970s) limited architecture.


Wed May 28, 2025 10:57 pm

Joined: Sun Oct 20, 2024 9:43 pm
Posts: 9
Another update for the Tridora-CPU - it now has a data cache in addition to the instruction cache.

This has a noticable impact on compile times: building "hello,world" now takes 15 seconds instead of 20.

As with the instruction cache, it just caches the 16 bytes that the DRAM controller always delivers. Since with the stack machine architecture you often read, write and read the same location again, it was important to implement it as a write-back cache. Otherwise the cache would be invalidated too often.

Thankfully, the write-back mechanism was not as complicated as I feared.

I have updated the benchmark results at https://gitlab.com/slederer/Tridora-CPU/-/blob/main/examples/benchmarks.results.text. If you compare the performance when running code from DRAM without any caches to the current version, you get a three times better performance in the empty loop benchmark.

In comparison to running without data cache but with instruction cache, you get 1.6 times better performance.

The other big thing is this update is the audio controller. I finally hooked up the Digilent AMP2 PMOD and added something like the sound generator chips of the early 1980s to the logic design: Four channels of rectangle waves and a noise generator. Then I thought, that is boring, and reworked it so that now it can to interrupt-driven sample playback at (at least) 32KHz (mono).

Here is a video where you can hear the Tridora-CPU making noises and playing music: https://youtu.be/p3USZ40Du24

And now I guess it is already time to plan this year's christmas demo...


Mon Oct 13, 2025 10:05 pm
Online

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1863
Thanks for the update - good to see small caches making good performance improvements!


Tue Oct 14, 2025 10:06 am
User avatar

Joined: Sun Dec 19, 2021 1:36 pm
Posts: 106
Location: Michigan USA
Thank you for the link to your video. I enjoyed watching it. The sound quality is really amazing! Michael


Tue Oct 14, 2025 11:28 pm WWW

Joined: Mon Nov 28, 2022 2:51 pm
Posts: 8
Very nicely done! And even a lot of documentation, impressive!
Looking forward to the Christmas Demo :)


Sat Dec 06, 2025 12:19 pm

Joined: Mon Nov 28, 2022 2:51 pm
Posts: 8
BTW: a porting guide would be nice :)
Just a brief one, half a page describing what is important, like:
you use switches (what for, reset is obvious, but ..)
LEDs really needed, what do they show
VGA out, using 12 bit ./hysnc/vsync ...
Audio? PWM, 2 channels
etc.

Was just looking at it, and looking for a board which is close to a digilent artix7 ...

But seriously, great job!


Sat Dec 06, 2025 3:03 pm

Joined: Mon Nov 28, 2022 2:51 pm
Posts: 8
BTW, I don't think(?) it would be too difficult to make a a100t version for the digilent boards.
The 35/50/75/100 are pretty similar, so just a changing the chip and start a new P&R ...
shouldn't be more than that ...


Sat Dec 06, 2025 8:16 pm

Joined: Sun Oct 20, 2024 9:43 pm
Posts: 9
Yes, there should always be more documentation ;)

As you mentioned, maybe a short description about how the PMODs are wired up would be nice, also the clock routing and BRAM usage. I also wanted to do a diagram for a long time that shows what happens in the CPU at the different sequencer stages and how they overlap. For example, the instruction fetch (first stage) is started in the last stage of the previous instruction.

I'm not really using the buttons and switches by the way, that they are declared in the Verilog sources is a leftover from earlier debugging. I probably should clean that up sometime...

If you want to port this to another board, I'd be happy to help, just ask away!

The closest board would be the Arty-A7-100T. For that you would probably have to adjust some of the pins in the constraints file and you're done.

The next best (and cheaper) thing would be the Arty-S7-50T (Spartan-7 instead of Artix-7 parts). The Arty-S7-25T is at an even lower price, but it does not have enough BRAM to get 128KB of video memory + 64KB SRAM out of it. You could try to reduce the SRAM to 32KB, that will slow things down but should work.


Wed Dec 10, 2025 10:35 pm

Joined: Mon Nov 28, 2022 2:51 pm
Posts: 8
I have one of the QMTech boards with an artix7-200 on it, also DDR3, but on anther bank ...
have PS/2 mouse & keybord, DVI, PWM audio, SD-Card interfaces

If you would remove all the buttons, LEDs etc. from the top file, would be nice :)
Tough to check, if they are not used somewhere after all ...

One of those Christmas projects :)


Thu Dec 11, 2025 10:05 am
 [ 25 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: AhrefsBot, alibaba-cloud, CN-mobile-9808 and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software