6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 3:49 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Sep 24, 2021 8:04 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1405
Location: Scotland
BigEd wrote:
J64C wrote:
I was trying to get my head around the significance VDA and VPA.
What's and example where you'd need to check the state of these pins?


J64C, it's worth noting that BDD takes a particularly conservative line in his designs, and in his corresponding advice. Others do otherwise, and if their code and designs avoid certain rare circumstances, all is well. As BDD got burnt by one of these rare circumstances, he is very cautious.


Agreed. It is good to be conservative, but my Ruby 816 board has 512KB of RAM and runs without a data-bus buffer at 16Mhz without wait states on a double sided PCB. There is just one peripheral though and that's a 65C22. I do use a GAL for the upper 8-bit address latch (which doubles as a 3-input OR gate for IRQ handling) and another GAL for address decoding to handle 2 chip selects so I can have 2 x 512KB RAMs and the VIA.

Current uptime is just over 28 days and it runs a multi-tasking operating system written in BCPL which runs inside a bytecode VM which is interpreted by some 16KB of '816 assembler plus another 10KB of assembler for the underlying machine operating system.

It dos this sort of thing: https://www.youtube.com/watch?v=ZL1VI8ezgYc

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 25, 2021 12:11 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8177
Location: Midwestern USA
drogon wrote:
It is good to be conservative, but my Ruby 816 board has 512KB of RAM and runs without a data-bus buffer at 16Mhz without wait states on a double sided PCB. There is just one peripheral though and that's a 65C22.

As you describe it, there is nothing that would require a wait-state. WDC tests all production parts at 20 MHz and extrapolating from what others have achieved with overclocking the 65C02 and 65C816, it wouldn't surprise me at all to see a 65C22 running above 20 MHz.

All my designs run their firmware in ROM, plus have hardware that can't stay with the 65C816 at higher speeds (~14 MHz for the DUART and 12.5 MHz for the RTC and ROM). Wait-stating is unavoidable if I want to turn up the clock.

Dr Jefyll wrote:
Unfortunately, the OR gate used to bring VPA into the picture not only adds complexity to the logic but its prop. delay of about 5 ns probably has a direct impact on the maximum achievable clock speed. If you're running at 20 MHz then a 5 ns slowdown is 10%.

I fail to see any complexity in an OR gate (it's just a gate, not a microprocessor :D) and at least in POC V1.2, the timing impact of a 5ns prop delay has no discernible effect on performance. In any case, an OR is needed in the address decoding sections that result in ROM and I/O chip selects being generated, so the chip with the OR gates has to be in the circuit anyhow.

The guiding philosophy in all my designs is one of having no more than two gates between the address bus and a chip select. V1.2 aligns with that philosophy and runs at 20 MHz with complete stability. According to the logic analyzer, there is left-over timing headroom, so the prop time of the VDA || VPA gate is not getting in the way of performance.

In a PLD, the internal prop time for simple combinatorial logic, such as an OR gate, is a fraction of the rated pin-to-pin time, since no feedback is involved. Hence the "penalty" of including VPA in the logic is negligible. It merely costs one input pin.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Sep 25, 2021 3:02 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
BDD I don't recall you ever hinting that there might be more than one Right Way to deal with VPA and VDA. It seems every comment you make supports the conclusion that your way of doing things (ORing VPA with VDA) is the only correct way, and that unwary experimenters who ignore your prescription do so at their own peril.

Myself, I prefer to look at all available alternatives and weigh them in light of prevailing circumstances and priorities. Please admit that, while your solution suits your circumstances and priorities, it's possible (or even probable) that others may do better with an alternative.

And alternatives do exist. The list of possible tradeoffs is long :shock: but let me mention just a few. Then I'll shut up and concentrate on enjoying the weekend! :)

BigDumbDinosaur wrote:
When VDA && VPA = 0 it is possible bogus ROM or I/O addresses might appear on A0-A23 and result in [an unnecessary] wait-state
I agree that unnecessary wait-states are a valid concern... if the goal is to maximize performance while running code from wait-stated ROM. But ROM will still be pretty slow even after the unnecessary wait states are eliminated, so not everyone will be attracted to this partial remedy. A more powerful solution is to use use ROM merely for initializing RAM at bootup. (Or, a microcontroller can also accomplish this.) Then during normal operation only RAM is accessed, and all memory wait states become unnecessary.

BigDumbDinosaur wrote:
In any case, an OR is needed in the address decoding sections that result in ROM and I/O chip selects being generated
Yes and no.

If you're using a circuit more or less like that in the upper part of this image then yes, the OR gate is required. I've shown 138's, but the same idea applies using other decoders, or programmable logic. The salient aspect is that the qualifying signal gets injected at a point where both I/O and memory are affected. Memory devices may contain code, and therefore they must be allowed to be active anytime VPA or VDA is high. The OR gate ensures that this is the case.
Attachment:
VDA injection points.png
VDA injection points.png [ 15.6 KiB | Viewed 412 times ]
However, no OR gate is required for the circuit in the lower part of the image because the qualifying signal gets injected further downstream at a point where only I/O is affected. I/O devices don't contain code, and it's sufficient that they merely be allowed to be active when VDA is high. This means VPA can be ignored and the OR gate omitted, resulting in simpler, faster logic. The difference may not be enough to sway you, and it's alright if you don't do it this way. But every decision is a tradeoff, and for other folks the various factors may evaluate to a different outcome. Both circuits protect the I/O devices from spurious access during dead cycles.

I hope it's clear that I'm not saying that the upper circuit is wrong, or that wait-stated ROM is wrong; only saying that the tradeoffs will vary from one situation to the next. For example, I don't deny that using VPA on your POC only tied up one pin on the CPLD. But someone in a different situation may need that pin for something else, or perhaps may not be using programmable logic at all. Your circumstances and priorities don't necessarily match those of other builders.

Finally, here's a circuit variation that injects the qualifying signal even further downstream -- ie, at the I/O device itself! This is a zero-cost alternative for cases when you're using 65xx I/O chips and you're not otherwise using the active-high chip selects.
Attachment:
VDA injection point for 65xx I-O.png
VDA injection point for 65xx I-O.png [ 6.5 KiB | Viewed 410 times ]


-- Jeff
[Edits]

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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

Search for:
Jump to: