2 * "Hello World" example.
4 * This example prints 'Hello from Nios II' to the STDOUT stream. It runs on
5 * the Nios II 'standard', 'full_featured', 'fast', and 'low_cost' example
6 * designs. It runs with or without the MicroC/OS-II RTOS and requires a STDOUT
7 * device in your system's hardware.
8 * The memory footprint of this hosted application is ~69 kbytes by default
9 * using the standard reference design.
11 * For a reduced footprint version of this template, and an explanation of how
12 * to reduce the memory footprint for a given application, see the
13 * "small_hello_world" template.
17 #include "sdram_master.h"
26 IOWR_8DIRECT(SDRAM_U1_BASE
,i
,i
);
28 IOWR(SDRAM_MASTER_INST_BASE
,S_ADDR
,SDRAM_U1_BASE
);
29 IOWR(SDRAM_MASTER_INST_BASE
,D_ADDR
,SDRAM_U2_BASE
);
30 IOWR(SDRAM_MASTER_INST_BASE
,LONGTH
,100);
31 IOWR(SDRAM_MASTER_INST_BASE
,START_ADDR
,1);
33 temp
=IORD(SDRAM_MASTER_INST_BASE
,S_ADDR
);
34 printf("S_ADDR:w,r==%d,%d\n",SDRAM_U1_BASE
,temp
);
35 temp
=IORD(SDRAM_MASTER_INST_BASE
,D_ADDR
);
36 printf("D_ADDR:w,r==%d,%d\n",SDRAM_U2_BASE
,temp
);
37 temp
=IORD(SDRAM_MASTER_INST_BASE
,LONGTH
);
38 printf("LONGTH:w,r==%d,%d\n",100,temp
);
40 while(IORD(SDRAM_MASTER_INST_BASE
,STATUS_ADDR
)!=1){
41 printf("waiting...!\n");
46 j
=IORD_8DIRECT(SDRAM_U1_BASE
,i
);
47 printf("SDRAM_U1:i,j == %d, %d\n",i
,j
);
50 j
=IORD_8DIRECT(SDRAM_U2_BASE
,i
);
51 printf("SDRAM_U2:i,j == %d, %d\n",i
,j
);
55 printf("Hello from Nios II!\n");