Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

NIOS C CODE help

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

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.