Forum Discussion

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

Doubts with basics of NIOS II with Cyclone FPGA. Urgent !!

I have been trying to do some basic stuff as follows,

I have made a basic cpu with one in-port and one out-port

given a constant value at the inport

want to read the value in the outport by implementing the CPU using assembly prog.

.text

.global _start

_start:

movia r15, 0x00000000 /*base address of input port*/

movia r16, 0x00000010 /*base address of output port*/

ldwio r4, 0(r15)

stwio r4, 0(r16)

.end

how shud i compile this and write into the FPGA ???

I much complicated project is awaiting me... if i get through these basics i and pick up and go ahead. please help.

1 Reply

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

    Hi,

    Which board are you using? If it is DE2 cause my previous work concerning with this one, you can find a brief tutorial in the CD-Rom which shows you how to do this basic stuff.

    In general, first you build system with SOPC builder and after then compile and download to the FPGA. In second step, in order to run this basic code, you can use Altera debug client to complie assembly, load the code into memory, run and debug as well.

    PS. I think it is better if you read the tutorial and demonstration accompanying with your board before asking.

    --- Quote Start ---

    I have been trying to do some basic stuff as follows,

    I have made a basic cpu with one in-port and one out-port

    given a constant value at the inport

    want to read the value in the outport by implementing the CPU using assembly prog.

    .text

    .global _start

    _start:

    movia r15, 0x00000000 /*base address of input port*/

    movia r16, 0x00000010 /*base address of output port*/

    ldwio r4, 0(r15)

    stwio r4, 0(r16)

    .end

    how shud i compile this and write into the FPGA ???

    I much complicated project is awaiting me... if i get through these basics i and pick up and go ahead. please help.

    --- Quote End ---