Altera_Forum
Honored Contributor
9 years agoHow to use On-Chip Memory in GHRD on Atlas-SoC board
Hello!
I want to transfer some data from FPGA to program that is running under Linux in HPS part. I am using DE0-Nano-SoC with 5CSEMA4U23C6 and GHRD. GHRD already contains On-Chip Memory in Qsys project and this memory is connected with HPS via h2f_axi_master. I was trying to store 32'hF0F0F0F0 words from within ghrd.v and then read it in Linux by opening /dev/mem but it filled with zeros since 0xC0000000 that must be the base address of the memory untill +0x8000 Below is the part of ghrd.v that I was addedadccounter addr_cnt(
.clk(FPGA_CLK1_50)
, .rst(~KEY)
, .out(add)
);
defparam addr_cnt.W = 14;
soc_system_onchip_memory2_0 m(
.address(add)
, .byteenable(4'b1111)
, .chipselect(1'b1)
, .clk(FPGA_CLK1_50)
, .clken(1'b1)
, .reset(hps_fpga_reset_n)
, .reset_req(1'b0)
, .write(1'b1)
, .writedata(32'hF0F0F0F0)
, .readdata(datain)
); Whats wrong with such design? Why I can't get the data in HPS? Could anybody tell how to use this memory properly or point me to some examples? Thanks a lot in advance!