Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;# look in my book(s) or www.amos.eguru-il.com
- ;#####################################################
- ;# A template script for the assigning the DE1 board #
- ;# Choosing: device, pins, and making design safer ! #
- ;# Written by: Amos Zaslavsky (C)copyright - Ver 3.0 #
- ;#####################################################
- puts \n
- if {![is_project_open]} {
- puts "========================================"
- puts " ERROR: Assignments can not be done, "
- puts " because there isn't any project open ! "
- puts "========================================"
- } else {
- puts "================================="
- puts " Assigning the DE1 device & pins "
- puts " ... "
- ;#################
- ;# Clock Signals #
- ;#################
- set_location_assignment PIN_L1 -to clk
- # set_location_assignment PIN_L1 -to CLOCK_50#
- # set_location_assignment PIN_D12 -to CLOCK_27[0]
- # set_location_assignment PIN_E12 -to CLOCK_27[1]
- # set_location_assignment PIN_B12 -to CLOCK_24[0]
- # set_location_assignment PIN_A12 -to CLOCK_24[1]
- # set_location_assignment PIN_M21 -to EXT_CLOCK
- ;#############################################
- ;# Debounced Push-Buttons ('0' when pressed) #
- ;#############################################
- # set_location_assignment PIN_R22 -to KEY[0] ;# KEY[0]
- # set_location_assignment PIN_R21 -to KEY[1] ;# KEY[1]
- # set_location_assignment PIN_T22 -to KEY[2] ;# KEY[2]
- # set_location_assignment PIN_T21 -to KEY[3] ;# KEY[3]
- ;################################
- ;# Slide Switches ('1' when up) #
- ;################################
- set_location_assignment PIN_L22 -to reset ;# SW0
- # set_location_assignment PIN_L21 -to SW[1] ;# SW1
- # set_location_assignment PIN_M22 -to SW[2] ;# SW2
- # set_location_assignment PIN_V12 -to SW[3] ;# SW3
- # set_location_assignment PIN_W12 -to SW[4] ;# SW4
- # set_location_assignment PIN_U12 -to SW[5] ;# SW5
- # set_location_assignment PIN_U11 -to SW[6] ;# SW6
- # set_location_assignment PIN_M2 -to SW[7] ;# SW7
- # set_location_assignment PIN_M1 -to SW[8] ;# SW8
- # set_location_assignment PIN_L2 -to SW[9] ;# SW9
- ;################
- ;# 8 Green LEDs #
- ;################
- # set_location_assignment PIN_U22 -to LEDG[0] ;# LEDG[0]
- # set_location_assignment PIN_U21 -to LEDG[1] ;# LEDG[1]
- # set_location_assignment PIN_V22 -to LEDG[2] ;# LEDG[2]
- # set_location_assignment PIN_V21 -to LEDG[3] ;# LEDG[3]
- # set_location_assignment PIN_W22 -to LEDG[4] ;# LEDG[4]
- # set_location_assignment PIN_W21 -to LEDG[5] ;# LEDG[5]
- # set_location_assignment PIN_Y22 -to LEDG[6] ;# LEDG[6]
- # set_location_assignment PIN_Y21 -to LEDG[7] ;# LEDG[7]
- ;###############
- ;# 10 red LEDs #
- ;###############
- set_location_assignment PIN_R20 -to diode ;# LEDR[0]
- # set_location_assignment PIN_R19 -to LEDR[1] ;# LEDR[1]
- # set_location_assignment PIN_U19 -to LEDR[2] ;# LEDR[2]
- # set_location_assignment PIN_Y19 -to LEDR[3] ;# LEDR[3]
- # set_location_assignment PIN_T18 -to LEDR[4] ;# LEDR[4]
- # set_location_assignment PIN_V19 -to LEDR[5] ;# LEDR[5]
- # set_location_assignment PIN_Y18 -to LEDR[6] ;# LEDR[6]
- # set_location_assignment PIN_U18 -to LEDR[7] ;# LEDR[7]
- # set_location_assignment PIN_R18 -to LEDR[8] ;# LEDR[8]
- # set_location_assignment PIN_R17 -to LEDR[9] ;# LEDR[9]
- ;###############################
- ;# 7 * Seven Segments #
- ;# a=6 b=5 c=4 d=3 e=2 f=1 g=0 #
- ;# DP is not connected ! #
- ;# Active low (ON when '0') #
- ;###############################
- # set_location_assignment PIN_E2 -to HEX0S[6] ;# a HEX0S[6]
- # set_location_assignment PIN_F1 -to HEX0S[5] ;# b HEX0S[5]
- # set_location_assignment PIN_F2 -to HEX0S[4] ;# c HEX0S[4]
- # set_location_assignment PIN_H1 -to HEX0S[3] ;# d HEX0S[3]
- # set_location_assignment PIN_H2 -to HEX0S[2] ;# e HEX0S[2]
- # set_location_assignment PIN_J1 -to HEX0S[1] ;# f HEX0S[1]
- # set_location_assignment PIN_J2 -to HEX0S[0] ;# g HEX0S[0]
- # set_location_assignment PIN_D1 -to HEX1S[6] ;# a HEX1S[6]
- # set_location_assignment PIN_D2 -to HEX1S[5] ;# b HEX1S[5]
- # set_location_assignment PIN_G3 -to HEX1S[4] ;# c HEX1S[4]
- # set_location_assignment PIN_H4 -to HEX1S[3] ;# d HEX1S[3]
- # set_location_assignment PIN_H5 -to HEX1S[2] ;# e HEX1S[2]
- # set_location_assignment PIN_H6 -to HEX1S[1] ;# f HEX1S[1]
- # set_location_assignment PIN_E1 -to HEX1S[0] ;# g HEX1S[0]
- # set_location_assignment PIN_D3 -to HEX2S[6] ;# a HEX2S[6]
- # set_location_assignment PIN_E4 -to HEX2S[5] ;# b HEX2S[5]
- # set_location_assignment PIN_E3 -to HEX2S[4] ;# c HEX2S[4]
- # set_location_assignment PIN_C1 -to HEX2S[3] ;# d HEX2S[3]
- # set_location_assignment PIN_C2 -to HEX2S[2] ;# e HEX2S[2]
- # set_location_assignment PIN_G6 -to HEX2S[1] ;# f HEX2S[1]
- # set_location_assignment PIN_G5 -to HEX2S[0] ;# g HEX2S[0]
- # set_location_assignment PIN_D4 -to HEX3[6] ;# a HEX3S[6]
- # set_location_assignment PIN_F3 -to HEX3[5] ;# b HEX3S[5]
- # set_location_assignment PIN_L8 -to HEX3[4] ;# c HEX3S[4]
- # set_location_assignment PIN_J4 -to HEX3[3] ;# d HEX3S[3]
- # set_location_assignment PIN_D6 -to HEX3[2] ;# e HEX3S[2]
- # set_location_assignment PIN_D5 -to HEX3[1] ;# f HEX3S[1]
- # set_location_assignment PIN_F4 -to HEX3[0] ;# g HEX3S[0]
- ;##################################
- ;# UART (serial port) pin signals #
- ;##################################
- # set_location_assignment PIN_F14 -to RX
- #set_location_assignment PIN_G12 -to TX
- ;#################
- ;## Audio CODEC ##
- ;#################
- # set_location_assignment PIN_A6 -to AUD_ADCLRCK
- # set_location_assignment PIN_B6 -to AUD_ADCDAT
- # set_location_assignment PIN_A5 -to AUD_DACLRCK
- # set_location_assignment PIN_B5 -to AUD_DACDAT
- # set_location_assignment PIN_B4 -to AUD_XCK
- # set_location_assignment PIN_A4 -to AUD_BCLK
- ;#####################
- ;# I2C control lines #
- ;#####################
- # set_location_assignment PIN_A3 -to I2C_SCLK
- # set_location_assignment PIN_B3 -to I2C_SDAT
- ;#################
- ;# VGA interface #
- ;#################
- # set_location_assignment PIN_D9 -to RED[0]
- # set_location_assignment PIN_C9 -to RED[1]
- # set_location_assignment PIN_A7 -to RED[2]
- # set_location_assignment PIN_B7 -to RED[3]
- # set_location_assignment PIN_B8 -to GREEN[0]
- # set_location_assignment PIN_C10 -to GREEN[1]
- # set_location_assignment PIN_B9 -to GREEN[2]
- # set_location_assignment PIN_A8 -to GREEN[3]
- # set_location_assignment PIN_A9 -to BLUE[0]
- # set_location_assignment PIN_D11 -to BLUE[1]
- # set_location_assignment PIN_A10 -to BLUE[2]
- # set_location_assignment PIN_B10 -to BLUE[3]
- # set_location_assignment PIN_A11 -to HORIZ_SYNC
- # set_location_assignment PIN_B11 -to VERT_SYNC
- ;#################
- ;# PS2 interface #
- ;#################
- # set_location_assignment PIN_H15 -to PS2_CLK
- # set_location_assignment PIN_J14 -to PS2_DAT
- ;#####################
- ;# SD Card interface #
- ;#####################
- # set_location_assignment PIN_V20 -to SD_CLK
- # set_location_assignment PIN_Y20 -to SD_CMD
- # set_location_assignment PIN_W20 -to SD_DAT
- # set_location_assignment PIN_U20 -to SD_DAT3
- ;########
- ;# SRAM #
- ;########
- ;# SRAM address
- # set_location_assignment PIN_AA3 -to SRAM_ADDR[0]
- # set_location_assignment PIN_AB3 -to SRAM_ADDR[1]
- # set_location_assignment PIN_AA4 -to SRAM_ADDR[2]
- # set_location_assignment PIN_AB4 -to SRAM_ADDR[3]
- # set_location_assignment PIN_AA5 -to SRAM_ADDR[4]
- # set_location_assignment PIN_AB10 -to SRAM_ADDR[5]
- # set_location_assignment PIN_AA11 -to SRAM_ADDR[6]
- # set_location_assignment PIN_AB11 -to SRAM_ADDR[7]
- # set_location_assignment PIN_V11 -to SRAM_ADDR[8]
- # set_location_assignment PIN_W11 -to SRAM_ADDR[9]
- # set_location_assignment PIN_R11 -to SRAM_ADDR[10]
- # set_location_assignment PIN_T11 -to SRAM_ADDR[11]
- # set_location_assignment PIN_Y10 -to SRAM_ADDR[12]
- # set_location_assignment PIN_U10 -to SRAM_ADDR[13]
- # set_location_assignment PIN_R10 -to SRAM_ADDR[14]
- # set_location_assignment PIN_T7 -to SRAM_ADDR[15]
- # set_location_assignment PIN_Y6 -to SRAM_ADDR[16]
- # set_location_assignment PIN_Y5 -to SRAM_ADDR[17]
- ;# SRAM data
- # set_location_assignment PIN_AA6 -to SRAM_DQ[0]
- # set_location_assignment PIN_AB6 -to SRAM_DQ[1]
- # set_location_assignment PIN_AA7 -to SRAM_DQ[2]
- # set_location_assignment PIN_AB7 -to SRAM_DQ[3]
- # set_location_assignment PIN_AA8 -to SRAM_DQ[4]
- # set_location_assignment PIN_AB8 -to SRAM_DQ[5]
- # set_location_assignment PIN_AA9 -to SRAM_DQ[6]
- # set_location_assignment PIN_AB9 -to SRAM_DQ[7]
- # set_location_assignment PIN_Y9 -to SRAM_DQ[8]
- # set_location_assignment PIN_W9 -to SRAM_DQ[9]
- # set_location_assignment PIN_V9 -to SRAM_DQ[10]
- # set_location_assignment PIN_U9 -to SRAM_DQ[11]
- # set_location_assignment PIN_R9 -to SRAM_DQ[12]
- # set_location_assignment PIN_W8 -to SRAM_DQ[13]
- # set_location_assignment PIN_V8 -to SRAM_DQ[14]
- # set_location_assignment PIN_U8 -to SRAM_DQ[15]
- ;# SRAM controls
- # set_location_assignment PIN_AB5 -to SRAM_CE_N
- # set_location_assignment PIN_Y7 -to SRAM_LB_N
- # set_location_assignment PIN_T8 -to SRAM_OE_N
- # set_location_assignment PIN_W7 -to SRAM_UB_N
- # set_location_assignment PIN_AA10 -to SRAM_WE_N
- ;#########
- ;# SDRAM #
- ;#########
- ;# SDRASM address
- # set_location_assignment PIN_W4 -to DRAM_ADDR[0]
- # set_location_assignment PIN_W5 -to DRAM_ADDR[1]
- # set_location_assignment PIN_Y3 -to DRAM_ADDR[2]
- # set_location_assignment PIN_Y4 -to DRAM_ADDR[3]
- # set_location_assignment PIN_R6 -to DRAM_ADDR[4]
- # set_location_assignment PIN_R5 -to DRAM_ADDR[5]
- # set_location_assignment PIN_P6 -to DRAM_ADDR[6]
- # set_location_assignment PIN_P5 -to DRAM_ADDR[7]
- # set_location_assignment PIN_P3 -to DRAM_ADDR[8]
- # set_location_assignment PIN_N4 -to DRAM_ADDR[9]
- # set_location_assignment PIN_W3 -to DRAM_ADDR[10]
- # set_location_assignment PIN_N6 -to DRAM_ADDR[11]
- ;# SDRASM data
- # set_location_assignment PIN_U1 -to DRAM_DQ[0]
- # set_location_assignment PIN_U2 -to DRAM_DQ[1]
- # set_location_assignment PIN_V1 -to DRAM_DQ[2]
- # set_location_assignment PIN_V2 -to DRAM_DQ[3]
- # set_location_assignment PIN_W1 -to DRAM_DQ[4]
- # set_location_assignment PIN_W2 -to DRAM_DQ[5]
- # set_location_assignment PIN_Y1 -to DRAM_DQ[6]
- # set_location_assignment PIN_Y2 -to DRAM_DQ[7]
- # set_location_assignment PIN_N1 -to DRAM_DQ[8]
- # set_location_assignment PIN_N2 -to DRAM_DQ[9]
- # set_location_assignment PIN_P1 -to DRAM_DQ[10]
- # set_location_assignment PIN_P2 -to DRAM_DQ[11]
- # set_location_assignment PIN_R1 -to DRAM_DQ[12]
- # set_location_assignment PIN_R2 -to DRAM_DQ[13]
- # set_location_assignment PIN_T1 -to DRAM_DQ[14]
- # set_location_assignment PIN_T2 -to DRAM_DQ[15]
- ;# SDRASM controls
- # set_location_assignment PIN_U3 -to DRAM_BA_0
- # set_location_assignment PIN_V4 -to DRAM_BA_1
- # set_location_assignment PIN_T3 -to DRAM_CAS_N
- # set_location_assignment PIN_N3 -to DRAM_CKE
- # set_location_assignment PIN_U4 -to DRAM_CLK
- # set_location_assignment PIN_T6 -to DRAM_CS_N
- # set_location_assignment PIN_R7 -to DRAM_LDQM
- # set_location_assignment PIN_T5 -to DRAM_RAS_N
- # set_location_assignment PIN_M5 -to DRAM_UDQM
- # set_location_assignment PIN_R8 -to DRAM_WE_N
- ;################
- ;# FLASH Memory #
- ;################
- ;# FLASH address
- # set_location_assignment PIN_AB20 -to FL_ADDR[0]
- # set_location_assignment PIN_AA14 -to FL_ADDR[1]
- # set_location_assignment PIN_Y16 -to FL_ADDR[2]
- # set_location_assignment PIN_R15 -to FL_ADDR[3]
- # set_location_assignment PIN_T15 -to FL_ADDR[4]
- # set_location_assignment PIN_U15 -to FL_ADDR[5]
- # set_location_assignment PIN_V15 -to FL_ADDR[6]
- # set_location_assignment PIN_W15 -to FL_ADDR[7]
- # set_location_assignment PIN_R14 -to FL_ADDR[8]
- # set_location_assignment PIN_Y13 -to FL_ADDR[9]
- # set_location_assignment PIN_R12 -to FL_ADDR[10]
- # set_location_assignment PIN_T12 -to FL_ADDR[11]
- # set_location_assignment PIN_AB14 -to FL_ADDR[12]
- # set_location_assignment PIN_AA13 -to FL_ADDR[13]
- # set_location_assignment PIN_AB13 -to FL_ADDR[14]
- # set_location_assignment PIN_AA12 -to FL_ADDR[15]
- # set_location_assignment PIN_AB12 -to FL_ADDR[16]
- # set_location_assignment PIN_AA20 -to FL_ADDR[17]
- # set_location_assignment PIN_U14 -to FL_ADDR[18]
- # set_location_assignment PIN_V14 -to FL_ADDR[19]
- # set_location_assignment PIN_U13 -to FL_ADDR[20]
- # set_location_assignment PIN_R13 -to FL_ADDR[21]
- # set_location_assignment PIN_AB16 -to FL_DQ[0]
- # set_location_assignment PIN_AA16 -to FL_DQ[1]
- # set_location_assignment PIN_AB17 -to FL_DQ[2]
- # set_location_assignment PIN_AA17 -to FL_DQ[3]
- # set_location_assignment PIN_AB18 -to FL_DQ[4]
- # set_location_assignment PIN_AA18 -to FL_DQ[5]
- # set_location_assignment PIN_AB19 -to FL_DQ[6]
- # set_location_assignment PIN_AA19 -to FL_DQ[7]
- # set_location_assignment PIN_AA15 -to FL_OE_N
- # set_location_assignment PIN_W14 -to FL_RST_N
- # set_location_assignment PIN_Y14 -to FL_WE_N
- ;#####################################
- ;# JP1 - the left connector (GPIO 0) #
- ;#####################################
- # set_location_assignment PIN_A13 -to GPIO_0[0]
- # set_location_assignment PIN_B13 -to GPIO_0[1]
- # set_location_assignment PIN_A14 -to GPIO_0[2]
- # set_location_assignment PIN_B14 -to GPIO_0[3]
- # set_location_assignment PIN_A15 -to GPIO_0[4]
- # set_location_assignment PIN_B15 -to GPIO_0[5]
- # set_location_assignment PIN_A16 -to GPIO_0[6]
- # set_location_assignment PIN_B16 -to GPIO_0[7]
- # set_location_assignment PIN_A17 -to GPIO_0[8]
- # set_location_assignment PIN_B17 -to GPIO_0[9]
- # set_location_assignment PIN_A18 -to GPIO_0[10]
- # set_location_assignment PIN_B18 -to GPIO_0[11]
- # set_location_assignment PIN_A19 -to GPIO_0[12]
- # set_location_assignment PIN_B19 -to GPIO_0[13]
- # set_location_assignment PIN_A20 -to GPIO_0[14]
- # set_location_assignment PIN_B20 -to GPIO_0[15]
- # set_location_assignment PIN_C21 -to GPIO_0[16]
- # set_location_assignment PIN_C22 -to GPIO_0[17]
- # set_location_assignment PIN_D21 -to GPIO_0[18]
- # set_location_assignment PIN_D22 -to GPIO_0[19]
- # set_location_assignment PIN_E21 -to GPIO_0[20]
- # set_location_assignment PIN_E22 -to GPIO_0[21]
- # set_location_assignment PIN_F21 -to GPIO_0[22]
- # set_location_assignment PIN_F22 -to GPIO_0[23]
- # set_location_assignment PIN_G21 -to GPIO_0[24]
- # set_location_assignment PIN_G22 -to GPIO_0[25]
- # set_location_assignment PIN_J21 -to GPIO_0[26]
- # set_location_assignment PIN_J22 -to GPIO_0[27]
- # set_location_assignment PIN_K21 -to GPIO_0[28]
- # set_location_assignment PIN_K22 -to GPIO_0[29]
- # set_location_assignment PIN_J19 -to GPIO_0[30]
- # set_location_assignment PIN_J20 -to GPIO_0[31]
- # set_location_assignment PIN_J18 -to GPIO_0[32]
- # set_location_assignment PIN_K20 -to GPIO_0[33]
- # set_location_assignment PIN_L19 -to GPIO_0[34]
- # set_location_assignment PIN_L18 -to GPIO_0[35]
- ;######################################
- ;# JP2 - the right connector (GPIO 1) #
- ;######################################
- set_location_assignment PIN_H12 -to TX
- set_location_assignment PIN_H13 -to RX
- # set_location_assignment PIN_H14 -to GPIO_1[2]
- # set_location_assignment PIN_G15 -to GPIO_1[3]
- # set_location_assignment PIN_E14 -to GPIO_1[4]
- # set_location_assignment PIN_E15 -to GPIO_1[5]
- # set_location_assignment PIN_F15 -to GPIO_1[6]
- # set_location_assignment PIN_G16 -to GPIO_1[7]
- # set_location_assignment PIN_F12 -to GPIO_1[8]
- # set_location_assignment PIN_F13 -to GPIO_1[9]
- # set_location_assignment PIN_C14 -to GPIO_1[10]
- # set_location_assignment PIN_D14 -to GPIO_1[11]
- # set_location_assignment PIN_D15 -to GPIO_1[12]
- # set_location_assignment PIN_D16 -to GPIO_1[13]
- # set_location_assignment PIN_C17 -to GPIO_1[14]
- # set_location_assignment PIN_C18 -to GPIO_1[15]
- # set_location_assignment PIN_C19 -to GPIO_1[16]
- # set_location_assignment PIN_C20 -to GPIO_1[17]
- # set_location_assignment PIN_D19 -to GPIO_1[18]
- # set_location_assignment PIN_D20 -to GPIO_1[19]
- # set_location_assignment PIN_E20 -to GPIO_1[20]
- # set_location_assignment PIN_F20 -to GPIO_1[21]
- # set_location_assignment PIN_E19 -to GPIO_1[22]
- # set_location_assignment PIN_E18 -to GPIO_1[23]
- # set_location_assignment PIN_G20 -to GPIO_1[24]
- # set_location_assignment PIN_G18 -to GPIO_1[25]
- # set_location_assignment PIN_G17 -to GPIO_1[26]
- # set_location_assignment PIN_H17 -to GPIO_1[27]
- # set_location_assignment PIN_J15 -to GPIO_1[28]
- # set_location_assignment PIN_H18 -to GPIO_1[29]
- # set_location_assignment PIN_N22 -to GPIO_1[30]
- # set_location_assignment PIN_N21 -to GPIO_1[31]
- # set_location_assignment PIN_P15 -to GPIO_1[32]
- # set_location_assignment PIN_N15 -to GPIO_1[33]
- # set_location_assignment PIN_P17 -to GPIO_1[34]
- # set_location_assignment PIN_P18 -to GPIO_1[35]
- ;#############
- ;# JTAG pins #
- ;#############
- # set_location_assignment PIN_E8 -to TDI
- # set_location_assignment PIN_D8 -to TCS
- # set_location_assignment PIN_C7 -to TCK
- # set_location_assignment PIN_D7 -to TDO
- ;##############################################
- ;# Device selection & Making connections safe #
- ;##############################################
- ;# Analysis & Synthesis Assignments
- set_global_assignment -name FAMILY "Cyclone II"
- set_global_assignment -name DEVICE_FILTER_PACKAGE FBGA
- set_global_assignment -name DEVICE_FILTER_PIN_COUNT 484
- set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 7
- ;# fitter assignments
- set_global_assignment -name DEVICE "EP2C20F484C7"
- set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
- set_global_assignment -name EDA_SIMULATION_TOOL "ModelSim-Altera (VHDL)"
- set_global_assignment -name EDA_OUTPUT_DATA_FORMAT VHDL -section_id eda_simulation
- puts " And making the design safer ! "
- puts "================================="
- ;# run compilation after pin assignment
- # load_package flow
- # execute_flow -compile
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement