exxos wrote: 31 Jan 2019 17:59
ijor wrote: 31 Jan 2019 17:43
You misunderstood (or may be I didn't explain it correctly). The problem on a sound chip access is not DTACK assertion, but DTACK
DEassertion. The same logic in GLUE that delays DTACK assertion when accessing the sound chip, it delays DTACK deassertion as well. So in this case, when a very fast CPU accesses the sound chip, it might definitely happen what you thought that the CPU would see this DTACK still active on the next bus cycle.
I'm talking of both sides of DTACK. I know its very slow in the rise time, but DTACK doesn't deassert until S2, when the CPU is just starting to assert /AS again. Its not that slow on any other DTACK cycles other than ROM. Pretty much DTACK goes high just a new ns after /AS, in all cases but ROM access.
??? Seem we have some big misunderstanding here. That paragraph you quoted me is *
NOT* about ROM cycles, but about sound chips cycles. Let me start from the beginning to be sure we understand each other.
You claim that GLUE deasserts DTACK on ROM access too close to S2. And that in such a case, and because your CPU is running faster, the CPU might still detect DTACK being low at the next bus cycle, and then it might terminate the next cycle too early.
You also said that to avoid this problem, when you decode a ROM access, you don't let GLUE to see AS and instead you handle DTACK by yourself. Lastly, if I understood you correctly, you said that
you are not decoding I/O and you are hiding AS on a
ROM access only.
I say that I don't see GLUE being that slow when accessing ROM. But I do see that GLUE does delay DTACK a couple of cycles when accessing the
sound chip both at assert and at release time!
That is the reason I stop GLUE seeing /AS for ROM cycles as its DTACK take forever to release. Though maybe GLUE is doing that with other cycles which I haven't taken into account.
The scenario is CPU accesses a SND register, GLUE issues DTACK, CPU completes cycle, starts a new cycle, GLUE still has DTACK low from previous cycle and CPU re-reads that DTACK. Eventually the CPU does something else, maybe access RAM, but if GLUE keeps DTACK low, the CPU may read the last SND DTACK access and complete the RAM cycle to early causing corruption.
Exactly that! Yes, it is very likely that something like this will happen when accessing the sound chip. And it might be just a coincidence, but you say that EmuTOS crashes precisely when accessing the sound chip!
I can't find any screenshots of this, but this work is going back 4 or 5 years now.. When I get a stock machine connected again I will take get a capture.
I attached a capture screenshot on a ROM access cycle. I don't have a 4-channel scope, so I used a MSO to see all the relevant signals together. Not being a true scope, especially the analog channel is not very precise. But I think there is not much doubt that GLUE releases DTACK quite early some when around the second half of S7. This was taken on a Ricoh GLUE -38A. The behavior matches the logic that I see on the -38 GLUE chip I decapped.
You do not have the required permissions to view the files attached to this post.