将按键的信号读取出来,用LED灯进行显示,当然,这里没有使用按键消抖。
module key(key,LED);
//programmed by haohaolinux
input key;
output LED;
assign LED=key?1:0;
endmodule
对应TCL文件:
#------------------GLOBAL--------------------#
set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
set_global_assignment -name ENABLE_INIT_DONE_OUTPUT OFF
set_location_assignment PIN_112 -to key
set_location_assignment PIN_128 -to LED