ijor wrote: 30 Jul 2024 06:07
That's not what I meant. Measure write timing can of course be useful. But what I meant is that you should analyze the ST timing. More precisely what timing the ST requires for writing to RAM. This is "your" timing.
Oh, I see what you mean. Yes, that makes sense: probe the actual DRAM write cycle timings.
... suggests something to do with the start or end of the bus arb section to me):
It is possible that it is related to the bus arbitration, but not necessarily. Initially I assumed it might had to do with hold time. But now I suspect more that the main issue is what I mentioned above, that you are latching too soon. Blitter's internal timing is slightly different at the last (and first) words.
Oh, that's interesting. Thanks. I'll try to look at start, end and middle cases, then.
It isn't really obvious, certainly not in this case that the relation between both clocks is not fully synchronous. But it isn't rocket science either. You just add all the delays that are involved since a signal is launched until it arrives at its destination. Then when you get your best and worst case arrival time, you check if it meets the expected hold and setup requirements.
It's hard to explain what I mean when I still don't know what I don't know. IYSWIM.
I may be able to follow the logical steps between various things happening and the resultant output, but I'd not know how to estimate the logic delay for each of them (I don't know if it's safe to just say '20ns!' for each internal logic step [it's a 10ns chip, but what if the signal has to cross function blocks -- I don't even know how to tell]).
I'm also not sure what I'm measuring from yet. Like you say, my initial assumption that DS meant data would be ready by the time by (slow) state machine got there doesn't look to be valid for the blitter.
Anyway, it seems to me I've got to understand what I'm aiming at before I can work out if I'm hitting it yet.
That's a fair point. This is quite a new approach for me and I don't have the 10ns resolution of Stephen's original.
Well, again, I think that's crucial information. And again, measuring is not the right approach, at least not measuring alone, because measuring applies to your specific case. You need something theoretic that would apply to everybody.
They are, of course, separate things -- there is (currently) no 8MHz clock dependency on the SDRAM controller which is trying to emulate a (slow) SRAM interface -- but yes I was nervious about the jitter associated with this technique, but then consoled myself with it working quite extensively on the early TF boards*, albeit with a 5ns better resolution.
But there's no doubt this is still a little experimental in my mind. If everything were perfect you'd expect the skew to vary from around +8 to -8ns. But across different CPLDs, with different initial clock phases, or as things heat up I could imagine that shifting to being non-symmetrical quite easily.
Still, many thanks for your help, Ijor. I've certainly got some things to work on.
(I wasn't planning to support blitter access to SDRAM, but got on a roll and chucked my hat into the ring -- I knew it'd be a mistake!)
BW
* TF may have implemented a better algorithm in the 536 boards -- they're not open source.