Altera_Forum
Honored Contributor
7 years agoHPS2FPGA bridge on DE0-Nano-SoC (5CSEMA4U23C6N) and GHRD
Hi!
My device is DE0-Nano-SoC with GSRD and GHRD from System CD with minor changes. I implemented an Avalon-MM module and would like to access it throught HPS2FPGA by 128-bit bus. But I was failed with searching for any valuable examples and with trying to do it myself. I connected this module to both HPS2FPGA and LW_HPS2FPGA bridges. The access to LW_HPS2FPGA is well explained in the manuals hopefully and I successfully got one 32-less-significant-bits word from 4 expected. But when reading from where I expect to find the AXI data all the words are zero-filled. I am trying to access AXI and LWAXI in quite similar way with only difference in the offset from virtual base: I calculate the virtual base. The same value I am trying to use to acces bot the AXI and the light weight AXI later:# define HW_REGS_BASE (ALT_STM_OFST)
...
virtual_base = mmap(NULL, HW_REGS_SPAN, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, HW_REGS_BASE); Then I calculate the offset to my module:
h2p_adc_addr = virtual_base + ((unsigned long) (ALT_LWFPGASLVS_OFST + AVALON_ADC_0_BASE) & (unsigned long) (HW_REGS_MASK)); //Using of lw_axi
or for full 128 bit AXI: # define ALT_FPGASLVS_OFST (0xC0000000)
...
h2p_adc_addr = virtual_base + ((unsigned long) (ALT_FPGASLVS_OFST + AVALON_ADC_0_BASE) & (unsigned long)(HW_REGS_MASK)); // FULL AXI
But in the second case I get only zeros. Is it possible to use AXI with GHRD on DE0-Nano-SoC? Could you help me learn how to use normal AXI bridge instead of ridiculous LWAXI? I also was unsuccessfull in searching the constant for HPS2FPGA bridge offset while ALT_FPGASLVS_OFST is provided by socal/hps.h that frustrate a bit. Are all the offsets from Cyclon V address map specification provided by Alter C libraries? Why ALT_STM_OFST is used in the example from the System CD as a start point for virtual base? Thanks a lot in advance!