Replies: 12 comments 31 replies
-
No, the only thing which should prevent you from seeing RAM below $8000 is if you enter Ultimax mode ( A DMA cycle from the cartridge is seeing the same memory map as the 6510 does (with the exception of the internal registers mapped to $0000 and $0001), because they happen during Phi2 cycles when Here's a nice document about exactly how the address decoding is performed in the C64, if you are interrested: http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/c64/C64_PLA_Dissected.pdf So, my random guess would rather be that the RiscV core is aborting the memory access because it's taking too long or something. The cartridge will only start a DMA cycle when it considers it safe. This means either after a bad line, or after the 6510 writes to the bus. So if Elite blanks the screen and only does reads for a while, I guess something could timeout? |
Beta Was this translation helpful? Give feedback.
-
Hi, here the code so far: Still things like circles / sun aren't properly drawn as they are not properly deleted - but already 'nicer' as the original as a real circle is drawn (instead of a approximation with 64 lines). Not (yet) noticably 'faster' lines... maybe I find more algos in the code to be replaced by a co-proc version. have fun, pottendo |
Beta Was this translation helpful? Give feedback.
-
Hi, This looks great! Indeed that will improve the coproc.So far I need to peek into the i/o area on the c64 side to enable faster RAM access from the RiscV side. If I do busy waiting on the shared RAM address without some.dummy reading i/o, it's damn slow writing into the c64 mem.In the particular case of Elite this means switching on/off I/O via $01 on every busy wait cycle. Just the mapping into c64 addresses needs to be changed in my use case to avoid banking. Ideally I'd like to use zero page addresses e.g. $e0 onwards.But that's a detail, probably solvable and specific to elite (where $e0.. is unused)I wonder if my Zephyr port automatically supports the interrupts you've implemented. Stay tuned...Which interrupt vector is to be used on the c64 side to implement an ISR?Good to see that you're still improving the OC! Much appreciated!I may open another discussion to share my ideas (simple things I think).Happy hacking, pottendo Am 10.09.2023 17:36 schrieb Marcus Comstedt ***@***.***>:
Nice!
BTW, you may want to check out the new "mailbox" function I just added. I think it could be useful for you because it lets the RISC-V poll a shared area as often as it likes without causing a DMA cycle, so no need for "usleep" if you use it. 😸
***@***.***
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, However, now I'm again at the point where my version of the bitstream (with FPU) won't fire interrupts in Zephyr. I found that already some months ago, when trying to get the UARTs working interrupt driven. I stopped back then, as I was stuck. UARTS are working but not interrupt driven. Zephyr seems to support that in its litex drivers. Howevr, this is not good in general - I should find the cause for the non-working interrupts in the vexriscv_smp CPU. |
Beta Was this translation helpful? Give feedback.
-
Hi, ...and I thought I understand what I'm doing: I have a simple testprog, which writes the 32 bytes starting at $dec0 on the c64 side and then triggers an interrupt by writing 4 bytes starting at $defc. however, on the vexriscv_smp CPU i get this: what the hell is going on? Any idea? |
Beta Was this translation helpful? Give feedback.
-
Hmm, where shall Iook?https://github.com/pottendo/RVCop64-pottendo/tree/wip-mailbox/hwAm 13.09.2023 21:23 schrieb Marcus Comstedt ***@***.***>:
Hm, looks like the lowest bit of the 32-bit address is getting lost - you are reading the lowest 32-bit word correct but then you are getting the same word again, and after that you are back on the right place again. Maybe the SMP core does 64-bit burst reads (i.e. a burst of two 32-bit reads) and that messes up my wishbone timing somehow? Can you check if 0xe0000000 is in a cached or uncached region on vexriscv_smp? (A byte read should not cause 64 bits to be read unless the core is trying to fill up a data cache line...)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Right. That does confirm that the behaviour is triggered by the dcache. However, changing the cache line size is not the correct solution, even if it has been allowed by the FPU. Basically there are two ways to go:
|
Beta Was this translation helpful? Give feedback.
-
Hi @zeldin, for now I gave up on the issue with the 64bit dcache for vexriscv_smp and use the stock RVCop64 *) to avoid unnessary differences. Here some observations on the mailbox feature:
according to your doc, it should be sufficien to read $defb, right? without the As you see above, I've also introduced a busy-wait variable
thanks, pottendo Code repo:
I use WIC64 kernal and a WIC64 - this allows very quick compile/assemble/test cycles. |
Beta Was this translation helpful? Give feedback.
-
hi, When I remove the access to the mailbox and just paint into the memory from both sides, all runs stable - even into the same memory region. So the principle RAM access from the RVCop64 works without making the C64 unhappy. Even if the access is likely to collide on the very same memory address. I've changed the 'protocoll' as suggested to poll It further seems that if the RVCop side does a lengthy operation, involving heavy memory access (e.g. drawing a filled circle) and an interrupt asynchronously comes in, this slows down this lengthy operation substantially. Anyway - I'll have a look once you've finished your work on the mailbox. But maybe you have an idea, what could cause the problem? It seems to be a race condition where memory access and interrupt handling on the OC is involved. bye, pottendo |
Beta Was this translation helpful? Give feedback.
-
hi,
Find attached the testprogram for the C64 - maybe you have some raw-testprogram on the RVCop64, handling the interrupt somehow. bye, pottendo |
Beta Was this translation helpful? Give feedback.
-
Regarding your issues with the mailbox on vexriscv_smp, I can't really test that since vexriscv_smp seems to requires sbt 1.x, and I fail to build sbt 1.7 (I do have 0.13.18 installed) on ppc64 because of some JNA nonsense... |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
hi,
long time since I've played with the Orangecart and in particular with the RVCop64.
I've written a few gfx-coproc routines for the OC (on my Zephyr port *) to support the C64 with fast line- or circle drawing directly into the main RAM memory.
In my test-programs this works pretty well (e.g. large filled circles draw in <15 milliseconds).
My use-case would be to replace 'Elite's' drawing routines - as this superior C64 game would benefit from such an accelerator
(at least I assume).
Elite has been reverse engineered and build/runs flawlessly on my real C64 - see Elite Harmless
I've already found the code to replace and here my question:
Elite plays a lot with mem-cfgs ($01 register) as it's pretty memory hungry. So basically all the time all ROMs and I/Os are disabled and only occasionally ROMS or I/O is switched on, when needed.
What I see now is:
before Elite starts and initializes, my busy wait routine on the OC sees the following, reading the shared memory handover register (ctr_reg):
as soon Elite initializes, the same address shows:
The address 0x04d0 isn't used by elite - I've double checked with another address in 0xc000 area - here the same change to ff/ff/...
As debugging Elite on a real C64 without some expansion cartridge is not easy, I'm stuck.
So, can there be an easy explanation that if $01 disables the ROMs that, as a consequence, the RVCop64 won't see the respective RAM?
The RAM accessed is neither below any ROM or I/O space (0x04d0), so I thought, I'd be OK with this approach.
The code uses the cache disabling instruction you've told me some months ago.
*) I needed to map the C64 memory in my RVCop64 incarnation to 0x0f00000 - not 0x00000000 as in the original, in order to support booting Linux alternatively.
thanks for any feedback, pottendo
PS: I'll share the code soon - need to fix the build properly for recent Zephyr release,
Beta Was this translation helpful? Give feedback.
All reactions