Not sure if this is the right forum, but I'm hoping someone can help me here. Perhaps an issue I take forward to the next virtual meet. I'll try and keep this post short, but provide enough detail to explain the issue.
I've run into a problem trying to move the discrete logic components from my IntegraB ROM / RAM board into a Xilinx XC95144 CPLD implementation. I've spent the last few nights trying to identify what's going wrong, but I'm not making much progress.
The problem I'm having is with Shadow RAM switching. Shadow RAM is enabled by latching bit 7 of the databus when the address bus is set between &FE34 and &FE37. This latched bit is referred to as 'ShEn'. Typing ?&FE34=128 should switch in Shadow RAM. The code for doing this is as follows:
Code: Select all
// Latch data bus (Shadow / Private RAM selection status) when address is in range &FE34..&FE37 assign nFE3x = !(bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & !bbc_ADDRESS & !bbc_ADDRESS & !bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS); assign nFE34_7 = !(!nFE3x & !bbc_ADDRESS & bbc_ADDRESS & !RnW & dPhi2); // &FE34..&FE37 // Data Latch dff_asyncres ShEnLogic( .D(bbc_DATA), .CLK(nFE34_7), .nCLR(bbc_nRST), .Q(ShEn) );
There is logic to define when ShadowRAM is active. It's basically just decoding addresses between &3000 and &7FFF and checking that Shadow RAM is enabled. This is then used to determine if the system needs to write to main RAM on the beeb board or to shadow RAM on the IntegraB board. The code is as follows (ignore !MemSel. I've forced that to logic 1 for now):
Code: Select all
assign nShAct = !(!bbc_ADDRESS & !bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & ShEn & !MemSel //address decodes to &3000..&3FFF | !bbc_ADDRESS & bbc_ADDRESS & !bbc_ADDRESS & !bbc_ADDRESS & ShEn & !MemSel //address decodes to &4000..&4FFF | !bbc_ADDRESS & bbc_ADDRESS & !bbc_ADDRESS & bbc_ADDRESS & ShEn & !MemSel //address decodes to &5000..&5FFF | !bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & !bbc_ADDRESS & ShEn & !MemSel //address decodes to &6000..&6FFF | !bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & bbc_ADDRESS & ShEn & !MemSel);//address decodes to &7000..&7FFF
Code: Select all
assign to_bbc_Phi1 = !(!from_CPU_Phi1 & nShAct); assign to_bbc_RnW = !(!from_CPU_RnW & nShAct);
What happens, is that if I type ?&FE34=128, ShEn latches at logic 1, the beeb switches to shadow mode, and any further typing is not visible on the screen. The cursor moves as I type and blindly typing VDU7 generates a beep, so I'm happy the beeb is still running. This matches what happens on my working IntegraB boards. However, if I then blind type ?&FE34=0 the beeb should switch out of shadow mode and further typing should be visible. Unfortunately, this does not happen if I'm in any mode other than 0, 1 or 2 (all of which start at address &3000). ShEn remains at logic 1 and the system stubbornly stays in Shadow mode until I switch to modes 0, 1 or 2 and then repeat the command ?&FE34=0, at which point ShEn switches to logic 0 and the system switches back to Main memory.
I can obviously provide a lot more information, but just wanted to get the basics out there initially. I suspect a subtle timing issue, but I've got very limited spare I/O that I can hook a scope up to, and everything's surface mounted making it difficult to connect scope probes, and type stuff on the beeb at the same time!