Re: Interested in developing a simple DMA controller
Posted: Wed Mar 08, 2023 9:42 pm
Just a correction, I meant writing DMA contoller registers in the $9F60-$9FFF range.
Commander X16 Community Forums
https://cx16forum.com/forum/
I think Dacobi has the concept; when you write to the VERA address range, VERA handles it.StephenHorn wrote: ↑Wed Mar 08, 2023 9:20 pm My plan, at least, was not to add DMA to the VERA itself -- the VERA is well too complicated for my nascent understanding of Verilog. And if RDY doesn't allow another device to use the bus (such as the CPU leaving its address/data lines set based on whatever it was last doing), then my plan is toast anyways.
How does it work with the cartridge design and different expansion slots?It seems like the alternative that makes the address range configurable would be to rely on more pins that are permanently tied high or low (either with traces or DIP switches), to select the appropriate address range the controller should respond to.
It doesn't matter which slot you're using; all 4 slots have access to IO3-IO7, which is why you need DIP switches or jumpers. Cards can't be allowed to just pick an I/O range, or we will end up with conflicts where two different cards pick the same I/O block.Dacobi wrote: ↑Wed Mar 08, 2023 11:50 pm How does it work with the cartridge design and different expansion slots?
Just so I understand. The board will assert a IO3-7 Select line depending on which IO range is being written to. So you're taking about a way to tell Verilog which slot the module is occupying?
The way I understand it Chip select would only be asserted when the DIP switches are set to match the correct IO select line?This has nothing to do with Verilog. This is just a hardware switch. In the case of a DIP switch, you have five on/off switches with IO3-IO7 connected to the input side of the switch. The outputs are all tied together and go to the Chip Select for the chip(s) on the card.
I don't know why there is an extra IO select line. It's possible the answer is "because there was a memory range leftover, so why not?"Dacobi wrote: ↑Thu Mar 09, 2023 9:45 amThe way I understand it Chip select would only be asserted when the DIP switches are set to match the correct IO select line?This has nothing to do with Verilog. This is just a hardware switch. In the case of a DIP switch, you have five on/off switches with IO3-IO7 connected to the input side of the switch. The outputs are all tied together and go to the Chip Select for the chip(s) on the card.
What I meant was that the DIP switches could then tell the FPGA which IO range to use?
(Edit) If you had 4 traces going to 4 different pins on the FPGA, beside the combined outputs going to Chip select.
By the way, why are there 5 IO select lines but only 4 expansion slots?
From what I've seen of the cartridge design it doesn't have any DIP switches?
The FPGA doesn't know or care about the full 16-bit address. Remember how binary addressing works; the card only decodes the lower 5 bites on the address bus. The upper 11 bits don't matter, because IO3-IO7 guarantees that the address is already in a specific range.Dacobi wrote: ↑Thu Mar 09, 2023 9:45 am The way I understand it Chip select would only be asserted when the DIP switches are set to match the correct IO select line?
What I meant was that the DIP switches could then tell the FPGA which IO range to use?
(Edit) If you had 4 traces going to 4 different pins on the FPGA, beside the combined outputs going to Chip select.
Because there were 5 I/O blocks free. I/O block ranges are limited to powers of 2, and VERA only had 5 address lines, so it was a simple choice to make the standard I/O block 32 bytes wide.By the way, why are there 5 IO select lines but only 4 expansion slots?
That makes sense, but then I don't understand what StephenHorn meant by this?The FPGA doesn't know or care about the full 16-bit address. Remember how binary addressing works; the card only decodes the lower 5 bites on the address bus. The upper 11 bits don't matter, because IO3-IO7 guarantees that the address is already in a specific range.
As for how to go about assigning a specific address range, I'm sure that could be done easily enough in Verilog, but it would probably be ideal to rely on external logic to select the DMA controller for the appropriate range of addresses and assert a pin. A problem for someone else, or for me whenever I would get around to testing it. Which is why, way back on the first post, I was thinking it would need a "chip enable" pin, or equivalent, to indicate when it's been selected.
It seems like the alternative that makes the address range configurable would be to rely on more pins that are permanently tied high or low (either with traces or DIP switches), to select the appropriate address range the controller should respond to.