使用環境:Qus II 7.2 SP3 + Nios II EDS 7.2 SP3 + DE2(Cyclone II EP2C35F627C6)
Step 1:
加入所需的ip
只要加入SRAM即可,并不需要Tristate Bridge与CFI Flash。
由于Nios II只使用到100M的ck,并不需要另外加上50MHz clock。
Step 2:
设定Nios II CPU的Reset Vector与Exception Vector
由于现在只有SRAM,所以将Reset Vector与Exception Vector全部设在SRAM。
Step 3:
更精简的top module
DE2_NIOS_Lite.v / Verilog
1 /*
2 (C) OOMusou 2008 http://oomusou.cnblogs.com
3
4 Filename : DE2_NIOS_Lite.v
5 Compiler : Quartus II 7.2 SP3 + ModelSim-Ara 6.1g
6 Description : DE2_NIOS lite version for SRAM only
7 Release : 08/29/2008 1.0
8 */
9 module DE2_NIOS_Lite (
10 input CLOCK_50, // On Board 50 MHz
11 input [3:0] KEY, // Pushbutton[3:0]
12 inout [15:0] SRAM_DQ, // SRAM Data bus 16 Bits
13 output [17:0] SRAM_ADDR, // SRAM Address bus 18 Bits
14 output SRAM_UB_N, // SRAM Low-byte Data Mask
15 output SRAM_LB_N, // SRAM High-byte Data Mask
16 output SRAM_WE_N, // SRAM Write Enable
17 output SRAM_CE_N, // SRAM Enable
18 output SRAM_OE_N // SRAM Output Enable
19 );
20
21 wire CPU_CLK;
22 wire CPU_RESET;
23
24 Reset_Delay u0 (
25 .iRST(KEY[0]),
26 .LK(CLOCK_50),
27 .oRESET(CPU_RESET)
28 );
29
30 SDRAM_ u1 (
31 .inclk0(CLOCK_50),
32 .c1(CPU_CLK)
33 );
34
35 nios_ii u2 (
36 .clk(CPU_CLK),
37 .reset_n(CPU_RESET),
38 // SRAM
39 .SRAM_ADDR_from_the_sram(SRAM_ADDR),
40 .SRAM_CE_N_from_the_sram(SRAM_CE_N),
41 .SRAM_DQ_to_and_from_the_sram(SRAM_DQ),
42 .SRAM_LB_N_from_the_sram(SRAM_LB_N),
43 .SRAM_OE_N_from_the_sram(SRAM_OE_N),
44 .SRAM_UB_N_from_the_sram(SRAM_UB_N),
45 .SRAM_WE_N_from_the_sram(SRAM_WE_N)
46 );
47
48 endmodule
Step 4:
可顺利执行Nios II EDS的Hello World与Hello MicroC/OS-II project template。