diff --git a/Quartus/v6/jyh_4490_6.qpf b/Quartus/v6/jyh_4490_6.qpf new file mode 100644 index 0000000..f8aa0af --- /dev/null +++ b/Quartus/v6/jyh_4490_6.qpf @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------- # +# +# Copyright (C) 2021 Intel Corporation. All rights reserved. +# Your use of Intel Corporation's design tools, logic functions +# and other software and tools, and any 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 Intel Program License +# Subscription Agreement, the Intel Quartus Prime License Agreement, +# the Intel FPGA IP License Agreement, or other applicable license +# agreement, including, without limitation, that your use is for +# the sole purpose of programming logic devices manufactured by +# Intel and sold by Intel or its authorized distributors. Please +# refer to the applicable agreement for further details, at +# https://fpgasoftware.intel.com/eula. +# +# -------------------------------------------------------------------------- # +# +# Quartus Prime +# Version 21.1.0 Build 842 10/21/2021 SJ Lite Edition +# Date created = 21:39:46 五月 09, 2022 +# +# -------------------------------------------------------------------------- # + +QUARTUS_VERSION = "21.1" +DATE = "21:39:46 五月 09, 2022" + +# Revisions + +PROJECT_REVISION = "jyh_4490_6" diff --git a/Quartus/v6/jyh_4490_6.qsf b/Quartus/v6/jyh_4490_6.qsf new file mode 100644 index 0000000..d41cb51 --- /dev/null +++ b/Quartus/v6/jyh_4490_6.qsf @@ -0,0 +1,56 @@ +# -------------------------------------------------------------------------- # +# +# Copyright (C) 2021 Intel Corporation. All rights reserved. +# Your use of Intel Corporation's design tools, logic functions +# and other software and tools, and any 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 Intel Program License +# Subscription Agreement, the Intel Quartus Prime License Agreement, +# the Intel FPGA IP License Agreement, or other applicable license +# agreement, including, without limitation, that your use is for +# the sole purpose of programming logic devices manufactured by +# Intel and sold by Intel or its authorized distributors. Please +# refer to the applicable agreement for further details, at +# https://fpgasoftware.intel.com/eula. +# +# -------------------------------------------------------------------------- # +# +# Quartus Prime +# Version 21.1.0 Build 842 10/21/2021 SJ Lite Edition +# Date created = 21:39:46 五月 09, 2022 +# +# -------------------------------------------------------------------------- # +# +# Notes: +# +# 1) The default values for assignments are stored in the file: +# jyh_4490_6_assignment_defaults.qdf +# If this file doesn't exist, see file: +# assignment_defaults.qdf +# +# 2) Intel recommends that you do not modify this file. This +# file is updated automatically by the Quartus Prime software +# and any changes you make may be lost or overwritten. +# +# -------------------------------------------------------------------------- # + + +set_global_assignment -name FAMILY "Cyclone IV E" +set_global_assignment -name DEVICE EP4CE6E22C8 +set_global_assignment -name TOP_LEVEL_ENTITY jyh_4490_mstate +set_global_assignment -name ORIGINAL_QUARTUS_VERSION 21.1.0 +set_global_assignment -name PROJECT_CREATION_TIME_DATE "21:39:46 五月 09, 2022" +set_global_assignment -name LAST_QUARTUS_VERSION "21.1.0 Lite Edition" +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 jyh_4490_mstate.v +set_global_assignment -name VERILOG_FILE jyh_4490_6_testbench.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_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/Quartus/v6/jyh_4490_6_testbench.v b/Quartus/v6/jyh_4490_6_testbench.v new file mode 100644 index 0000000..bd66a0d --- /dev/null +++ b/Quartus/v6/jyh_4490_6_testbench.v @@ -0,0 +1,44 @@ +`timescale 1ns/1ns +module jyh_4490_6_testbench; +reg clk; +reg in; +reg en; +wire out; +wire [19:0] cnt; + +initial begin + clk=0; + in=0; + en=1; +end + +always#10 clk=~clk; +always#20000000 +begin + in=0; + repeat(5) + begin + in=1; + #1000000; + in=0; + #1000000; + end + in=1; + #35000000 + repeat(5) + begin + in=0; + #1000000; + in=1; + #1000000; + end + in=0; +end + +jyh_4490_mstate M1( +.clk(clk), +.in(in), +.out(out), +.cnt(cnt)); + +endmodule \ No newline at end of file diff --git a/Quartus/v6/jyh_4490_mstate.v b/Quartus/v6/jyh_4490_mstate.v new file mode 100644 index 0000000..c8d2660 --- /dev/null +++ b/Quartus/v6/jyh_4490_mstate.v @@ -0,0 +1,53 @@ +module jyh_4490_mstate(clk,in,en,out,cnt); +input clk,in,en; +output reg out; +output reg [19:0] cnt=0; +reg[1:0] state=0; +parameter s0=0,s1=1,s2=2,s3=3; +parameter TARGET=750000; //50mhz 15ms + +always @(posedge clk) +if(!en) + state=s0; +else + case(state) + s0: + begin + if(in) + state=s1; + out=0; + end + s1: + if(cnt 500 megabyte memory footprint). Default is disabled. +; Specify number of megabytes to lock. +; LockedMemory = 1000 + +; Turn on (1) or off (0) WLF file compression. +; The default is 1 (compress WLF file). +; WLFCompress = 0 + +; Specify whether to save all design hierarchy (1) in the WLF file +; or only regions containing logged signals (0). +; The default is 0 (save only regions with logged signals). +; WLFSaveAllRegions = 1 + +; WLF file time limit. Limit WLF file by time, as closely as possible, +; to the specified amount of simulation time. When the limit is exceeded +; the earliest times get truncated from the file. +; If both time and size limits are specified the most restrictive is used. +; UserTimeUnits are used if time units are not specified. +; The default is 0 (no limit). Example: WLFTimeLimit = {100 ms} +; WLFTimeLimit = 0 + +; WLF file size limit. Limit WLF file size, as closely as possible, +; to the specified number of megabytes. If both time and size limits +; are specified then the most restrictive is used. +; The default is 0 (no limit). +; WLFSizeLimit = 1000 + +; Specify whether or not a WLF file should be deleted when the +; simulation ends. A value of 1 will cause the WLF file to be deleted. +; The default is 0 (do not delete WLF file when simulation ends). +; WLFDeleteOnQuit = 1 + +; Automatic SDF compilation +; Disables automatic compilation of SDF files in flows that support it. +; Default is on, uncomment to turn off. +; NoAutoSDFCompile = 1 + +[lmc] + +[msg_system] +suppress = 3116 +; Change a message severity or suppress a message. +; The format is: = [,...] +; Examples: +; note = 3009 +; warning = 3033 +; error = 3010,3016 +; fatal = 3016,3033 +; suppress = 3009,3016,3043 +; The command verror can be used to get the complete +; description of a message. + +; Control transcripting of elaboration/runtime messages. +; The default is to have messages appear in the transcript and +; recorded in the wlf file (messages that are recorded in the +; wlf file can be viewed in the MsgViewer). The other settings +; are to send messages only to the transcript or only to the +; wlf file. The valid values are +; both {default} +; tran {transcript only} +; wlf {wlf file only} +; msgmode = both +[Project] +** Warning: ; Warning -- Do not edit the project properties directly. +; Property names are dynamic in nature and property +; values have special syntax. Changing property data directly +; can result in a corrupt MPF file. All project properties +; can be modified through project window dialogs. +Project_Version = 6 +Project_DefaultLib = work +Project_SortMethod = unused +Project_Files_Count = 2 +Project_File_0 = /home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v +Project_File_P_0 = cover_toggle 0 file_type verilog group_id 0 cover_exttoggle 0 cover_nofec 0 cover_cond 0 vlog_1995compat 0 vlog_nodebug 0 cover_branch 0 vlog_noload 0 folder {Top Level} last_compile 1652112121 cover_fsm 0 vlog_enable0In 0 cover_excludedefault 0 vlog_disableopt 0 cover_covercells 0 cover_optlevel 3 vlog_hazard 0 vlog_showsource 0 voptflow 1 ood 0 vlog_0InOptions {} toggle - vlog_options {} compile_to work vlog_upper 0 cover_noshort 0 compile_order 0 dont_compile 0 cover_expr 0 cover_stmt 0 +Project_File_1 = /home/ir/Documents/codelib/Quartus/v6/jyh_4490_mstate.v +Project_File_P_1 = cover_toggle 0 file_type verilog group_id 0 cover_exttoggle 0 cover_nofec 0 cover_cond 0 vlog_1995compat 0 vlog_nodebug 0 last_compile 1652112079 cover_fsm 0 cover_branch 0 vlog_noload 0 folder {Top Level} cover_excludedefault 0 vlog_enable0In 0 vlog_disableopt 0 cover_covercells 0 voptflow 1 vlog_showsource 0 vlog_hazard 0 cover_optlevel 3 toggle - vlog_0InOptions {} ood 0 cover_noshort 0 vlog_upper 0 compile_to work vlog_options {} compile_order 1 cover_expr 0 dont_compile 0 cover_stmt 0 +Project_Sim_Count = 1 +Project_Sim_0 = Simulation 1 +Project_Sim_P_0 = -L {} -Lf {} -sdf {} selected_du {} additional_dus work.jyh_4490_6_testbench folder {Top Level} ok 1 -t default timing default +plusarg {} -nofileshare 0 -sdfnowarn 0 -wlf {} OtherArgs {} -coverage 0 -sdfnoerror 0 -std_input {} -hazards 0 -noglitch 0 -absentisempty 0 +no_pulse_msg 0 -sc22 0 +pulse_r {} -assertfile {} -multisource_delay {} -vital2.2b 0 +notimingchecks 0 +pulse_e {} -std_output {} vopt_env 1 is_vopt_flow 0 Generics {} +Project_Folder_Count = 0 +Echo_Compile_Output = 0 +Save_Compile_Report = 1 +Project_Opt_Count = 0 +ForceSoftPaths = 0 +ProjectStatusDelay = 5000 +VERILOG_DoubleClick = Edit +VERILOG_CustomDoubleClick = +SYSTEMVERILOG_DoubleClick = Edit +SYSTEMVERILOG_CustomDoubleClick = +VHDL_DoubleClick = Edit +VHDL_CustomDoubleClick = +PSL_DoubleClick = Edit +PSL_CustomDoubleClick = +TEXT_DoubleClick = Edit +TEXT_CustomDoubleClick = +SYSTEMC_DoubleClick = Edit +SYSTEMC_CustomDoubleClick = +TCL_DoubleClick = Edit +TCL_CustomDoubleClick = +MACRO_DoubleClick = Edit +MACRO_CustomDoubleClick = +VCD_DoubleClick = Edit +VCD_CustomDoubleClick = +SDF_DoubleClick = Edit +SDF_CustomDoubleClick = +XML_DoubleClick = Edit +XML_CustomDoubleClick = +LOGFILE_DoubleClick = Edit +LOGFILE_CustomDoubleClick = +UCDB_DoubleClick = Edit +UCDB_CustomDoubleClick = +TDB_DoubleClick = Edit +TDB_CustomDoubleClick = +UPF_DoubleClick = Edit +UPF_CustomDoubleClick = +PCF_DoubleClick = Edit +PCF_CustomDoubleClick = +PROJECT_DoubleClick = Edit +PROJECT_CustomDoubleClick = +VRM_DoubleClick = Edit +VRM_CustomDoubleClick = +DEBUGDATABASE_DoubleClick = Edit +DEBUGDATABASE_CustomDoubleClick = +DEBUGARCHIVE_DoubleClick = Edit +DEBUGARCHIVE_CustomDoubleClick = +Project_Major_Version = 2020 +Project_Minor_Version = 1 diff --git a/Quartus/v6_testbench/transcript b/Quartus/v6_testbench/transcript new file mode 100644 index 0000000..7330dc2 --- /dev/null +++ b/Quartus/v6_testbench/transcript @@ -0,0 +1,92 @@ +# Compile of jyh_4490_6_testbench.v was successful. +# Compile of jyh_4490_mstate.v was successful. +# 2 compiles, 0 failed with no errors. +vsim work.jyh_4490_6_testbench +# vsim work.jyh_4490_6_testbench +# Start time: 23:55:10 on May 09,2022 +# Loading work.jyh_4490_6_testbench +# Loading work.jyh_4490_mstate +# ** Error (suppressible): (vsim-3053) Illegal output or inout port connection for port 'cnt'. +# Time: 0 ns Iteration: 0 Instance: /jyh_4490_6_testbench/M1 File: /home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v Line: 39 +# Error loading design +# End time: 23:55:10 on May 09,2022, Elapsed time: 0:00:00 +# Errors: 1, Warnings: 7 +vsim work.jyh_4490_6_testbench +# vsim work.jyh_4490_6_testbench +# Start time: 23:55:11 on May 09,2022 +# Loading work.jyh_4490_6_testbench +# Loading work.jyh_4490_mstate +# ** Error (suppressible): (vsim-3053) Illegal output or inout port connection for port 'cnt'. +# Time: 0 ns Iteration: 0 Instance: /jyh_4490_6_testbench/M1 File: /home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v Line: 39 +# Error loading design +# End time: 23:55:11 on May 09,2022, Elapsed time: 0:00:00 +# Errors: 1, Warnings: 1 +# can't read "Startup(-L)": no such element in array +# Load canceled +# Compile of jyh_4490_6_testbench.v failed with 1 errors. +# Compile of jyh_4490_6_testbench.v was successful. +vsim work.jyh_4490_6_testbench +# vsim work.jyh_4490_6_testbench +# Start time: 23:57:01 on May 09,2022 +# Loading work.jyh_4490_6_testbench +# Loading work.jyh_4490_mstate +add wave -position end sim:/jyh_4490_6_testbench/clk +add wave -position end sim:/jyh_4490_6_testbench/clr +add wave -position end sim:/jyh_4490_6_testbench/in +add wave -position end sim:/jyh_4490_6_testbench/out +add wave -position end sim:/jyh_4490_6_testbench/cnt +run -all +# Compile of jyh_4490_6_testbench.v was successful. +# Compile of jyh_4490_mstate.v was successful. +# 2 compiles, 0 failed with no errors. +vsim work.jyh_4490_6_testbench +# End time: 23:59:24 on May 09,2022, Elapsed time: 0:02:23 +# Errors: 0, Warnings: 4 +# vsim work.jyh_4490_6_testbench +# Start time: 23:59:24 on May 09,2022 +# Loading work.jyh_4490_6_testbench +# Loading work.jyh_4490_mstate +add wave -position end sim:/jyh_4490_6_testbench/clk +add wave -position end sim:/jyh_4490_6_testbench/in +add wave -position end sim:/jyh_4490_6_testbench/out +add wave -position end sim:/jyh_4490_6_testbench/cnt +run -all +# Compile of jyh_4490_6_testbench.v was successful. +# Compile of jyh_4490_mstate.v was successful. +# 2 compiles, 0 failed with no errors. +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# running +vsim work.jyh_4490_6_testbench +# End time: 00:03:02 on May 10,2022, Elapsed time: 0:03:38 +# Errors: 0, Warnings: 2 +# vsim work.jyh_4490_6_testbench +# Start time: 00:03:02 on May 10,2022 +# Loading work.jyh_4490_6_testbench +# Loading work.jyh_4490_mstate +# ** Warning: (vsim-2685) [TFMPC] - Too few port connections for 'M1'. Expected 5, found 4. +# Time: 0 ns Iteration: 0 Instance: /jyh_4490_6_testbench/M1 File: /home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v Line: 38 +# ** Warning: (vsim-3722) /home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v(38): [TFMPC] - Missing connection for port 'en'. +add wave -position end sim:/jyh_4490_6_testbench/clk +add wave -position end sim:/jyh_4490_6_testbench/in +add wave -position end sim:/jyh_4490_6_testbench/en +add wave -position end sim:/jyh_4490_6_testbench/out +add wave -position end sim:/jyh_4490_6_testbench/cnt +run -all +# Break key hit +# Simulation stop requested. +# End time: 00:05:02 on May 10,2022, Elapsed time: 0:02:00 +# Errors: 0, Warnings: 4 diff --git a/Quartus/v6_testbench/work/_info b/Quartus/v6_testbench/work/_info new file mode 100644 index 0000000..87d0437 --- /dev/null +++ b/Quartus/v6_testbench/work/_info @@ -0,0 +1,57 @@ +m255 +K4 +z2 +!s11f vlog 2020.1 2020.02, Feb 28 2020 +13 +!s112 1.1 +!i10d 8192 +!i10e 25 +!i10f 100 +cModel Technology +Z0 d/home/ir/Documents/codelib/Quartus/v6_testbench +vjyh_4490_6_testbench +Z1 !s110 1652112137 +!i10b 1 +!s100 9RmKL5c:1Ye3BFU:0J9]`0 +Z2 !s11b Dg1SIo80bB@j0V0VzS_@n1 +Id==[MRQOC85_S3Uml<2>03 +Z3 VDg1SIo80bB@j0V0VzS_@n1 +R0 +w1652112121 +8/home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v +F/home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v +!i122 5 +L0 2 43 +Z4 OV;L;2020.1;71 +r1 +!s85 0 +31 +Z5 !s108 1652112137.000000 +!s107 /home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v| +!s90 -reportprogress|300|-work|work|-stats=none|/home/ir/Documents/codelib/Quartus/v6/jyh_4490_6_testbench.v| +!i113 1 +Z6 o-work work +Z7 tCvgOpt 0 +vjyh_4490_mstate +R1 +!i10b 1 +!s100 k6`3d_8l:B?R5kVbE<[il30 +R3 +R0 +w1652112079 +8/home/ir/Documents/codelib/Quartus/v6/jyh_4490_mstate.v +F/home/ir/Documents/codelib/Quartus/v6/jyh_4490_mstate.v +!i122 6 +L0 1 53 +R4 +r1 +!s85 0 +31 +R5 +!s107 /home/ir/Documents/codelib/Quartus/v6/jyh_4490_mstate.v| +!s90 -reportprogress|300|-work|work|-stats=none|/home/ir/Documents/codelib/Quartus/v6/jyh_4490_mstate.v| +!i113 1 +R6 +R7 diff --git a/Quartus/v6_testbench/work/_lib1_0.qpg b/Quartus/v6_testbench/work/_lib1_0.qpg new file mode 100644 index 0000000..305bea5 Binary files /dev/null and b/Quartus/v6_testbench/work/_lib1_0.qpg differ diff --git a/Quartus/v6_testbench/work/_vmake b/Quartus/v6_testbench/work/_vmake new file mode 100644 index 0000000..37aa36a --- /dev/null +++ b/Quartus/v6_testbench/work/_vmake @@ -0,0 +1,4 @@ +m255 +K4 +z0 +cModel Technology diff --git a/SoftwareDesign/Lab3/Lab3-2-2/main.cpp b/SoftwareDesign/Lab3/Lab3-2-2/main.cpp index 14d63db..d21e782 100644 --- a/SoftwareDesign/Lab3/Lab3-2-2/main.cpp +++ b/SoftwareDesign/Lab3/Lab3-2-2/main.cpp @@ -1,4 +1,3 @@ -#include "dialog.h" #include "widget.h" #include