Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

How to read Register Field (RegField) of adsp in DS-5?

Altera_Forum
Honored Contributor II
914 Views

Hi everyone, 

I am trying to read/write register field designed in adsp using bare-metal projects in DS-5.  

In adsp, I configure the address for two register fields (e.g a = 1 and b = 2, data width = 32, address width = 16).  

In Qsys, I connect bus of this component (containing two reg fields) to h2f_lw_axi_master bus, the base address of its is 0x0004_0000. 

Then, in DS-5 I use alt_write_word() and alt_read_word() functions to write/read data to these register fields as following.# define ALT_LWFPGASLVS_OFST 0xff200000# define REGFIELD_BASE 0x0004000# define REG1_BASE 0x0001# define REG2_BASE 0x0002 

The read/write data is 

read_data = alt_read_word(ALT_LWFPGASLVS_OFST+ REGFIELD_BASE+REG1_BASE); 

and 

alt_write_word(ALT_LWFPGASLVS_OFST+ REGFIELD_BASE+REG1_BASE, 0x08); 

I put these functions after alt_bridge_init (ALT_BRIDGE_LWH2F) runs successfully, but it is not working. 

 

Is there anything wrong in my program? Please help me to solve it. 

 

Thank you so much. 

Thuc
0 Kudos
0 Replies
Reply