Writting on IDEM directly from HW layer #271
-
Hello, I need to ask for your help. I’m currently using the neorv32 on a DE0 nano for a project. I need to scope a bus and detect a specific message with the hardware layer and when detected, store the data on the RAM so I can access it with the software layer. My problem is that I can't write on the RAM from the hardware layer. I kept the same configuration (@X8000 0000 for the idmem) but I can’t figure out how to write on a specific adress of the idmem directly from the hardware layer. I tried to change the idmem process in a way so I can trigger a write command to a specific address but it didn’t work well. I also tried to use the IP’s but again, i’m not sure if it is possible to have a direct access to the idmem from the hardware layer (I saw on the documentation that the internal memories could not be accessed directly but is it the case if I use the avalon bus to access the memory?). Other thing : I spotted on the documentation and in a forum that I should use an external memory and use the wishbone protocol to write on the memory but is it really necessary? Do I have any other option to do it without using an external memory? I think that the best and easiest way would be to use the IP’s and the avalon bus from the Git repertory but I think I'm missing a step or two to combine them all. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Hey there! I am not really sure what you are trying to implement. Do you need direct low-level memory access to arbitrary addresses from the software running on the processor or do you want to access the DMEM from another hardware module (something like a DMA concept)? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick answer. For my case it would be to access the DMEM from another hardware module. A simple example to illustrate what I'm trying to achieve would be to launch the Boot-loader, load a binary compiled .C file with a program that will periodically(Ex: each 1sec) show/print on a console the value of a specific address at the DMEM range. Meanwhile, if a press a physical switch (to simulate the detection of a signal), i would like to write a value at that specific address (updating the content at this specific address needs to be done only by the HW layer). At the end, the endless loop made on the Soft layer should allow me to see the value at that specific address change for each time I trigger the signal on the HW layer. |
Beta Was this translation helpful? Give feedback.
-
Ok I think I understood what you are trying to do 😉 Only the CPU core can access the processor-internal IMEM and DMEM. If you want to access those memories also from other "cores" you need to use processor-external memories for that. But I think for your application a tiny multi-ported RAM connected to the external bus interface (so the CPU can access it) and also connected to your "signal capture logic" should be sufficient. There are predefined functions to read/write bytes, half-words and words from/to any address. For example: neorv32/sw/lib/include/neorv32_cpu.h Lines 169 to 185 in d828c7d |
Beta Was this translation helpful? Give feedback.
-
Hi! I believe I'm trying to do something similar as Sergio here. What I want to do is receive data from an ADC and place it somewhere accessible to the CPU, so it can do some signal processing (a couple or FIR filters, for example), and place it back somewhere for the programmable logic to acquire and continue the treatment of this data. I was thinking that the slink interface would be good for that, but I see that it's been removed. It looks like the idea given here is the most straightforward way to do this, is that right? It'd be like a DMA without a proper DMA controller, just knowing beforehand the read/write addresses of an external block of RAM. Still, I find that an streaming I/O interface would be better for my processor assisted signal processing! IS there any plan to implement something like that back again? Or maybe I should just use an older version of neorv32, is that a good idea? Thanks! |
Beta Was this translation helpful? Give feedback.
Ok I think I understood what you are trying to do 😉
Only the CPU core can access the processor-internal IMEM and DMEM. If you want to access those memories also from other "cores" you need to use processor-external memories for that. But I think for your application a tiny multi-ported RAM connected to the external bus interface (so the CPU can access it) and also connected to your "signal capture logic" should be sufficient.
There are predefined functions to read/write bytes, half-words and words from/to any address. For example:
neorv32/sw/lib/include/neorv32_cpu.h
Lines 169 to 185 in d828c7d