How to allocate memory for/from FPGA (side)
Posted: Thu Dec 14, 2017 2:06 pm
Hello everyone,
I’m playing around with my redpitaya board for a while now.
I tried to create my own module using verilog to write some data into ram and that works.
For example, I made a counter on fpga side which writes its values into ram via hp-port, starting at 0x00100000 and ending at 0x001000cc, and on the OS side I wrote a small c-program which reads this data out and prints it on the console.
This all works fine, but by now I’m sure I’m not doing this the right way, because till now the processing system doesn’t know, that I’m using this amount of memory. If I write much more data to ram, for example 0x001000000 to 0x001003e8 (what should be 1000byte), I get a nasty segmentation fault error.
Maybe I just wrote into the memory of another process and/or the OS detects that there is an unauthorized access to memory.
My question is, what is the right way to allocate memory in this case?! Is there a way to tell the OS from fpga side, that I need memory, or is there a way to write a program which allocates memory for me.
Any help/ideas would be appreciated.
I’m playing around with my redpitaya board for a while now.
I tried to create my own module using verilog to write some data into ram and that works.
For example, I made a counter on fpga side which writes its values into ram via hp-port, starting at 0x00100000 and ending at 0x001000cc, and on the OS side I wrote a small c-program which reads this data out and prints it on the console.
This all works fine, but by now I’m sure I’m not doing this the right way, because till now the processing system doesn’t know, that I’m using this amount of memory. If I write much more data to ram, for example 0x001000000 to 0x001003e8 (what should be 1000byte), I get a nasty segmentation fault error.
Maybe I just wrote into the memory of another process and/or the OS detects that there is an unauthorized access to memory.
My question is, what is the right way to allocate memory in this case?! Is there a way to tell the OS from fpga side, that I need memory, or is there a way to write a program which allocates memory for me.
Any help/ideas would be appreciated.