Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21267 Discussions

How to perform read/write to CSR registers in custom controller core through NIOS II processor?

A_Manikanta
Beginner
423 Views
Hi,
We have created a qsys system with NIOS II fast core processor.
We have integrated our custom controller core with NIOS processor.
How to perform read/write to CSR registers in custom controller core through NIOS II Software build tool eclipse?
I am specifically looking for functions, format to use from eclipse. Is there any tutorial, or documents for this ?

Thanks,
Manikanta.
Labels (1)
0 Kudos
1 Solution
JingyangTeh
Employee
225 Views

Hi


For the NiosII the CSR Registers are listed under the NiosII Processor Reference Guide.

https://cdrdv2-public.intel.com/666887/n2cpu-nii5v1gen2-683836-666887.pdf

To get the registers value it uses the built in function of NiosII to get the registers value.


If you are trying to get CSR Registers from another custom processor.

This will require the processor to get its own CSR register and send it to the NiosII processor. (through some other protocol).

CSR register is a status of the processor and usually not able to be read externally except for a debugger.


Regards

Jingyang, Teh



View solution in original post

0 Kudos
6 Replies
JingyangTeh
Employee
317 Views

Hi


You could use the macro defined in the nios2.h header file under the BSP folder generated.

There a multiple macros ranging from NIOS2_READ_STATUS to NIOS2_READ_BSTATUS


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
283 Views

Hi


Any update on this case?

Did you able to find the macro to read the registers?


Regards

Jingyang, Teh


0 Kudos
A_Manikanta
Beginner
277 Views
Hi ,
Actually im trying to perform write/read operation to custom core CSR registers.
I am specifically looking for functions, format to use from eclipse. Is there any tutorial, or documents for this ?
0 Kudos
JingyangTeh
Employee
226 Views

Hi


For the NiosII the CSR Registers are listed under the NiosII Processor Reference Guide.

https://cdrdv2-public.intel.com/666887/n2cpu-nii5v1gen2-683836-666887.pdf

To get the registers value it uses the built in function of NiosII to get the registers value.


If you are trying to get CSR Registers from another custom processor.

This will require the processor to get its own CSR register and send it to the NiosII processor. (through some other protocol).

CSR register is a status of the processor and usually not able to be read externally except for a debugger.


Regards

Jingyang, Teh



0 Kudos
JingyangTeh
Employee
186 Views

Hi


Do you have any follow up question on this?


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
108 Views

Hi


I’m glad that your question has been addressed, I will now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


Regards

Jingyang, Teh


0 Kudos
Reply