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

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

Altera_Forum
Honored Contributor II
1,004 Views

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.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
337 Views

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 ---  

0 Kudos
Reply