#sprout24 — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #sprout24, aggregated by home.social.
-
I accomplished a goal this weekend that I've had in my sights for five years now by presenting my #Sprout24 homebrew CPU at #Penguicon 2024. It went really well, and the geeky conversations that followed were just delightful.
One thing that everyone agreed on is that you can never have too many blinkenlights.
-
GlobalTalk has been a nice distraction, but back to the #Sprout24 CPU project.
Last night I tested my bodge for the Carry flag issue, and it works! This was a hard one to track down because I later discovered a *different* Carry flag bug in the emulator. So I was troubleshooting against a not-quite-right target for a while. The CPU and emulator are finally both working right *and* agreeing with each other now.
The adder simulator I shared last week proved really useful for testing and making sure all cases were doing what they should.
With that resolved, I'm also seeing that the Carry bug was masking a different issue that has something to do with the memory address bus getting unexpected values in some situations. I am not sure yet what is going on there, but it seems to have something to do with the stall cycle after a load/store/push/pop.
I at least have some test programs that will reliably trigger that mismatch, so hopefully I can track that down soon.
Each little bugfix is getting us closer...
-
Hey all, I made something neat to share with you. It's a web-based simulator of a CPU's adder circuitry that hopefully makes it easier to understand how binary addition, subtraction, and twos'-complement math work.
I couldn't find a decent online simulator that went into enough detail, so I made my own!
This is going to be part of a larger set of documentation and computer science learning materials based on the #Sprout24 CPU. But I'm so happy with how this piece turned out that you may as well play with it now.
-
A change to the clock timing on the status register completely solved the corruption issue for the Zero and Sign flags.
Another bug squashed, and one more left to see if its solution works! 🪲
-
I forgot the term "hold violation", so it went into my notes as a "propagation race". I guess that works too.
Anyway, I have one of those to fix. The sign and zero flags on the status register aren't seeing their input data for quite long enough.
The carry flag issue was something else, and required just a few extra logic gates to change how the carry flag is calculated during subtraction operations.
It feels good to be squashing cpu bugs something fierce this weekend. :)
-
I took a little break to play with #GlobalTalk, but there's progress and good news on the CPU development front too.
I can confirm that the two revised boards I ordered for the control unit and register file are working exactly as I hoped.
That means that conditional jumps and register writebacks are all working correctly now as far as I've been able to test.
Plus, I rewrote the main loop of the emulator to simplify it, and that's making comparing the states of the emulated and hardware CPUs a lot more straightforward to follow.
The only issue I'm still seeing is that the Carry and Sign flags seem to get set wrong in some limited situations, and I've isolated some test cases to help track those down. It seems to have something with how that flag logic takes the invert bit to the ALU into account.
I've got a little more than a month to file down the remaining rough edges, write some more demo programs, and finish putting my presentation together for #Penguicon. But I'm feeling optimistic! :)
-
Oh, cool, I just got word that my program submission for #Penguicon was accepted! So it looks like I'll be doing a bit of an Intro to CS and showing off the #Sprout24 CPU on Friday, April 26th. 🌱
If you're near southeast Michigan, come on out and say hi! Registrations for my favorite open source nerdy hackerfest weekend are open now at https://penguicon.org 🐧
-
How it started vs. how it's going... a tale of two leap years.
The top is the first PCB I ever ordered, on February 29, 2020 —mere days before the world went into lockdown.
The second is a rendering of one of the boards I placed an order for today, February 29, 2024.
I think this is the universe's way of telling me I need to wrap this project up. #Sprout24
-
@larsbrinkhoff That story is legend. I couldn't help adding this to a recent project. #sprout24
-
I guess I should have tested this earlier, but it looks like there's an issue with the EI (Enable Interrupts) instruction. It's setting the interrupt flag correctly, but then it un-sets on its own at the next cycle.
I have a good idea where to find this one, though, so I'm hoping for an easy fix.
-
I started testing hardware interrupts tonight, and it's clear there's going to be some troubleshooting involved. I've been dreading this part a little bit, so I'm glad for some recent successes to keep me motivated to get this cpu finished.
-
Turns out the value of what the carry flag should be during a subtraction is not well-defined:
"While the carry flag is well-defined for addition, there are two ways in common use to use the carry flag for subtraction operations: ... subtract with borrow ... and subtract with carry".
I'm seeing occasional mismatches of the carry flag between my CPU and emulator, only happening on some subtractions. I suspect I may have implemented it one way in the ALU hardware and the other way in the emulator without realizing it. If that turns out to be the case, then either way is valid, so I can just update the emulator to match the physical ALU and document the behavior in the ISA docs.
That leaves me with three open issues and no other known problems:
1) Conditional jumps — needs an updated Control Unit board to select correct jump type
2) Register timing — needs an updated Register File controller to latch on falling edge of clock
3) Carry flag — may just need to update docs and emulatorGetting close!
-
I *found* it! The "jump taken" signal was looking at instruction bits 18–16 instead of 19–17 to determine what type of conditional jump it is.
Effectively just a transcription error when transcribing the design from emulator code to schematic.
I'll need to design an updated control unit board, but I know exactly what to fix now.
It's *so* close now! 🌱
-
The bodge monster strikes again! But I think the timing issue I've been chasing down is finally fixed now. And with that working reliably, it's making it easier to isolate the other bugs I'm searching for.
The next step is reviewing the control unit logic that sets the "jump taken" signal, since it's not getting set correctly for some combinations of conditional jumps and alu flags. It all works fine in the emulator, so I'm guessing something just got flubbed in the translation from code to schematic.
Either way, I'm encouraged by the progress.
-
The cheap knockoff logic analyzer is a success! Here's the first test, watching some register select lines.
A later run looking at ALU flags helped shed some light on a timing issue, so it's already proving useful. I wish I knew about this device earlier, since I thought I needed to spend hundreds to be able to examine signal timing like this.
-
Hi all! I did a short-notice livestream last week while I was doing some debugging on the #Sprout24 CPU, and ended up giving this impromptu tour at the end.
It's getting closer and closer! I've since identified one elusive timing issue that I have a pretty good idea how to tackle now.
-
Oh, that was fun! My first attempt at livestreaming a project night worked well. Not only did I fix the problem I was searching for (a bad shift-register board), but I got to hang out with a couple folks and give a quick project tour.
I think I'll plan on doing this again before too long. This was kind of spontaneous tonight, but I'll try to plan ahead and give advance notice next time.
-
Coming back to a problem with fresh eyes always helps.
I thought I damaged some part of the CPU spectacularly while adding some modifications, but it turns out I just forgot to reconnect a bodge wire, which meant that one of the voltages was missing on the backplane expansion slots.
Plug that back in, and it's right back working like it was before. So now, thank goodness, I only have to troubleshoot the issues I already knew about, not recover from a full failure.
-
This project is testing my persistence tonight. I think my need to finally finish it now that I'm so close is outweighing the urge to just flip the table in frustration. But any more work is going to have to wait until another day, if not after the holidays.
Everything was working pretty well until I tried to fix up some loose connectors, and now something has gone dreadfully wrong with the memory data bus.
I haven't found the cause yet, so I'm worried I'm going to have to tear the whole cpu apart and re-test it board by board.
It will sure feel good when I can call the hardware side done and get back to writing software for it instead. #sprout24
-
It's new PCB day! I decided to try out a couple of new colors this time. The purple boards are especially nice.
-
I'm really excited about a big milestone tonight. The training wheels have come off, and the CPU is running a complex program without any assistance from the emulator!
The test interface is connected to read the CPU state and compare it to an emulated version automatically after every cycle. In this case, it matched perfectly through the whole run.
Only about 80% of my test programs are matching completely, so there is still some detective work to do. And I haven't even considered testing interrupts yet.
But she balanced on her own for a while, and now knows for sure it can be done. :blobhaj_thanks_love:
-
Tracked down another bug... an internal bus that was intended to be pulled low by default but actually is not. As a result, the instruction register occasionally latches garbage instead of a NOP during the stall cycle after a memory access.
Time to bodge in a pile of resistors to make sure that solves the problem. Annoying, yes, but better the bugs you /can/ find than the bugs you /can't/.
-
After a lot of single-stepping with the new test interface and comparing the hardware to the emulator, I've just confirmed that the problem I've been chasing for months is due to a clock skew issue.
If I disconnect the general registers from the main clock and clock them separately to force the relative timing, it's acting predictably again.
I'll do more testing this week to see where that leaves things, but this progress is quite welcome.
-
The CPU is now connected to its backplane and an expansion card for the first time.
The expansion card is a test and development interface that mates a Raspberry Pi and a Pi Pico to the expansion bus through a bunch of shift registers to allow them to read and write data and control signals, plus some auxiliary connectors to be able to monitor the CPU's internal registers and busses.
Here, for a first test, the expansion board is pretending to be a ROM filled with random ALU instructions, which the CPU is busy executing. I was able to use this to track down a loose connection on one of the stackable headers.
From here, I'll be writing a bunch of test cases to automatically compare the behavior of the physical CPU to the well-tested behavior of the emulator.
Forgive the messy workbench. It's just chaos in progress. :)
-
If nothing else, the jumpers are pretty. :blobhaj_flag_gay:
-
Fresh off the delivery truck, it's new PCB day for the #Sprout24 CPU project.
These are the basic backplane, a testing interface card, and a revised northwest board.
Really hoping these all work right so I can get past where I left off on my last round of testing and troubleshooting.
-
This backplane is a lot less complicated than most of the boards I've made lately.
But combined with the debug controller expansion board I'm also designing, it's sure going to help eliminate much of the ratsnest of wires I'm dealing with now during testing.
Hoping to send them both to production later this week.
-
This cursed bodge is part of a last-ditch effort to test a proposed fix before sending in the order for a revised board.
This IC is half the size of a grain of rice. I desoldered it long enough to raise one of the legs and attach a piece of magnet wire to it. No idea yet if it has survived the process undamaged or if I was able to be precise enough for this to work.
I do understand, after straining my eyes and balancing everything in place with fine-tipped tweezers, why we usually leave this part to the robots.
-
I was kind of burned out this summer and just wanted to spent time outside and with the family, so the CPU project got mostly shelved for a while. Now that the evenings are darker and colder and we're back in the rhythm of the school year, I find myself ready to start back in on it.
Tonight was creating a Revision B of the Northwest board that fixes a look-ahead carry bug in the PC and SP incrementors.
And I migrated the design from KiCad 5 to KiCad 7, which involved more adjustments than I expected.
I'll look it over again with fresh eyes next week and then it will probably be time to get a new board order placed.
-
Happy Ada Lovelace Day to all the women who follow our passions in computer science and STEM fields. And to all those who paved the way.
Your work, your voice, and your visible presence are all indispensable. ❤️