Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

accesing a custom component

Altera_Forum
Honored Contributor II
925 Views

Hello every body; 

I have created my custom component, it have an avalon slave interface, it have 2 slave registers, how can i access these registers if i have the base address, i mean that what is the order of these internal registers, 

another question is if this component takes 20 clk cycle to finish, how can i take its output when it just finish. 

Thanks
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
179 Views

 

--- Quote Start ---  

 

I have created my custom component, it have an avalon slave interface, it have 2 slave registers, how can i access these registers if i have the base address, i mean that what is the order of these internal registers, 

 

--- Quote End ---  

 

Every register you implement in the custom component is supposed to have an address (or offset) inside the MM slave address range. This depends only on your hw design. 

 

 

--- Quote Start ---  

 

another question is if this component takes 20 clk cycle to finish, how can i take its output when it just finish. 

 

--- Quote End ---  

 

Three options: 

- wait at least 20 clk with a sw cycle 

- implement a status register with a completion flag bit: then poll the bit until the it signals your data is ready; this is especially useful when the process duration is not constant 

- route the completion signal to an irq
0 Kudos
Reply