REV 3 - REV 5 - The beginning (ST536)
Re: REV 3 - REV 5 - The beginning (ST536)
This is ridiculous when two scope probes can't agree on the same signal driving them !
Re: REV 3 - REV 5 - The beginning (ST536)
Can't you just go with a delay being needed, invert the RAM/CPU clock signal and thus wait another half cycle?exxos wrote: Mon Nov 16, 2026 2:21 pm Realistically I will spend a few more days on it. But I think I am at the same brick wall as before, and it really needs a better chip
It'd give you another 10ns to get everything stabilised. If that's not enough, re-invert the 030 clock generation and wait 20ns.
Surely the extra handful of MB/s of throughput aren't as important as reliability?
BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Re: REV 3 - REV 5 - The beginning (ST536)
I have already tried pretty much all of that. Today alone I tried STERM half a clock later, STERM half a clock later with an extra SDRAM read to hold the data longer, and inverting the SDRAM clock. All of them made things worse, not better.
I also agree reliability is more important than a few MB/s, which is why the current firmware already waits an extra CPU clock on every single TT-RAM read and repeats the read command to hold the data longer. That cost about 15% on the ROM score in GB6 and I accepted that a while ago.
The problem is that adding the delay is not the hard part. Every one of those changes needs extra logic in the PLD, and that makes the fitter rearrange the whole chip. When it does that, it splits the SDRAM address logic into two passes, which slows the SDRAM side down by 2 to 4ns. The SDRAM side runs at 100MHz no matter how long the CPU waits, so making the CPU wait longer doesn't help when it is the SDRAM address and command timing that has been broken by the refit.
So each test ends up changing two things at once, the delay I wanted and the internal timing I didn't, and the result is worse. The one build that works well just happened to get a good fit.
This is why I keep going round in circles. I fix one thing and it breaks something else. It all seems to start happening once the 288XL gets to around 60% full. I had similar problems on the original 144XL, where ROM DTACK ended up with a massive 30ns delay! I can't fix anything because the goalposts keep shifting all the time.
I also agree reliability is more important than a few MB/s, which is why the current firmware already waits an extra CPU clock on every single TT-RAM read and repeats the read command to hold the data longer. That cost about 15% on the ROM score in GB6 and I accepted that a while ago.
The problem is that adding the delay is not the hard part. Every one of those changes needs extra logic in the PLD, and that makes the fitter rearrange the whole chip. When it does that, it splits the SDRAM address logic into two passes, which slows the SDRAM side down by 2 to 4ns. The SDRAM side runs at 100MHz no matter how long the CPU waits, so making the CPU wait longer doesn't help when it is the SDRAM address and command timing that has been broken by the refit.
So each test ends up changing two things at once, the delay I wanted and the internal timing I didn't, and the result is worse. The one build that works well just happened to get a good fit.
This is why I keep going round in circles. I fix one thing and it breaks something else. It all seems to start happening once the 288XL gets to around 60% full. I had similar problems on the original 144XL, where ROM DTACK ended up with a massive 30ns delay! I can't fix anything because the goalposts keep shifting all the time.
Re: REV 3 - REV 5 - The beginning (ST536)
The problem is that the SDRAM address logic is very large, and once the PLD gets reasonably full, the fitter splits it into two passes through the chip. That takes the internal SDRAM address timing from about 6ns to nearly 9ns of a 10ns clock, so the margin drops from about 4ns to about 1ns.
If I then adjust the SDRAM timing to suit that, I have changed the logic in the PLD again, so the fitter rearranges everything again and the timing I just adjusted for has moved. Today, adding just one extra register was enough to make it split the address logic, and the ROM copy to TT-RAM failed straight away. Before that, adding the IDE IRQ fix did the same thing to the SDRAM timing.
The only workaround I can see on this chip is running the SDRAM at 50MHz to give everything more margin, but that is not really where I want to go.
I did also consider a while ago using a second PLD just for the SDRAM, but that means a handful of control signals between the two PLDs, which sounds like a headache from start to end. I even started laying out a PCB for it last year, with the second PLD where the SDRAM buffers are now.
My suspicion is that the original TF536 code only worked because everything in it was optimised and timed just right. When I started adding the ST fixes, like the bus arbitration and the ROM decoding logic, I think that was simply enough to push the whole thing over the edge. Not because it wouldn't fit, but because the timing just kept shifting around every time.
This was very bad on the original 144XL. It was 100% full, and looking back it's a wonder it worked at all. It was all just a lottery on the timings at the end of the day. The 288XL gave me some breathing room, but even then I struggled to get a barebones setup stable.
Incidentally, I never got the TF536 stable with ST firmware either. @philc lent me his board, which he says works in his machines, but I ran into problems as soon as it was plugged in. That was the same thing I saw with the TF536 I built myself when I was working on the ST firmware.
I don't think there is anything particularly wrong with the hardware or the firmware. I think the PLDs are simply not suitable for this project on the ST.
Greg's board is also slightly different to mine. On his the SDRAM clock comes from the PLD, on mine it comes straight from the 100MHz oscillator, so the current firmware may not behave the same on his board. I am going to build up one of the later revision boards so I can test that myself.
I am also working on a small demo board for the Chinese FPGA. If it turns out better than the 288XL and I can fit all the I/O level converters on the ST536, it will save me a huge amount of trouble.
If I then adjust the SDRAM timing to suit that, I have changed the logic in the PLD again, so the fitter rearranges everything again and the timing I just adjusted for has moved. Today, adding just one extra register was enough to make it split the address logic, and the ROM copy to TT-RAM failed straight away. Before that, adding the IDE IRQ fix did the same thing to the SDRAM timing.
The only workaround I can see on this chip is running the SDRAM at 50MHz to give everything more margin, but that is not really where I want to go.
I did also consider a while ago using a second PLD just for the SDRAM, but that means a handful of control signals between the two PLDs, which sounds like a headache from start to end. I even started laying out a PCB for it last year, with the second PLD where the SDRAM buffers are now.
My suspicion is that the original TF536 code only worked because everything in it was optimised and timed just right. When I started adding the ST fixes, like the bus arbitration and the ROM decoding logic, I think that was simply enough to push the whole thing over the edge. Not because it wouldn't fit, but because the timing just kept shifting around every time.
This was very bad on the original 144XL. It was 100% full, and looking back it's a wonder it worked at all. It was all just a lottery on the timings at the end of the day. The 288XL gave me some breathing room, but even then I struggled to get a barebones setup stable.
Incidentally, I never got the TF536 stable with ST firmware either. @philc lent me his board, which he says works in his machines, but I ran into problems as soon as it was plugged in. That was the same thing I saw with the TF536 I built myself when I was working on the ST firmware.
I don't think there is anything particularly wrong with the hardware or the firmware. I think the PLDs are simply not suitable for this project on the ST.
Greg's board is also slightly different to mine. On his the SDRAM clock comes from the PLD, on mine it comes straight from the 100MHz oscillator, so the current firmware may not behave the same on his board. I am going to build up one of the later revision boards so I can test that myself.
I am also working on a small demo board for the Chinese FPGA. If it turns out better than the 288XL and I can fit all the I/O level converters on the ST536, it will save me a huge amount of trouble.
Re: REV 3 - REV 5 - The beginning (ST536)
I don't mean change the CMDREAD-to-STERM period. Unless the commands aren't meeting hold time requirement (see below), they need to be fixed from the point of view of the RAM chips. I mean delay the AS-to-CMDOPEN period. And everything afterwards obviously gets delayed too.exxos wrote: Mon Nov 16, 2026 9:04 pm I have already tried pretty much all of that. Today alone I tried STERM half a clock later, STERM half a clock later with an extra SDRAM read to hold the data longer, and inverting the SDRAM clock. All of them made things worse, not better.
If it's the address decoding that's the bottleneck, give *that* part some extra time then carry on as before. If it's not the decoding and it's the column and row address set-up-and-hold, then give *both* of them an extra cycle. You should have two READs per cycle anyway as it's 100MHz playing 50, so that's sufficient as is.
So say for example, AS kicks things off by bumping up to state 1, then state 3 is OPEN and state 5 and 6 is READ and state 8 and 9 is STERM; delay it to state 4 for open, state 6 and 7 for read and state 9 and 10 for STERM.
(probably not the actual numbers as I've not seen your state machine)
I understand, but I'm not talking about the CPU in isolation. I mean offsetting the state machine commands. STERM will follow a fixed time after those.The problem is that adding the delay is not the hard part. Every one of those changes needs extra logic in the PLD, and that makes the fitter rearrange the whole chip. When it does that, it splits the SDRAM address logic into two passes, which slows the SDRAM side down by 2 to 4ns. The SDRAM side runs at 100MHz no matter how long the CPU waits, so making the CPU wait longer doesn't help when it is the SDRAM address and command timing that has been broken by the refit.
Reductio ad absurdum: if each SDRAM command were 50 clock cycles apart with the MADD lines driven as soon as possible, would an extra few nanoseconds on the MADD lines make a difference? No.
So it follows there must be a a point where you can trade any kind of congestion for memory cycle speed.
OTOH, if the ADD/MADD combination is a red herring and it's the command setup/hold time that's a problem (the RAS and CAS lines are 10ns out of sync, for example), then there's less wiggle room and that's where playing with the clock edges might help or you may need to delve into the pin-to-pin timing constraints in ISE to give it a hint on what to prioritise.
100MHz is a tough ask on a CPLD (& why I've capped out at 66MHz), but unless you're really hitting problems with the command lines, there's usually a trade off available.
BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Re: REV 3 - REV 5 - The beginning (ST536)
I think our posts crossed, so you may not have seen my last one yet.
The address decoding is already registered. The RAM decode and the row hit compare are both registered on the 100MHz clock before the state machine uses them, so the decoding already gets a full clock to itself.
If you mean making the state machine slower, that is the problem and solution battle I have been fighting all along. Every time I change something, other stuff changes with it. I fix one thing and something else breaks. It is not really about speed, it is about product terms. Every time I have added logic recently, it has made things worse. The build that works now only works because I took some logic out.
I have also tried tightening the timing constraints in ISE, and it did not steer the fitter to a better result.
The address decoding is already registered. The RAM decode and the row hit compare are both registered on the 100MHz clock before the state machine uses them, so the decoding already gets a full clock to itself.
If you mean making the state machine slower, that is the problem and solution battle I have been fighting all along. Every time I change something, other stuff changes with it. I fix one thing and something else breaks. It is not really about speed, it is about product terms. Every time I have added logic recently, it has made things worse. The build that works now only works because I took some logic out.
I have also tried tightening the timing constraints in ISE, and it did not steer the fitter to a better result.
Re: REV 3 - REV 5 - The beginning (ST536)
Yeah, sorry.exxos wrote: Mon Nov 16, 2026 10:22 pm I think our posts crossed, so you may not have seen my last one yet.
I'm not sure just being registered is enough, but the key question is whether it makes any odds that some of the logic around those address lines has to route through a second function block. If your registering logic means it doesn't, great.The address decoding is already registered. The RAM decode and the row hit compare are both registered on the 100MHz clock before the state machine uses them, so the decoding already gets a full clock to itself.
So then what's missing its set-up-and-hold? Options that I can see are the address *output* (I called them MADD) lines or the command lines (RAS, CAS, DQM, WE, etc.)
The former can be fixed by adding cycles to the state machine. The latter is the only really thorny one, but I thought you'd identified it as the address side?
I agree with the cause: too much extra stuff from the original design. But I don't think it's necessarily not saveable. At the expense of memory speed.If you mean making the state machine slower, that is the problem and solution battle I have been fighting all along. Every time I change something, other stuff changes with it. I fix one thing and something else breaks. It is not really about speed, it is about product terms. Every time I have added logic recently, it has made things worse. The build that works now only works because I took some logic out.
I have also tried tightening the timing constraints in ISE, and it did not steer the fitter to a better result.
I think at this point I would set everything to area optimisation. Let it route things through as many function blocks as it wants and measure the RAS, CAS, WE etc. lines. See if you really have a problem there or not.
If not, ie. their transitions are all well away from the positive RAMCLK edge, great. You can work with it. If they're staggered by more than 6 or 7ns, then you may need to resynchronise those too (another cycle delay).
BTW, yes, you'll have a hell of a job getting a firmware built for a direct-from-osc RAMCLK to work with a RAMCLK-from-CPLD board. Again, only 66MHz, but I went through that same transition on DSTB1 when I developed rev2. I found having the OSC go direct to the RAM and the CPLD responding to it was far more reliable.
BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Re: REV 3 - REV 5 - The beginning (ST536)
No problem.
To be honest I don't know for certain which one is missing it. The fit reports show the SDRAM address and command lines switching at the same time in the builds that fail and the builds that work, so the outputs themselves don't seem to move. What does change is the logic feeding the SDRAM address registers inside the chip, which gets slower when it is split across function blocks. So far it is just a pattern I keep seeing, split address logic and the build fails, rather than something I have proven.
I have never tried area optimisation, every build has been set to speed. I can try the current working source with area optimisation and see what happens, as it needs no code changes.
Interesting about DFB1 rev2, that matches what I have seen over the years. Going back through my notes, I have switched the SDRAM clock between PLD driven, inverted and hardwired from the oscillator at least six times since 2021. Back in December 2025 hardwiring it from the oscillator ran GB6 fine. With the PLD driving the clock, every refit moves which of the command and address lines lands right on the clock edge, so it is a lottery again. A clock straight from the oscillator at least stays put. Both my boards have it direct from the oscillator and Greg's has it from the CPLD, so I think that is likely why firmware that works on mine doesn't behave the same on his.
The current build is running GB6 overnight again. I have heated the board up and had freezer spray on the whole thing and it kept running. If something is borderline it generally crashes within a couple of seconds of doing that.
The problem is I have been down this road many times before. A build passes everything on one board, then it doesn't work on another board, or a second build of the same board doesn't work. Back in January the same firmware ran 57 passes of GB6 on one of my 5.62 boards and locked up after 2 to 5 passes on the other. Just this week one build reset within a couple of loops on one board and ran 7 passes on the other, and the same logic in a different fit ran clean where the first fit failed. So passing here doesn't prove much on its own until it has been tried on other boards.
There are just too many moving parts to make an accurate diagnosis. If the PLD timings stayed put it would be a huge help. At the moment I am trying to diagnose problems while one of the main problems is the timing of the signals in the PLD changing every time I rebuild it.
But that is the circle again. I can have a board working here running for days constantly, then someone else tries it and it doesn't even try to boot. That is why I added 33R series resistors on the bus signals, to reduce the ground bounce between the ST536 and the ST, as it looked like that was causing some of the issues. I am seeing bad bounce on AS on my board without the resistors. So the current board spin covers everything I can think of hardware wise.
Greg has been doing lots of tests. His board mostly seems stable until the IDE drive is plugged in. On his board TOS 2.06 also reboots on floppy access, but EmuTOS works fine, so there are still things going on that I can't explain yet.
One more thing I should have mentioned. I have also been battling bad vias from JLC over the years, and boards that slowly got worse over a few weeks until a via or track failed. That has likely confused things immensely, as some of the faults I was chasing in the firmware were probably the board itself.
To be honest I don't know for certain which one is missing it. The fit reports show the SDRAM address and command lines switching at the same time in the builds that fail and the builds that work, so the outputs themselves don't seem to move. What does change is the logic feeding the SDRAM address registers inside the chip, which gets slower when it is split across function blocks. So far it is just a pattern I keep seeing, split address logic and the build fails, rather than something I have proven.
I have never tried area optimisation, every build has been set to speed. I can try the current working source with area optimisation and see what happens, as it needs no code changes.
Interesting about DFB1 rev2, that matches what I have seen over the years. Going back through my notes, I have switched the SDRAM clock between PLD driven, inverted and hardwired from the oscillator at least six times since 2021. Back in December 2025 hardwiring it from the oscillator ran GB6 fine. With the PLD driving the clock, every refit moves which of the command and address lines lands right on the clock edge, so it is a lottery again. A clock straight from the oscillator at least stays put. Both my boards have it direct from the oscillator and Greg's has it from the CPLD, so I think that is likely why firmware that works on mine doesn't behave the same on his.
The current build is running GB6 overnight again. I have heated the board up and had freezer spray on the whole thing and it kept running. If something is borderline it generally crashes within a couple of seconds of doing that.
The problem is I have been down this road many times before. A build passes everything on one board, then it doesn't work on another board, or a second build of the same board doesn't work. Back in January the same firmware ran 57 passes of GB6 on one of my 5.62 boards and locked up after 2 to 5 passes on the other. Just this week one build reset within a couple of loops on one board and ran 7 passes on the other, and the same logic in a different fit ran clean where the first fit failed. So passing here doesn't prove much on its own until it has been tried on other boards.
There are just too many moving parts to make an accurate diagnosis. If the PLD timings stayed put it would be a huge help. At the moment I am trying to diagnose problems while one of the main problems is the timing of the signals in the PLD changing every time I rebuild it.
But that is the circle again. I can have a board working here running for days constantly, then someone else tries it and it doesn't even try to boot. That is why I added 33R series resistors on the bus signals, to reduce the ground bounce between the ST536 and the ST, as it looked like that was causing some of the issues. I am seeing bad bounce on AS on my board without the resistors. So the current board spin covers everything I can think of hardware wise.
Greg has been doing lots of tests. His board mostly seems stable until the IDE drive is plugged in. On his board TOS 2.06 also reboots on floppy access, but EmuTOS works fine, so there are still things going on that I can't explain yet.
One more thing I should have mentioned. I have also been battling bad vias from JLC over the years, and boards that slowly got worse over a few weeks until a via or track failed. That has likely confused things immensely, as some of the faults I was chasing in the firmware were probably the board itself.
Re: REV 3 - REV 5 - The beginning (ST536)
DSTB1r2, I should clarify. That runs at 66MHz versus DFB1's 50. But it also uses the CKE line judiciously to freeze the output and allow DTACK to work reliably as th 68k doesn't have an STERM-based synchronous system. Moving the clock out of the CPLD really helped get it all working.exxos wrote: Mon Nov 16, 2026 11:19 pm Interesting about DFB1 rev2, that matches what I have seen over the years.
That's the one thing you can guarantee will change!If the PLD timings stayed put it would be a huge help.
If push comes to shove, that might be the thing I suggest you drop first if necessary.Greg has been doing lots of tests. His board mostly seems stable until the IDE drive is plugged in.
The ST range is nice in that it actually has hard disc provision and it's well catered for, albeit slower. But I've never really noticed the difference between 1MB/s and 2 [or whatever]. The IDE is really only a nice-to-have on our systems. Much more significant an advantage for the A500.
BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Re: REV 3 - REV 5 - The beginning (ST536)
I tried the current working source with the fitter set to density, no code changes. It booted, but the IDE drive test screen didn't scroll properly, and then it reset after a few tests in GB6.
Going by the fit report, the SDRAM address logic actually stayed in one block this time, but the SDRAM state machine itself got slower instead, even though it was all still within the clock period on paper. So it is not just the address split that breaks it. Pretty much anything on the SDRAM side getting a bit slower seems to tip it over.
I have put the working build back on, and even that reset on the way to the desktop on the first boot, so I am powering it off and trying again.

Going by the fit report, the SDRAM address logic actually stayed in one block this time, but the SDRAM state machine itself got slower instead, even though it was all still within the clock period on paper. So it is not just the address split that breaks it. Pretty much anything on the SDRAM side getting a bit slower seems to tip it over.
I have put the working build back on, and even that reset on the way to the desktop on the first boot, so I am powering it off and trying again.
Exactly, and that is the whole problem. I am trying to find faults while the timing underneath keeps moving every time I rebuild.Badwolf wrote:That's the one thing you can guarantee will change!
The IDE is a good example of the problem. The IDE IRQ fix was most likely latching the MFP register too early, so it was reading the wrong byte. I changed it to latch later, which fixed that in simulation, but then it screwed up the SDRAM timings again.Badwolf wrote:If push comes to shove, that might be the thing I suggest you drop first if necessary.

