From bc24ae901b74c5b673837d7f83423c1f7aa45c29 Mon Sep 17 00:00:00 2001 From: James McKenzie Date: Fri, 18 Apr 2025 12:37:26 +0100 Subject: fish --- smh-ac415-fpga/examples/04_touch/touch/touch.qpf | 30 ++++++++++++ smh-ac415-fpga/examples/04_touch/touch/touch.qsf | 59 +++++++++++++++++++++++ smh-ac415-fpga/examples/04_touch/touch/touch.qws | Bin 0 -> 1846 bytes smh-ac415-fpga/examples/04_touch/touch/touch.v | 38 +++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 smh-ac415-fpga/examples/04_touch/touch/touch.qpf create mode 100644 smh-ac415-fpga/examples/04_touch/touch/touch.qsf create mode 100644 smh-ac415-fpga/examples/04_touch/touch/touch.qws create mode 100644 smh-ac415-fpga/examples/04_touch/touch/touch.v (limited to 'smh-ac415-fpga/examples/04_touch/touch') diff --git a/smh-ac415-fpga/examples/04_touch/touch/touch.qpf b/smh-ac415-fpga/examples/04_touch/touch/touch.qpf new file mode 100644 index 0000000..6a3b058 --- /dev/null +++ b/smh-ac415-fpga/examples/04_touch/touch/touch.qpf @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------- # +# +# Copyright (C) 1991-2013 Altera Corporation +# Your use of Altera Corporation's design tools, logic functions +# and other software and tools, and its AMPP partner logic +# functions, and any output files from any of the foregoing +# (including device programming or simulation files), and any +# associated documentation or information are expressly subject +# to the terms and conditions of the Altera Program License +# Subscription Agreement, Altera MegaCore Function License +# Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by +# Altera or its authorized distributors. Please refer to the +# applicable agreement for further details. +# +# -------------------------------------------------------------------------- # +# +# Quartus II 64-Bit +# Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Full Version +# Date created = 02:54:06 June 02, 2023 +# +# -------------------------------------------------------------------------- # + +QUARTUS_VERSION = "13.0" +DATE = "02:54:06 June 02, 2023" + +# Revisions + +PROJECT_REVISION = "touch" diff --git a/smh-ac415-fpga/examples/04_touch/touch/touch.qsf b/smh-ac415-fpga/examples/04_touch/touch/touch.qsf new file mode 100644 index 0000000..9bfa3c8 --- /dev/null +++ b/smh-ac415-fpga/examples/04_touch/touch/touch.qsf @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------- # +# +# Copyright (C) 1991-2013 Altera Corporation +# Your use of Altera Corporation's design tools, logic functions +# and other software and tools, and its AMPP partner logic +# functions, and any output files from any of the foregoing +# (including device programming or simulation files), and any +# associated documentation or information are expressly subject +# to the terms and conditions of the Altera Program License +# Subscription Agreement, Altera MegaCore Function License +# Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by +# Altera or its authorized distributors. Please refer to the +# applicable agreement for further details. +# +# -------------------------------------------------------------------------- # +# +# Quartus II 64-Bit +# Version 13.0.1 Build 232 06/12/2013 Service Pack 1 SJ Full Version +# Date created = 02:54:06 June 02, 2023 +# +# -------------------------------------------------------------------------- # +# +# Notes: +# +# 1) The default values for assignments are stored in the file: +# touch_assignment_defaults.qdf +# If this file doesn't exist, see file: +# assignment_defaults.qdf +# +# 2) Altera recommends that you do not modify this file. This +# file is updated automatically by the Quartus II software +# and any changes you make may be lost or overwritten. +# +# -------------------------------------------------------------------------- # + + +set_global_assignment -name FAMILY "Cyclone IV E" +set_global_assignment -name DEVICE EP4CE15F23C8 +set_global_assignment -name TOP_LEVEL_ENTITY touch +set_global_assignment -name ORIGINAL_QUARTUS_VERSION "13.0 SP1" +set_global_assignment -name PROJECT_CREATION_TIME_DATE "02:54:06 JUNE 02, 2023" +set_global_assignment -name LAST_QUARTUS_VERSION "13.0 SP1" +set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files +set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 +set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 +set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1 +set_global_assignment -name NOMINAL_CORE_SUPPLY_VOLTAGE 1.2V +set_global_assignment -name VERILOG_FILE touch.v +set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top +set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top +set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top +set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "2.5 V" +set_location_assignment PIN_AB16 -to led +set_location_assignment PIN_T22 -to sys_clk +set_location_assignment PIN_U20 -to sys_rst_n +set_location_assignment PIN_G9 -to touch_key +set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/smh-ac415-fpga/examples/04_touch/touch/touch.qws b/smh-ac415-fpga/examples/04_touch/touch/touch.qws new file mode 100644 index 0000000..7232112 Binary files /dev/null and b/smh-ac415-fpga/examples/04_touch/touch/touch.qws differ diff --git a/smh-ac415-fpga/examples/04_touch/touch/touch.v b/smh-ac415-fpga/examples/04_touch/touch/touch.v new file mode 100644 index 0000000..dcf9d12 --- /dev/null +++ b/smh-ac415-fpga/examples/04_touch/touch/touch.v @@ -0,0 +1,38 @@ +`timescale 1ns/1ns + +module touch +( + input wire sys_clk , + input wire sys_rst_n , + input wire touch_key , + + output reg led +); + +wire touch_en ; + +//reg define +reg touch_key_dly1 ; +reg touch_key_dly2 ; + +assign touch_en = touch_key_dly2 & (~touch_key_dly1); + +always@(posedge sys_clk or negedge sys_rst_n) + if(sys_rst_n == 1'b0) + begin + touch_key_dly1 <= 1'b0; + touch_key_dly2 <= 1'b0; + end + else + begin + touch_key_dly1 <= touch_key; + touch_key_dly2 <= touch_key_dly1; + end + +always@(posedge sys_clk or negedge sys_rst_n) + if(sys_rst_n == 1'b0) + led <= 1'b1; + else if(touch_en == 1'b1) + led <= ~led; + +endmodule -- cgit v1.2.3