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

NIOS C CODE help

Altera_Forum
Honored Contributor II
1,144 Views

Dear Madam/Sir, 

 

I am new to Quartus and NIOS.  

 

please help me regarding following problems. 

 

1) How to define (map) variables used in NIOS C Coding to general purpose 

registers 

 

2) How to write inline assembly language. I want xor, shifting, or, and, not 

operations in C with less number of cycles. For this first point is required. 

 

3) How to write the code for clock event in NIOS C like we write in 

VHDL falling or rising edge. (i want to collect the data according to clock pulse). 

 

4) What is the maximum PLL Clk value i can use for EP3C25E144I7 

 

I want solutions with examples please. 

 

Thanks and Regards, 

Srinivas M
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
425 Views

1) depending on address 

when you see addresses on SOPC builder (or Qsys) the address itself is the way to access each IP. 

this function gives value 0xff to address 0x00100 (+ offset 0 ). 

IOWR_32DIRECT(0x0000100, 0, 0xFF ); 

 

2) sorry. 

I have no idea. 

 

3) you can not run c code on NiosII. 

C program runs on your CPU. and CPU analyzes your code each time. 

you can never run C-code (even assembly language) along with each clock. 

that's why you need to create custum-IP core. 

 

4)maximum PLL clk. 

sorry I don't have much time to reserch. 

I always use 100MHz for CPU clock. 

coz, that is enough. even if you want to use 1GB/sec stream. 

 

on your case. you want to create custom IP-core such as HDL-core which you can command from NiosII( avalonMM master). 

 

there is easy-text I wrote long time ago. 

http://www.akiron.com/fpga/customipinstruction.pdf 

 

see you.
0 Kudos
Reply