NIOS II学习总结
玩NIOS II 这么久了感觉有必要做一下总结!
个人觉得比较麻烦的是配置那个NIOS的环境,像在上面编程和普通的单片机没什么区别,比较简单!
在配置环境的时候遇到的问题久比较多了,一开始怎么也生成不了sof和pof文件。原因就多了,像7.2版本的不支持DE0上的那款芯片,所以编译不出错,但就是没有相应的文件生成!换成9.1SP2的就有了sof。但是又找不着pof,一看原来9.1SP2默认设置是不生成pof文件的。
于是assigment->DEVICE
勾上箭头1处的方框即可长生pof文件。
当箭头2处的方框若不勾上就在as模式下面无法下载pof。
要让程序脱机运行下载步骤如下:
先下pof,再下sof,再在NIOS下面同时下载sof和elf,重启电源即可!
DE0下面的tcl文件如下:
#pin Assignment
set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
set_global_assignment -name ENABLE_DEVICE_WIDE_RESET OFF
set_global_assignment -name ENABLE_INIT_DONE_OUTPUT OFF
########## Clock ##########
set_location_assignment PIN_G21 -to CLOCK_50
set_location_assignment PIN_B12 -to CLOCK_50_2
########## Switch (Up-High, Down-Low) ##########
set_location_assignment PIN_J6 -to SW[0]
set_location_assignment PIN_H5 -to SW[1]
set_location_assignment PIN_H6 -to SW[2]
set_location_assignment PIN_G4 -to SW[3]
set_location_assignment PIN_G5 -to SW[4]
set_location_assignment PIN_J7 -to SW[5]
set_location_assignment PIN_H7 -to SW[6]
set_location_assignment PIN_E3 -to SW[7]
set_location_assignment PIN_E4 -to SW[8]
set_location_assignment PIN_D2 -to SW[9]
########## Button (Active Low) ##########
set_location_assignment PIN_H2 -to BUTTON[0]
set_location_assignment PIN_G3 -to BUTTON[1]
set_location_assignment PIN_F1 -to BUTTON[2]
########## LEDG ##########
set_location_assignment PIN_J1 -to LEDG[0]
set_location_assignment PIN_J2 -to LEDG[1]
set_location_assignment PIN_J3 -to LEDG[2]
set_location_assignment PIN_H1 -to LEDG[3]
set_location_assignment PIN_F2 -to LEDG[4]
set_location_assignment PIN_E1 -to LEDG[5]
set_location_assignment PIN_C1 -to LEDG[6]
set_location_assignment PIN_C2 -to LEDG[7]
set_location_assignment PIN_B2 -to LEDG[8]
set_location_assignment PIN_B1 -to LEDG[9]
########## HEX ##########
set_location_assignment PIN_E11 -to HEX0_D[0]
set_location_assignment PIN_F11 -to HEX0_D[1]
set_location_assignment PIN_H12 -to HEX0_D[2]
set_location_assignment PIN_H13 -to HEX0_D[3]
set_location_assignment PIN_G12 -to HEX0_D[4]
set_location_assignment PIN_F12 -to HEX0_D[5]
set_location_assignment PIN_F13 -to HEX0_D[6]
set_location_assignment PIN_D13 -to HEX0_DP
set_location_assignment PIN_A13 -to HEX1_D[0]
set_location_assignment PIN_B13 -to HEX1_D[1]
set_location_assignment PIN_C13 -to HEX1_D[2]
set_location_assignment PIN_A14 -to HEX1_D[3]
set_location_assignment PIN_B14 -to HEX1_D[4]
set_location_assignment PIN_E14 -to HEX1_D[5]
set_location_assignment PIN_A15 -to HEX1_D[6]
set_location_assignment PIN_B15 -to HEX1_DP
set_location_assignment PIN_D15 -to HEX2_D[0]
set_location_assignment PIN_A16 -to HEX2_D[1]
set_location_assignment PIN_B16 -to HEX2_D[2]
set_location_assignment PIN_E15 -to HEX2_D[3]
set_location_assignment PIN_A17 -to HEX2_D[4]
set_location_assignment PIN_B17 -to HEX2_D[5]
set_location_assignment PIN_F14 -to HEX2_D[6]
set_location_assignment PIN_A18 -to HEX2_DP
set_location_assignment PIN_B18 -to HEX3_D[0]
set_location_assignment PIN_F15 -to HEX3_D[1]
set_location_assignment PIN_A19 -to HEX3_D[2]
set_location_assignment PIN_B19 -to HEX3_D[3]
set_location_assignment PIN_C19 -to HEX3_D[4]
set_location_assignment PIN_D19 -to HEX3_D[5]
set_location_assignment PIN_G15 -to HEX3_D[6]
set_location_assignment PIN_G16 -to HEX3_DP
########## LCD ##########
set_location_assignment PIN_D22 -to LCD_DATA[0]
set_location_assignment PIN_D21 -to LCD_DATA[1]
set_location_assignment PIN_C22 -to LCD_DATA[2]
set_location_assignment PIN_C21 -to LCD_DATA[3]
set_location_assignment PIN_B22 -to LCD_DATA[4]
set_location_assignment PIN_B21 -to LCD_DATA[5]
set_location_assignment PIN_D20 -to LCD_DATA[6]
set_location_assignment PIN_C20 -to LCD_DATA[7]
set_location_assignment PIN_E22 -to LCD_RW
set_location_assignment PIN_E21 -to LCD_EN
set_location_assignment PIN_F22 -to LCD_RS
set_location_assignment PIN_F21 -to LCD_BLON
########## VGA ##########
set_location_assignment PIN_H19 -to VGA_R[0]
set_location_assignment PIN_H17 -to VGA_R[1]
set_location_assignment PIN_H20 -to VGA_R[2]
set_location_assignment PIN_H21 -to VGA_R[3]
set_location_assignment PIN_H22 -to VGA_G[0]
set_location_assignment PIN_J17 -to VGA_G[1]
set_location_assignment PIN_K17 -to VGA_G[2]
set_location_assignment PIN_J21 -to VGA_G[3]
set_location_assignment PIN_K22 -to VGA_B[0]
set_location_assignment PIN_K21 -to VGA_B[1]
set_location_assignment PIN_J22 -to VGA_B[2]
set_location_assignment PIN_K18 -to VGA_B[3]
set_location_assignment PIN_L21 -to VGA_HS
set_location_assignment PIN_L22 -to VGA_VS
########## UART ##########
set_location_assignment PIN_U22 -to UART_RXD
set_location_assignment PIN_U21 -to UART_TXD
set_location_assignment PIN_V21 -to UART_CTS
set_location_assignment PIN_V22 -to UART_RTS
########## PS2 ##########
set_location_assignment PIN_P22 -to PS2_KBCLK
set_location_assignment PIN_P21 -to PS2_KBDAT
set_location_assignment PIN_R21 -to PS2_MSCLK
set_location_assignment PIN_R22 -to PS2_MSDAT
########## SDIO ##########
set_location_assignment PIN_Y21 -to SD_CLK
set_location_assignment PIN_Y22 -to SD_CMD
set_location_assignment PIN_AA22 -to SD_DAT0
set_location_assignment PIN_W21 -to SD_DAT3
set_location_assignment PIN_W20 -to SD_WP_N
########## SDRAM ##########
set_location_assignment PIN_C4 -to DRAM_ADDR[0]
set_location_assignment PIN_A3 -to DRAM_ADDR[1]
set_location_assignment PIN_B3 -to DRAM_ADDR[2]
set_location_assignment PIN_C3 -to DRAM_ADDR[3]
set_location_assignment PIN_A5 -to DRAM_ADDR[4]
set_location_assignment PIN_C6 -to DRAM_ADDR[5]
set_location_assignment PIN_B6 -to DRAM_ADDR[6]
set_location_assignment PIN_A6 -to DRAM_ADDR[7]
set_location_assignment PIN_C7 -to DRAM_ADDR[8]
set_location_assignment PIN_B7 -to DRAM_ADDR[9]
set_location_assignment PIN_B4 -to DRAM_ADDR[10]
set_location_assignment PIN_A7 -to DRAM_ADDR[11]
set_location_assignment PIN_C8 -to DRAM_ADDR[12]
set_location_assignment PIN_D10 -to DRAM_DQ[0]
set_location_assignment PIN_G10 -to DRAM_DQ[1]
set_location_assignment PIN_H10 -to DRAM_DQ[2]
set_location_assignment PIN_E9 -to DRAM_DQ[3]
set_location_assignment PIN_F9 -to DRAM_DQ[4]
set_location_assignment PIN_G9 -to DRAM_DQ[5]
set_location_assignment PIN_H9 -to DRAM_DQ[6]
set_location_assignment PIN_F8 -to DRAM_DQ[7]
set_location_assignment PIN_A8 -to DRAM_DQ[8]
set_location_assignment PIN_B9 -to DRAM_DQ[9]
set_location_assignment PIN_A9 -to DRAM_DQ[10]
set_location_assignment PIN_C10 -to DRAM_DQ[11]
set_location_assignment PIN_B10 -to DRAM_DQ[12]
set_location_assignment PIN_A10 -to DRAM_DQ[13]
set_location_assignment PIN_E10 -to DRAM_DQ[14]
set_location_assignment PIN_F10 -to DRAM_DQ[15]
set_location_assignment PIN_B5 -to DRAM_BA_0
set_location_assignment PIN_A4 -to DRAM_BA_1
set_location_assignment PIN_E7 -to DRAM_LDQM
set_location_assignment PIN_B8 -to DRAM_UDQM
set_location_assignment PIN_F7 -to DRAM_RAS_N
set_location_assignment PIN_G8 -to DRAM_CAS_N
set_location_assignment PIN_E6 -to DRAM_CKE
set_location_assignment PIN_E5 -to DRAM_CLK
set_location_assignment PIN_D6 -to DRAM_WE_N
set_location_assignment PIN_G7 -to DRAM_CS_N
########## Flash ##########
set_location_assignment PIN_P7 -to FL_ADDR[0]
set_location_assignment PIN_P5 -to FL_ADDR[1]
set_location_assignment PIN_P6 -to FL_ADDR[2]
set_location_assignment PIN_N7 -to FL_ADDR[3]
set_location_assignment PIN_N5 -to FL_ADDR[4]
set_location_assignment PIN_N6 -to FL_ADDR[5]
set_location_assignment PIN_M8 -to FL_ADDR[6]
set_location_assignment PIN_M4 -to FL_ADDR[7]
set_location_assignment PIN_P2 -to FL_ADDR[8]
set_location_assignment PIN_N2 -to FL_ADDR[9]
set_location_assignment PIN_N1 -to FL_ADDR[10]
set_location_assignment PIN_M3 -to FL_ADDR[11]
set_location_assignment PIN_M2 -to FL_ADDR[12]
set_location_assignment PIN_M1 -to FL_ADDR[13]
set_location_assignment PIN_L7 -to FL_ADDR[14]
set_location_assignment PIN_L6 -to FL_ADDR[15]
set_location_assignment PIN_AA2 -to FL_ADDR[16]
set_location_assignment PIN_M5 -to FL_ADDR[17]
set_location_assignment PIN_M6 -to FL_ADDR[18]
set_location_assignment PIN_P1 -to FL_ADDR[19]
set_location_assignment PIN_P3 -to FL_ADDR[20]
set_location_assignment PIN_R2 -to FL_ADDR[21]
set_location_assignment PIN_R7 -to FL_DQ[0]
set_location_assignment PIN_P8 -to FL_DQ[1]
set_location_assignment PIN_R8 -to FL_DQ[2]
set_location_assignment PIN_U1 -to FL_DQ[3]
set_location_assignment PIN_V2 -to FL_DQ[4]
set_location_assignment PIN_V3 -to FL_DQ[5]
set_location_assignment PIN_W1 -to FL_DQ[6]
set_location_assignment PIN_Y1 -to FL_DQ[7]
set_location_assignment PIN_T5 -to FL_DQ[8]
set_location_assignment PIN_T7 -to FL_DQ[9]
set_location_assignment PIN_T4 -to FL_DQ[10]
set_location_assignment PIN_U2 -to FL_DQ[11]
set_location_assignment PIN_V1 -to FL_DQ[12]
set_location_assignment PIN_V4 -to FL_DQ[13]
set_location_assignment PIN_W2 -to FL_DQ[14]
set_location_assignment PIN_Y2 -to FL_DQ[15]
set_location_assignment PIN_AA1 -to FL_BYTE_N
set_location_assignment PIN_N8 -to FL_CE_N
set_location_assignment PIN_R6 -to FL_OE_N
set_location_assignment PIN_R1 -to FL_RST_N
set_location_assignment PIN_M7 -to FL_RY
set_location_assignment PIN_P4 -to FL_WE_N
set_location_assignment PIN_T3 -to FL_WP_N
########## AS ##########
set_location_assignment PIN_K2 -to AS_CLK
set_location_assignment PIN_D1 -to AS_DO
set_location_assignment PIN_E2 -to AS_CS_N
set_location_assignment PIN_K1 -to AS_DI
这个文件还是一个网友发给我的,在这里得感谢他的帮忙,要不然还不知道移植到什么时候呢!
DE2的tcl文件如下:
set_location_assignment PIN_T6 -to DRAM_ADDR[0]
set_location_assignment PIN_V4 -to DRAM_ADDR[1]
set_location_assignment PIN_V3 -to DRAM_ADDR[2]
set_location_assignment PIN_W2 -to DRAM_ADDR[3]
set_location_assignment PIN_W1 -to DRAM_ADDR[4]
set_location_assignment PIN_U6 -to DRAM_ADDR[5]
set_location_assignment PIN_U7 -to DRAM_ADDR[6]
set_location_assignment PIN_U5 -to DRAM_ADDR[7]
set_location_assignment PIN_W4 -to DRAM_ADDR[8]
set_location_assignment PIN_W3 -to DRAM_ADDR[9]
set_location_assignment PIN_Y1 -to DRAM_ADDR[10]
set_location_assignment PIN_V5 -to DRAM_ADDR[11]
set_location_assignment PIN_AE2 -to DRAM_BA_0
set_location_assignment PIN_AE3 -to DRAM_BA_1
set_location_assignment PIN_AB3 -to DRAM_CAS_N
set_location_assignment PIN_AA6 -to DRAM_CKE
set_location_assignment PIN_AA7 -to DRAM_CLK
set_location_assignment PIN_AC3 -to DRAM_CS_N
set_location_assignment PIN_V6 -to DRAM_DQ[0]
set_location_assignment PIN_AA2 -to DRAM_DQ[1]
set_location_assignment PIN_AA1 -to DRAM_DQ[2]
set_location_assignment PIN_Y3 -to DRAM_DQ[3]
set_location_assignment PIN_Y4 -to DRAM_DQ[4]
set_location_assignment PIN_R8 -to DRAM_DQ[5]
set_location_assignment PIN_T8 -to DRAM_DQ[6]
set_location_assignment PIN_V7 -to DRAM_DQ[7]
set_location_assignment PIN_W6 -to DRAM_DQ[8]
set_location_assignment PIN_AB2 -to DRAM_DQ[9]
set_location_assignment PIN_AB1 -to DRAM_DQ[10]
set_location_assignment PIN_AA4 -to DRAM_DQ[11]
set_location_assignment PIN_AA3 -to DRAM_DQ[12]
set_location_assignment PIN_AC2 -to DRAM_DQ[13]
set_location_assignment PIN_AC1 -to DRAM_DQ[14]
set_location_assignment PIN_AA5 -to DRAM_DQ[15]
set_location_assignment PIN_AD2 -to DRAM_LDQM
set_location_assignment PIN_Y5 -to DRAM_UDQM
set_location_assignment PIN_AB4 -to DRAM_RAS_N
set_location_assignment PIN_AD3 -to DRAM_WE_N
set_location_assignment PIN_AC18 -to FL_ADDR[0]
set_location_assignment PIN_AB18 -to FL_ADDR[1]
set_location_assignment PIN_AE19 -to FL_ADDR[2]
set_location_assignment PIN_AF19 -to FL_ADDR[3]
set_location_assignment PIN_AE18 -to FL_ADDR[4]
set_location_assignment PIN_AF18 -to FL_ADDR[5]
set_location_assignment PIN_Y16 -to FL_ADDR[6]
set_location_assignment PIN_AA16 -to FL_ADDR[7]
set_location_assignment PIN_AD17 -to FL_ADDR[8]
set_location_assignment PIN_AC17 -to FL_ADDR[9]
set_location_assignment PIN_AE17 -to FL_ADDR[10]
set_location_assignment PIN_AF17 -to FL_ADDR[11]
set_location_assignment PIN_W16 -to FL_ADDR[12]
set_location_assignment PIN_W15 -to FL_ADDR[13]
set_location_assignment PIN_AC16 -to FL_ADDR[14]
set_location_assignment PIN_AD16 -to FL_ADDR[15]
set_location_assignment PIN_AE16 -to FL_ADDR[16]
set_location_assignment PIN_AC15 -to FL_ADDR[17]
set_location_assignment PIN_AB15 -to FL_ADDR[18]
set_location_assignment PIN_AA15 -to FL_ADDR[19]
set_location_assignment PIN_V17 -to FL_CE_N
set_location_assignment PIN_W17 -to FL_OE_N
set_location_assignment PIN_AD19 -to FL_DQ[0]
set_location_assignment PIN_AC19 -to FL_DQ[1]
set_location_assignment PIN_AF20 -to FL_DQ[2]
set_location_assignment PIN_AE20 -to FL_DQ[3]
set_location_assignment PIN_AB20 -to FL_DQ[4]
set_location_assignment PIN_AC20 -to FL_DQ[5]
set_location_assignment PIN_AF21 -to FL_DQ[6]
set_location_assignment PIN_AE21 -to FL_DQ[7]
set_location_assignment PIN_AA18 -to FL_RST_N
set_location_assignment PIN_AA17 -to FL_WE_N
set_location_assignment PIN_AF10 -to HEX0[0]
set_location_assignment PIN_AB12 -to HEX0[1]
set_location_assignment PIN_AC12 -to HEX0[2]
set_location_assignment PIN_AD11 -to HEX0[3]
set_location_assignment PIN_AE11 -to HEX0[4]
set_location_assignment PIN_V14 -to HEX0[5]
set_location_assignment PIN_V13 -to HEX0[6]
set_location_assignment PIN_V20 -to HEX1[0]
set_location_assignment PIN_V21 -to HEX1[1]
set_location_assignment PIN_W21 -to HEX1[2]
set_location_assignment PIN_Y22 -to HEX1[3]
set_location_assignment PIN_AA24 -to HEX1[4]
set_location_assignment PIN_AA23 -to HEX1[5]
set_location_assignment PIN_AB24 -to HEX1[6]
set_location_assignment PIN_AB23 -to HEX2[0]
set_location_assignment PIN_V22 -to HEX2[1]
set_location_assignment PIN_AC25 -to HEX2[2]
set_location_assignment PIN_AC26 -to HEX2[3]
set_location_assignment PIN_AB26 -to HEX2[4]
set_location_assignment PIN_AB25 -to HEX2[5]
set_location_assignment PIN_Y24 -to HEX2[6]
set_location_assignment PIN_Y23 -to HEX3[0]
set_location_assignment PIN_AA25 -to HEX3[1]
set_location_assignment PIN_AA26 -to HEX3[2]
set_location_assignment PIN_Y26 -to HEX3[3]
set_location_assignment PIN_Y25 -to HEX3[4]
set_location_assignment PIN_U22 -to HEX3[5]
set_location_assignment PIN_W24 -to HEX3[6]
set_location_assignment PIN_U9 -to HEX4[0]
set_location_assignment PIN_U1 -to HEX4[1]
set_location_assignment PIN_U2 -to HEX4[2]
set_location_assignment PIN_T4 -to HEX4[3]
set_location_assignment PIN_R7 -to HEX4[4]
set_location_assignment PIN_R6 -to HEX4[5]
set_location_assignment PIN_T3 -to HEX4[6]
set_location_assignment PIN_T2 -to HEX5[0]
set_location_assignment PIN_P6 -to HEX5[1]
set_location_assignment PIN_P7 -to HEX5[2]
set_location_assignment PIN_T9 -to HEX5[3]
set_location_assignment PIN_R5 -to HEX5[4]
set_location_assignment PIN_R4 -to HEX5[5]
set_location_assignment PIN_R3 -to HEX5[6]
set_location_assignment PIN_R2 -to HEX6[0]
set_location_assignment PIN_P4 -to HEX6[1]
set_location_assignment PIN_P3 -to HEX6[2]
set_location_assignment PIN_M2 -to HEX6[3]
set_location_assignment PIN_M3 -to HEX6[4]
set_location_assignment PIN_M5 -to HEX6[5]
set_location_assignment PIN_M4 -to HEX6[6]
set_location_assignment PIN_L3 -to HEX7[0]
set_location_assignment PIN_L2 -to HEX7[1]
set_location_assignment PIN_L9 -to HEX7[2]
set_location_assignment PIN_L6 -to HEX7[3]
set_location_assignment PIN_L7 -to HEX7[4]
set_location_assignment PIN_P9 -to HEX7[5]
set_location_assignment PIN_N9 -to HEX7[6]
set_location_assignment PIN_G26 -to KEY[0]
set_location_assignment PIN_N23 -to KEY[1]
set_location_assignment PIN_P23 -to KEY[2]
set_location_assignment PIN_W26 -to KEY[3]
set_location_assignment PIN_N25 -to SW[0]
set_location_assignment PIN_N26 -to SW[1]
set_location_assignment PIN_P25 -to SW[2]
set_location_assignment PIN_AE14 -to SW[3]
set_location_assignment PIN_AF14 -to SW[4]
set_location_assignment PIN_AD13 -to SW[5]
set_location_assignment PIN_AC13 -to SW[6]
set_location_assignment PIN_C13 -to SW[7]
set_location_assignment PIN_B13 -to SW[8]
set_location_assignment PIN_A13 -to SW[9]
set_location_assignment PIN_N1 -to SW[10]
set_location_assignment PIN_P1 -to SW[11]
set_location_assignment PIN_P2 -to SW[12]
set_location_assignment PIN_T7 -to SW[13]
set_location_assignment PIN_U3 -to SW[14]
set_location_assignment PIN_U4 -to SW[15]
set_location_assignment PIN_V1 -to SW[16]
set_location_assignment PIN_V2 -to SW[17]
set_location_assignment PIN_AE22 -to LEDG[0]
set_location_assignment PIN_AF22 -to LEDG[1]
set_location_assignment PIN_W19 -to LEDG[2]
set_location_assignment PIN_V18 -to LEDG[3]
set_location_assignment PIN_U18 -to LEDG[4]
set_location_assignment PIN_U17 -to LEDG[5]
set_location_assignment PIN_AA20 -to LEDG[6]
set_location_assignment PIN_Y18 -to LEDG[7]
set_location_assignment PIN_AE23 -to LEDR[0]
set_location_assignment PIN_AF23 -to LEDR[1]
set_location_assignment PIN_AB21 -to LEDR[2]
set_location_assignment PIN_AC22 -to LEDR[3]
set_location_assignment PIN_AD22 -to LEDR[4]
set_location_assignment PIN_AD23 -to LEDR[5]
set_location_assignment PIN_AD21 -to LEDR[6]
set_location_assignment PIN_AC21 -to LEDR[7]
set_location_assignment PIN_AA14 -to LEDR[8]
set_location_assignment PIN_Y13 -to LEDR[9]
set_location_assignment PIN_AA13 -to LEDR[10]
set_location_assignment PIN_AC14 -to LEDR[11]
set_location_assignment PIN_AD15 -to LEDR[12]
set_location_assignment PIN_AE15 -to LEDR[13]
set_location_assignment PIN_AF13 -to LEDR[14]
set_location_assignment PIN_AE13 -to LEDR[15]
set_location_assignment PIN_AE12 -to LEDR[16]
set_location_assignment PIN_AD12 -to LEDR[17]
set_location_assignment PIN_D13 -to OSC_27
set_location_assignment PIN_N2 -to OSC_50
set_location_assignment PIN_C25 -to UART_RXD
set_location_assignment PIN_B25 -to UART_TXD
set_location_assignment PIN_K4 -to LCD_RW
set_location_assignment PIN_K3 -to LCD_EN
set_location_assignment PIN_K1 -to LCD_RS
set_location_assignment PIN_J1 -to LCD_DATA[0]
set_location_assignment PIN_J2 -to LCD_DATA[1]
set_location_assignment PIN_H1 -to LCD_DATA[2]
set_location_assignment PIN_H2 -to LCD_DATA[3]
set_location_assignment PIN_J4 -to LCD_DATA[4]
set_location_assignment PIN_J3 -to LCD_DATA[5]
set_location_assignment PIN_H4 -to LCD_DATA[6]
set_location_assignment PIN_H3 -to LCD_DATA[7]
set_location_assignment PIN_L4 -to LCD_ON
set_location_assignment PIN_K2 -to LCD_BLON
set_location_assignment PIN_C4 -to TD_RESET
在DE0上面配置NIOS 和DE2上面配置NIOS的几点区别记录如下:
1.首先配置的是cpu,接着是三态桥,然后是SDRAM,CFI FLASH,(EPCS可以不用加,默认的pof文件就是下载到那里),接着是sysid,jtag uart,然后是其他的一些外设。但是需要注意的是,当所有东西添加完毕以后,有两步很重要的操作:
然后generate即可。
2.SDRAM是一样的:
后面的几项默认即可!
DE0 下面的FLASH:
按照官方例程的标准,三个时间分别是50 100 50 ns
而用40 160 40 ns好像也可以。(DE2下面用的就是这个时间)
3.配置好的bdf文件如下图:
1)首先是flash:
从图可以看出,cpu接出的cfi flash地址线的最地位没有分配管脚,这一点很重要。
然后就是flash采用的是16位的数据模式。
还有一些特殊的管脚,在DE2里面是没有的,这里列出来如下:
assign LCD_BLON = 1'b0;
assign FL_RST_N = 1'b1;
assign FL_WP_N = 1'b1; // not write protect
assign FL_BYTE_N = 1'b1; // 16-bit mode
上面一段是DE0光盘例程所带,这就是LCD_BLON,FL_RST_N,FL_WP_N,FL_BYTE_N为什么要接VCC的原因。
这点在光盘的源代码的注释里面可以找到:
output FL_WE_N; // FLASH Write Enable
output FL_RST_N; // FLASH Reset
output FL_OE_N; // FLASH Output Enable
output FL_CE_N; // FLASH Chip Enable
output FL_WP_N; // FLASH Hardware Write Protect
output FL_BYTE_N; // FLASH Selects 8/16-bit mode
input FL_RY; // FLASH Ready/Busy
2)然后是SDRAM
DE0的SDRAM和DE2的SDRAM配置基本上是一样的。
3)cpu和SDRAM的时钟的配置如下:
需要说明的是二者主频均为50M,但是CPU和SDRAM存在3°的相位差。
需要说明的就是这些!如有谬误,请指正!
sof、pof和elf
sof = FPGA内部SRAM配置数据,通过JTAG下载,下载后实现FPGA的硬件功能,掉电后即挥发。
pof = 配置器件Flash数据,通过AS模式下载到配置器件内,掉电后重新上电时FPGA会自动从配置器件内读出配置数据,然后配置FPGA内部的SRAM,实现FPGA的硬件功能。如果设计中包含NIOS,pof中仅仅包含NIOS的硬件,上电后配置后NIOS存在于FPGA内,NIOS会根据设定在预设的Memory空间取指运行,如果指定NIOS的复位向量到SDRAM而SDRAM是空的,NIOS会跑飞掉。
elf = NIOS软件,可以通过JTAG加载到NIOS的RAM中运行,也可以通过epcs_controller(通过NIOS的Flash Programmer)加载到配置器件内(位于pof配置数据之后),如果NIOS的复位向量指向epcs_controller,NIOS上电后会从配置器件内取第一条指令执行。
另外,pof文件可以转换成jic文件,通过JTAG方式下载到EPCS内,因此硬件设计可以省掉AS配置接口。
阅读(4229) | 评论(0) | 转发(0) |