From c6f11d39692fe5cc9d2d3fa2560240bb68b2211a Mon Sep 17 00:00:00 2001 From: xiaokai <2485423036@qq.com> Date: Wed, 19 Apr 2023 10:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E5=BF=83=E5=8A=9F=E8=83=BD=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UWE | 1 + src/Makefile.txt | 455 ++++++++++++++ src/UWE_projectCode/highlighter.cpp | 32 + src/UWE_projectCode/highlighter.h | 22 + src/UWE_projectCode/ktextedit.cpp | 116 ++++ src/UWE_projectCode/main.cpp | 14 + src/UWE_projectCode/mainwindow.cpp | 711 ++++++++++++++++++++++ src/UWE_projectCode/mainwindow.h | 168 +++++ src/UWE_projectCode/mainwindow.ui | 415 +++++++++++++ src/UWE_projectCode/test-JHQ.pro | 43 ++ src/UWE_projectCode/test-JHQ.pro.user | 326 ++++++++++ src/UWE_projectCode/test.pro.user | 326 ++++++++++ src/UWE_projectCode/test.pro.user.74ebcab | 328 ++++++++++ src/UWE_projectCode/test.pro.user.a65e202 | 326 ++++++++++ src/UWE_projectCode/test.pro.user.e190987 | 326 ++++++++++ src/quickstart.txt | 73 +++ 16 files changed, 3682 insertions(+) create mode 160000 UWE create mode 100644 src/Makefile.txt create mode 100644 src/UWE_projectCode/highlighter.cpp create mode 100644 src/UWE_projectCode/highlighter.h create mode 100644 src/UWE_projectCode/ktextedit.cpp create mode 100644 src/UWE_projectCode/main.cpp create mode 100644 src/UWE_projectCode/mainwindow.cpp create mode 100644 src/UWE_projectCode/mainwindow.h create mode 100644 src/UWE_projectCode/mainwindow.ui create mode 100644 src/UWE_projectCode/test-JHQ.pro create mode 100644 src/UWE_projectCode/test-JHQ.pro.user create mode 100644 src/UWE_projectCode/test.pro.user create mode 100644 src/UWE_projectCode/test.pro.user.74ebcab create mode 100644 src/UWE_projectCode/test.pro.user.a65e202 create mode 100644 src/UWE_projectCode/test.pro.user.e190987 create mode 100644 src/quickstart.txt diff --git a/UWE b/UWE new file mode 160000 index 0000000..ffd8f97 --- /dev/null +++ b/UWE @@ -0,0 +1 @@ +Subproject commit ffd8f976b1e33775248d626559b63542c87d2166 diff --git a/src/Makefile.txt b/src/Makefile.txt new file mode 100644 index 0000000..f76e4aa --- /dev/null +++ b/src/Makefile.txt @@ -0,0 +1,455 @@ +##--------------------------------------------------------------------- +# COPYRIGHT (C) 2020 +## This software and the associated documentation are confidential and +## proprietary to 671. +## +## The entire notice above must be reproduced on all authorized copies. +##---------------------------------------------------------------------- +SHELL := /bin/csh +#传递了巨多变量到下层make +################## DC env ########################################### +export DCWORK = ./dc.work +export DC_FILELIST = ${DCWORK}/filelist.v +export PP ?= ./ +export PROJECTPATH = $(shell $(SCRIPTPATH)/get_PROJECT_PATH.sh) +export RELATIVEPATH = /home/UWE/jhq/tmp +#export RELATIVEPATH = /home/UWE/zj/tmp +#export RELATIVEPATH = /home/admin/liuchang/FrontEnd_Flow +export SCRIPTPATH = $(RELATIVEPATH)/Scripts +export TCLPATH = $(RELATIVEPATH)/Tcls +export SDCPATH = $(PROJECTPATH)/syn/SDC +export VPATH = $(SCRIPTPATH):$(TCLPATH):$(SDCPATH) #若当前目录找不到文件,定义三个其他寻找路径 +export FLOW ?= FALSE +export DEBUGSDC ?= FALSE +export LOADDDC ?= FALSE +export CHECKTIMING ?= FALSE +export CHECKCODE ?= FALSE +export FLAT ?= FALSE +export PATH = $(VPATH):$(shell echo $$PATH) +SOURCE_EDA_DC = source /space/CAD_Front_End/Synopsys/syn/syn_S-2021.06-SP4.setup +#RTL综合工具 +SOURCE_EDA_PT = source /space/CAD_Front_End/Synopsys/prime/prime_S-2021.06-SP4.setup +#静态时序分析工具 +SOURCE_EDA_FM = source /space/CAD_Front_End/Synopsys/fm/fm_S-2021.06-SP4.setup +#形式化验证工具 +SOURCE_EDA_LC = source /space/CAD_Front_End/Synopsys2020/lc/lc_R-2020.09-SP3.setup +#自动布局工具 + +#SOURCE_EDA_DC = source /space/CAD_Front_End/Synopsys2019/synopsys2019_setup +#SOURCE_EDA_PT = source /space/CAD_Front_End/Synopsys2019/synopsys2019_setup +#SOURCE_EDA_FM = source /space/CAD_Front_End/Synopsys2019/synopsys2019_setup +#SOURCE_EDA_LC = source /space/CAD_Front_End/Synopsys2019/synopsys2019_setup +#export SNPSLMD_LICENSE_FILE = $(shell source /space/CAD_Front_End/Synopsys2019/synopsys2019_setup && echo $$SNPSLMD_LICENSE_FILE) +#export PATH = $(VPATH):$(shell source /space/CAD_Front_End/Synopsys2013/dc_2013.setup && source /space/CAD_Front_End/Synopsys2019/synopsys2019_setup && echo $$PATH) +########################################################################### +#导入路径,变量条件赋值,源程序 +################### Sim env ############################################### +export NCWORK = ./nc.work +export NC_FILELIST = ${NCWORK}/sim_filelist.f +export DESIGN = $(shell $(SCRIPTPATH)/get_CURRENT_DESIGN.sh) +export SIMULATOR ?= NC + +SOURCE_EDA_xcelium = source /space/CAD_Front_End/Cadence/xcelium/xcelium_2105001.setup +SOURCE_EDA_indago = source /space/CAD_Front_End/Cadence/indago/indago_2105001.setup +SOURCE_EDA_vmanager= source /space/CAD_Front_End/Cadence2020/vmanager_2003.setup +SOURCE_EDA_verdi = source /space/CAD_Front_End/Synopsys/verdi/verdi_R-2020.12.setup +SOURCE_EDA_vcs = source /space/CAD_Front_End/Synopsys/vcs/vcs_R-2020.12.setup + +#上一条命令的结果应用于下一条命令用; +XRUN = @${SOURCE_EDA_xcelium}; xrun -sv -access rwc -lwdgen -source_debug -work work -nospecify -run -64bit -nowarn CUNGL1 -nowarn NONPRT -timescale 1ns/1ps -parseinfo include +SV = @${SOURCE_EDA_xcelium}; simvision -64bit +INDAGO = @${SOURCE_EDA_indago} ; indago -wave_db +XMVHDL = @${SOURCE_EDA_xcelium} ; xmvhdl -64bit -nowarn DLCPTH -NOVITALCHECK -linedebug -v93 -nocopyright +VCS = ${SOURCE_EDA_vcs} ; ${SOURCE_EDA_verdi}; vcs -full64 -sverilog -kdb -lca +nospecify -error=noMPD -debug_acc +VCS_F = ${SOURCE_EDA_vcs} ; ${SOURCE_EDA_verdi}; vcs -full64 -sverilog -kdb -lca +nospecify -error=noMPD +VERDI = ${SOURCE_EDA_verdi} ; ${SOURCE_EDA_vcs} ; verdi -nologo +IMC = ${SOURCE_EDA_vmanager} ; imc -64bit -gui +VHDLAN = @${SOURCE_EDA_vcs} ; ${SOURCE_EDA_verdi}; vhdlan -full64 -kdb +#编译工具# +VLOGAN = @${SOURCE_EDA_vcs} ; ${SOURCE_EDA_verdi}; vlogan -full64 -kdb -sverilog -error=noMPD +CDSGEN = @${SOURCE_EDA_xcelium} ; $(SCRIPTPATH)/cds_gen +########################################################################### + +################### Spyglass env ########################################## +SOURCE_EDA_spyglass = source /space/CAD_Front_End/Synopsys/spyglass/spyglass_S-2021.09-SP1.setup +export SPYGLASSWORK = ./spyglass.work +#pre-define env variable. don't modify it +export RUN_POWER_FLOW = no +export RUN_CDC_FLOW = no +export RUN_RDC_FLOW = no +export RUN_CONSTRAINT_FLOW = no +export RUN_TXV_FLOW = no +#---------------------------------------- +export LINT_DONT_SET_TOP = no +export USE_CUSTOM_METHODOLOGY = no +export SG_CUSTOM_METHODOLOGY_DIR = $(SCRIPTPATH)/custom_methodology +#export SG_SRC_FILELIST = src.f ???? +export SG_SRC_FILELIST = ${NC_FILELIST} +export SG_TECH_LIBFILE = ${PROJECTPATH}/syn/spyglass_tech_lib.f +export SG_REPORT_DIR = ${SPYGLASSWORK}/sg_results +export top-module-name = ${DESIGN} +########################################################################### + +################### EasyECO env ########################################## +SOURCE_EDA_easyECO = source /home/admin/easyeco-release-2022_04_13_17_01_32/easyECO.setup +export ECO_COMM ?= ECO + +########################################################################### +#运行脚本文件# +current_date = $(shell date +%Y_%m%d_%H%M) + +lec: + @${SOURCE_EDA_easyECO}; ./ezlec.sh + +eco: + @${SOURCE_EDA_easyECO}; ./ezeco.sh + +autoeco: + @${SOURCE_EDA_easyECO}; ${SOURCE_EDA_FM}; ./auto_eco.sh + +help: + @echo "###########################################################################" + @echo " -------" + @echo " | |" + @echo " | * * |" + @echo " | ? |" + @echo " | |" + @echo " | (_) |" + @echo " ---------" + @echo "" + @echo "If encountering problems during use, please checking the following:" + @echo "Checking ProjectPathSetting.tcl." + @echo "Checking filelist.v." + @echo "Checking setModuleName.tcl." + @echo "Checking RELATIVEPATH in Makefile." + @echo "Checking syn_specific.tcl." + @echo "Checking synopsys_dc.setup." + @echo "Checking whether all linked library are in the *db* folder." + @echo "" + @echo "SYNTAX" + @echo " make" + @echo " [Prepare] : Create a working environment." + @echo " [clean] : Clean all temporary files." + @echo " [help] : make help." + @echo " [xrun] : Start the NC tool for simulation." + @echo " [xrun_nogui] : Start the NC tool for simulation without gui." + @echo " [indago] : Start the indago tool for debugging." + @echo " [sim] : Same as make xrun." + @echo " [design_audit] : Check spyglass running environment." + @echo " [lint] : Start the spyglass tool for checking lint." + @echo " [cdc] : Start the spyglass tool for checking cdc." + @echo " [code_check_all] : Check whether the code meets the submission requirements." + @echo " [c_k] : make check_warning, find all warnings" + @echo " [c_e] : make check_error, find all errors in dc.log" + @echo " [c_R0] [PP=*] : R0 check in dc.log, pt.log, fm.log, need to give check path, default ./ ." + @echo " [pt] [PP=*] : make pt, generate check_timing_pt.txt and .lib, need to give check path, default ./ ." + @echo " [l2d] [PP=*] : make lib2db, need to give check path, default ./ ." + @echo " [check][PP=*] : make c_R0, pt and fomality, need to give check path, default ./ ." + @echo " [svn] [PP=*] : copy submit files into Netlist, and svn commit. need to give check path, default ./ ." + @echo " [submit] [PP=*] : l2d, copy_sdc, svn. need to give check path, default ./ ." + @echo " [f] [PP=*] : make fomality, need to give check path, default ./ ." + @echo " [syn] : make synthesize, use syn_main.tcl, " + @echo " [flow] : make syn, check, and submit." + @echo " [gen_fl] : generate the filelist of current module." + @echo " [tab_c] : check the tab in RTL code, and change it into n space." + @echo "#################################################" +#make help# +###################################################################### +# Sim +###################################################################### +#在执行 compile_vhd 之前需要先执行 simclean,创建指向 ROM1.hex 和 ROM2.hex 的软链接# +begin: simclean + @echo "=============compiling ft-m7004 rtl codes==============" + @echo "NOTE: current code source path is: " ${PROJECTPATH}" " + ln -snf ${PROJECTPATH}/src/BOOT/rtl/RBL_512w128b_ROM1.hex RBL_512w128b_ROM1.hex + ln -snf ${PROJECTPATH}/src/BOOT/rtl/RBL_512w128b_ROM2.hex RBL_512w128b_ROM2.hex + +compile_vhd: cds + ./nc.work/sim_specific.sh ${SIMULATOR} +#传递了NC作为参数吗?# +#启动 NC 工具进行仿真# +xrun: begin compile_vhd + @${XRUN} -gui -top ${DESIGN} -define _SIMULATION_ -f ${NC_FILELIST} + +xrun_nogui: begin compile_vhd + @${XRUN} -top ${DESIGN} -define _SIMULATION_ -exit -f ${NC_FILELIST} +#仿真与快速仿真# +vcs: export SIMULATOR = VCS +vcs: begin compile_vhd + @${VLOGAN} -f ${NC_FILELIST} +define+_SIMULATION_ | tee vcs.log + @${VCS} -top ${DESIGN} -R | tee -a vcs.log + +vcsfast:begin_vcs + @${VLOGAN} -f ${NC_FILELIST} | tee vcs.log + @${VCS_F} -top ${DESIGN} -R | tee -a vcs.log + +sv: + @${SV} + +indago: + @${INDAGO} ${DESIGN}.shm + +sim: xrun_nogui + + +#verdinet: export NOVAS_LIBS="/home/admin/liuchang/M7004V/syn/db/RHSTD_LVT_ssg0p72vm40c_ccs.lib /home/admin/liuchang/M7004V/syn/db/RHSTD_RVT_ssg0p72vm40c_ccs.lib" +#@${VERDI} -novasLibs "RHSTD_LVT_ssg0p72vm40c_ccs.lib++ RHSTD_RVT_ssg0p72vm40c_ccs.lib++" -dbdir simv.daidir + +verdinet: + @${VLOGAN} -f ${NC_FILELIST} $(PP)/result/${DESIGN}.sv +define+_SIMULATION_ | tee vcs.log + @${VCS_F} -top ${DESIGN} | tee -a vcs.log + @${VERDI} -dbdir simv.daidir + +verdi: + @${VERDI} -ssf ${DESIGN}.fsdb + +cds: + @${CDSGEN} + +###################################################################### +# Spyglass +###################################################################### +#setup: +# ln -snf /space/CAD_Front_End/Synopsys/spyglass/pdf/lint/spyglass_lint_reference_manul_gfkdwdzs_V1.pdf spyglass_lint_reference.pdf +# mv ethmac.prj ${top-module-name}.prj +# mv waiver/ethmac.awl waiver/${top-module-name}.awl + +link_spyglass_reference: + ln -snf /space/CAD_Front_End/Synopsys/spyglass/pdf/lint/spyglass_lint_reference_manul_gfkdwdzs_V1.pdf spyglass_lint_Error_Warning_reference.pdf + +design_audit: + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal lint/design_audit + gvim ${SG_REPORT_DIR}/${top-module-name}/consolidated_reports/${top-module-name}_lint_design_audit/Audit.rpt + +lint: link_spyglass_reference + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal lint/lint_rtl + +#gvim ${SG_REPORT_DIR}/${top-module-name}/consolidated_reports/${top-module-name}_lint_lint_rtl/moresimple.rpt + +cdc: cdc_setup_check clock_reset_integrity cdc_verify_struct + +cdc_setup: + export RUN_CDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal cdc/cdc_setup + @echo "=========INFO: SpyGlass would automatically extract design clock/reset constraint ===========" + @echo "=========INFO: User can refer to below files and modify the clock domain as required ===========" + @echo "=========INFO: Then user can add the refined cosntraints in the top design sgdc file ===========" + @echo "egrep \"^clock\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup/spyglass_reports/clock-reset/autoclocks.sgdc" + @echo "egrep \"^clock\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup/spyglass_reports/clock-reset/generated_clocks.sgdc" + @echo "egrep \"^reset\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup/spyglass_reports/clock-reset/autoresets.sgdc" + @echo "egrep \"^reset\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup/spyglass_reports/clock-reset/generated_resets.sgdc" + @echo "egrep \"^set_case_analysis\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup/spyglass_reports/clock-reset/auto_case_analysis.sgdc" +cdc_setup_check: + export RUN_CDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal cdc/cdc_setup_check + @echo "=========INFO: If there were any unconstraint primary ports and bbox ===========" + @echo "=========INFO: SpyGlass would automatically generate a template cdc constriant for them ===========" + @echo "=========INFO: User can refer to below two files and modify related port clock as required ===========" + @echo "=========INFO: Then user can add the refined cosntraints in the top design sgdc file ===========" + @echo "egrep \"^abstract_port\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup_check/spyglass_reports/clock-reset/${top-module-name}_input_abstract.sgdc" + @echo "egrep \"^abstract_port\" ${SG_REPORT_DIR}/${top-module-name}/${top-module-name}/cdc/cdc_setup_check/spyglass_reports/clock-reset/Setup_blackbox01/${top-module-name}_bbox_model.sgdc" +clock_reset_integrity: + export RUN_CDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal cdc/clock_reset_integrity +cdc_verify_struct: + export RUN_CDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal cdc/cdc_verify_struct +cdc_verify: + export RUN_CDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal cdc/cdc_verify +rdc: + export RUN_RDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal rdc/rdc_verify_struct +power_audit: + export RUN_POWER_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal power/power_audit +power_activity_check: + export RUN_POWER_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal power/power_activity_check +power_est_profiling: + export RUN_POWER_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal power/power_est_profiling +power_cge_profiling: + export RUN_POWER_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal power/power_cge_profiling +power: export RUN_POWER_FLOW = yes +power: + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal power/power_audit,power/power_activity_check,power/power_est_profiling + exec mkdir ./spyglass.work/${top-module-name}_${current_date} + exec cp -r ./spyglass.work/sg_results/${top-module-name}/consolidated_reports/* ./spyglass.work/${top-module-name}_${current_date}/ +sdc_gen: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_gen +sdc_audit: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_audit +sdc_check: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_check +sdc_exception_struct: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_exception_struct +sdc_redundancy: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_redundancy +sdc_equiv: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_equiv +sdc_hier_equiv: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_hier_equiv +sdc: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal constraints/sdc_audit,constraints/sdc_check,constraints/sdc_exception_struct,constraints/sdc_redundancy +fp_verification: + export RUN_TXV_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal txv_verification/fp_verification +mcp_verification: + export RUN_TXV_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal txv_verification/mcp_verification +txv: + export RUN_TXV_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj -batch -goal txv_verification/fp_mcp_verification + +lintgui: + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj & +cdcgui: + export RUN_CDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj & + +rdcgui: + export RUN_RDC_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj & +sdcgui: + export RUN_CONSTRAINT_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj & +txvgui: + export RUN_TXV_FLOW=yes;\ + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj & +powergui: export RUN_POWER_FLOW = yes +powergui: + @${SOURCE_EDA_spyglass}; spyglass -project ${SPYGLASSWORK}/${top-module-name}.prj & + +###################################################################### +# Genus +###################################################################### +genus : genusclean + @/space/CAD_Back_End/Cadence20/GENUS201/bin/genus -file $(TCLPATH)/genus_flow.tcl + +###################################################################### +# DC, PT & FM +###################################################################### +syn : synclean Prepare + @${SOURCE_EDA_DC}; dc_shell-t -f $(TCLPATH)/syn_main.tcl | tee dc.log ${DCWORK}/Logs/dc_${current_date}.log + +get_DBs_info: + $(SCRIPTPATH)/get_DBs_info.sh + +report_dc_summary: + $(SCRIPTPATH)/report_dc_summary.sh + +c_w: + $(SCRIPTPATH)/warning_find.perl + +c_e: + $(SCRIPTPATH)/error_find.perl + +code_check_all: CHECKCODE = TRUE +code_check_all: c_SRC_ID sim syn lint + $(SCRIPTPATH)/check_code.sh + gvim code_check.result + +code_check: + $(SCRIPTPATH)/check_code.sh + gvim code_check.result + +c_SRC_ID: + $(SCRIPTPATH)/check_SRC_ID.sh + +c_R0: + $(SCRIPTPATH)/check_R0.sh + +gen_fl: + $(SCRIPTPATH)/filelist_gen.sh + +tab_c: + $(SCRIPTPATH)/tab_change + +pt: Prepare + @${SOURCE_EDA_PT}; pt_shell -f $(TCLPATH)/pt.tcl | tee pt.log pt_${current_date}.log + mv pt_${current_date}.log ${DCWORK}/Logs + +l2d: + @echo $(PP) + @${SOURCE_EDA_LC}; lc_shell -f $(TCLPATH)/lib_to_db.tcl | tee lib2db.log + +check: pt f c_R0 + +submit: l2d copy_sdc svn + +run_all: + $(SCRIPTPATH)/runAll.sh + +svn: copy_sdc + $(SCRIPTPATH)/SVNSubmit.sh + +setPP: + @echo $(PP) + $(SCRIPTPATH)/setPP.sh + @echo $(PP) + +copy_sdc: + @echo $(PP) + $(SCRIPTPATH)/copy_sdc.sh + +f: + @${SOURCE_EDA_FM}; fm_shell -64 -f $(TCLPATH)/formality.tcl | tee fm.log ${DCWORK}/Logs/fm_${current_date}.log + +flow : export FLOW = TRUE +flow: syn pt submit f c_R0 + +cplib2db: + @${SOURCE_EDA_DC}; dc_shell -f $(TCLPATH)/copyLib.tcl + cd ../db-8024/ && lib2db.tcl + +Prepare: + $(SCRIPTPATH)/quick_start + +############################ +## CLEAN +############################ +##-rf递归强制删除目录及其内容而不提供确认,删除特定的文件或目录 +#清理使用xcelium或xrun工具进行仿真时产生的文件和目录 +.PHONY: simclean +simclean: + @touch xxxxa.log + @rm -rf xcelium.d xrun.log xrun.key xrun.history novas_dump.log Log waves_M7004v.shm indago_logs_backup cdns_dump.log indago_logs xncsim xmvhdl.log hdl.var + @rm -rf cds.lib error.log warn.log log .indago_auto_save .simvision synopsys_sim.setup simv waves_M7004v.fsdb .bpad Printout all_stimulation/ddr0_ini_path0.dat RBL_512w128b_ROM1.hex RBL_512w128b_ROM2.hex + +#清理使用vcs工具进行仿真时产生的文件和目录 +.PHONY: vcsclean +vcsclean: + @touch xxxxa.log + @rm -rf simv.daidir csrc vcs_lib verdiLog novas.rc verdi_config_file novas.conf ucli.key vc_hdrs.h vcs.log RBL_512w128b_ROM1.hex RBL_512w128b_ROM2.hex + +#清理使用DesignCompiler工具进行逻辑综合时产生的文件和目录 +.PHONY: synclean +synclean: + @touch xxxxa.log + @rm -rf xxxxa.log dc.log pt.log formality.log fm_shell_command.log RTL_DC_info.log command.log analyzed alib-52 default.svf synopsysdc + +#清理使用SpyGlass工具进行验证时产生的文件和目录 +.PHONY: sgclean +sgclean: + @touch xxxxa.log + @rm -rf ./sypglass.work/sg_results *.out xxxxa.log + +#清理使用Genus工具进行逻辑合成时产生的文件和目录 +.PHONY: genusclean +genusclean: + @touch genus.log + @rm -rf genus.* + +.PHONY: cleanall +cleanall: + @rm -rf analyzed alib-52 default.svf synopsysdc xcelium.d xrun.key xrun.history Log *.shm indago_logs ./sypglass.work/sg_results *.log *.out *.shm xncsim hdl.var simv.daidir csrc vcs_lib verdiLog novas.rc verdi_config_file novas.conf ucli.key vc_hdrs.h RBL_512w128b_ROM1.hex RBL_512w128b_ROM2.hex cds.lib .indago_auto_save .simvision synopsys_sim.setup simv *.fsdb .bpad Printout \ No newline at end of file diff --git a/src/UWE_projectCode/highlighter.cpp b/src/UWE_projectCode/highlighter.cpp new file mode 100644 index 0000000..05f4e4a --- /dev/null +++ b/src/UWE_projectCode/highlighter.cpp @@ -0,0 +1,32 @@ +#include "highlighter.h" + +HighLighter::HighLighter(QTextDocument *parent) : + QSyntaxHighlighter(parent) +{ + HighlightRule num_rule; + num_rule.pattern.setPattern("[0-9]{1,1}"); + num_rule.format.setForeground(QColor(144,238,144)); + highlightrules.append(num_rule); + + HighlightRule key_rule; + key_rule.pattern.setPattern("\\b(char|string|int|float|double|bool|void|true|flase)\\b"); + key_rule.format.setForeground(QColor(30,144,255)); + highlightrules.append(key_rule); + + HighlightRule code_rule; + code_rule.pattern.setPattern("\\b(if|while|for|else|break|return|switch|case)\\b"); + code_rule.format.setForeground(QColor(186,85,211)); + highlightrules.append(code_rule); +} + +void HighLighter::highlightBlock(const QString &text) +{ + for(const HighlightRule &rule : highlightrules){ + QRegExp expression(rule.pattern); + int index = expression.indexIn(text); + while(index>=0){ + int length = expression.matchedLength(); + setFormat(index,length,rule.format); + index = expression.indexIn(text,index+length);} + } +} diff --git a/src/UWE_projectCode/highlighter.h b/src/UWE_projectCode/highlighter.h new file mode 100644 index 0000000..0e7802f --- /dev/null +++ b/src/UWE_projectCode/highlighter.h @@ -0,0 +1,22 @@ +#ifndef HIGHLIGHTER_H +#define HIGHLIGHTER_H + +#include +#include +#include +#include + +class HighLighter :public QSyntaxHighlighter{ + Q_OBJECT +public: + explicit HighLighter(QTextDocument *parent=0); +protected: + void highlightBlock(const QString &text); +private: + struct HighlightRule{ + QRegExp pattern; + QTextCharFormat format; + }; + QVector highlightrules; +}; +#endif // HIGHLIGHTER_H diff --git a/src/UWE_projectCode/ktextedit.cpp b/src/UWE_projectCode/ktextedit.cpp new file mode 100644 index 0000000..0d9dbe4 --- /dev/null +++ b/src/UWE_projectCode/ktextedit.cpp @@ -0,0 +1,116 @@ +#include "mainwindow.h" +#include +#include +#include +#include + +KTextEdit::KTextEdit(QWidget *parent) : + QTextEdit (parent) +{ + setMouseTracking(true); + //m_process_report_man + man_out = ""; + m_process_report_man = new QProcess; + m_process_report_man->start("bash"); + m_process_report_man->waitForStarted(); + m_process_report_man->write("dc_shell \n"); + + connect(m_process_report_man, &QProcess::readyReadStandardOutput, this, &KTextEdit::readBash_manOutputInfo); +} + +void KTextEdit::SetText(const QString &text) +{ + setText(""); + + QRegExp rx("\\(UID-...\\)|\\(CMD-...\\)"); + rx.setMinimal(true); + int pos = 0; + QString strText(text); + while ((pos = rx.indexIn(strText, pos)) != -1){ + QString content = rx.cap(0); + clickable_text_list.append(content); + pos += rx.matchedLength(); + } + + QTextCursor tTextCursor = textCursor(); + QTextCharFormat normal_charformat = tTextCursor.charFormat(); + QTextCharFormat clickable_charformat = tTextCursor.charFormat(); + clickable_charformat.setAnchor(true); + clickable_charformat.setFontWeight(QFont::Bold); + clickable_charformat.setForeground(Qt::darkMagenta); + clickable_charformat.setFontUnderline(true); + + for (int i = 0; i < clickable_text_list.size(); ++i){ + //normal + tTextCursor.setCharFormat(normal_charformat); + setTextCursor(tTextCursor); + int idx = strText.indexOf(clickable_text_list[i]); + tTextCursor.insertText(strText.left(idx)); + strText = strText.right(strText.length()-idx-clickable_text_list[i].length()); + //click_able + clickable_charformat.setAnchorName(QString::number(i)); + tTextCursor.setCharFormat(clickable_charformat); + setTextCursor(tTextCursor); + tTextCursor.insertText(clickable_text_list[i]); + } + tTextCursor.setCharFormat(normal_charformat); + setTextCursor(tTextCursor); + + tTextCursor.insertText(strText); +} +void KTextEdit::OnCursorMove() +{ + QTextCursor tTextCursor = textCursor(); + if (tTextCursor.hasSelection()) + return; + QTextCharFormat clickable_charformat = tTextCursor.charFormat(); + if (!clickable_charformat.isAnchor() && !tTextCursor.atEnd()){ + tTextCursor.movePosition(QTextCursor::Right); + clickable_charformat = tTextCursor.charFormat(); + } + else if (clickable_charformat.isAnchor()){ + error_type = clickable_text_list[clickable_charformat.anchorName().toInt()]; + error_type = error_type.left(error_type.size()-1); error_type = error_type.right(error_type.size()-1); + m_process_report_man->write("man " + error_type.toLocal8Bit() + '\n'); + } +} + +void KTextEdit::mouseReleaseEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + OnCursorMove(); + QTextEdit::mousePressEvent(event); +} + +void KTextEdit::mouseMoveEvent(QMouseEvent *event) +{ + QTextEdit::mouseMoveEvent(event); + + auto pos = event->pos(); + auto cursor = cursorForPosition(pos); + cursor.select(QTextCursor::LineUnderCursor); + auto line = cursor.selectedText(); + + QRegExp rx("\\(UID-...\\)|\\(CMD-...\\)"); + if (rx.indexIn(line) != -1){ + viewport()->setCursor(Qt::PointingHandCursor); + } + else { + viewport()->setCursor(Qt::IBeamCursor); + } +} + +void KTextEdit::readBash_manOutputInfo() +{ + man_out.append(m_process_report_man->readAllStandardOutput()); + if ((man_out.indexOf("All rights reserved")!=-1)){ + if (man_out.indexOf("dc_shell>")!=-1){ + man_out.remove(man_out.indexOf("dc_shell>"),9); + QMessageBox::about(this, this->error_type, man_out); + } + else{ + QMessageBox::about(this, this->error_type, man_out); + } + man_out.clear(); + } +} diff --git a/src/UWE_projectCode/main.cpp b/src/UWE_projectCode/main.cpp new file mode 100644 index 0000000..d852ed7 --- /dev/null +++ b/src/UWE_projectCode/main.cpp @@ -0,0 +1,14 @@ +#include "mainwindow.h" +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + + MainWindow w; + w.resize(1920, 1080); + w.show(); + + return a.exec(); +} diff --git a/src/UWE_projectCode/mainwindow.cpp b/src/UWE_projectCode/mainwindow.cpp new file mode 100644 index 0000000..86ef3f9 --- /dev/null +++ b/src/UWE_projectCode/mainwindow.cpp @@ -0,0 +1,711 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "highlighter.h" +using namespace std; + +// 是否启用QMainWindow自带的菜单栏 +//#define USE_DEFAULT_MENU_BAR +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + this->variate_map = new Variate_Map; + //建立项目与主界面的联系 + this->work_project = new Work_Project; + this->work_project->father = this; + + // 在右侧浮动窗口中添加report窗口 + dockWidget_report = new QDockWidget(tr("report"), this); + dockWidget_report->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetClosable); + dockWidget_report->setVisible(true); + addDockWidget(Qt::RightDockWidgetArea, dockWidget_report); + tabifyDockWidget(ui->dockWidget_src, dockWidget_report); + ui->dockWidget_src->raise(); + + // 在左侧浮动窗口中添加module窗口 + tabifyDockWidget(ui->dockWidget_file, ui->dockWidget_module); + ui->dockWidget_file->raise(); + + //指定菜单栏 +#ifdef USE_DEFAULT_MENU_BAR + //添加菜单栏(此处添加为的为QMainWindow自带的菜单) + pMenuBar = this->menuBar(); +#else + //添加自定义菜单 + pMenuBar = new QMenuBar(this); +#endif + + //定义菜单项 + //(&n)代表快捷方式,当窗口获得焦点时按alt+n即可打开“测试”菜单项 + pMenu1 = new QMenu("文件(&n)",this); + pMenu2 = new QMenu("执行",this); + pMenu3 = new QMenu("工具",this); + + //定义子菜单 + //(&s)为子菜单快捷键,当打开该菜单项后,按下‘s’键即可响应 + pAction_newproject = new QAction("新建项目(&s)",this); + //新建一个带图标的菜单项,图标使用资源文件中的资源 + pAction_openproject = new QAction(QIcon(":/new/prefix1/resource/soccer_ball.ico"),"打开项目",this); + pAction_save = new QAction("保存",this); + pAction_syn = new QAction("run syn(&y)",this); + pAction_parameter_config = new QAction("参数配置",this); + pActionTest5 = new QAction("测试5(&M)",this); + pActionTest6 = new QAction("测试6",this); + + //将菜单项添加到子菜单 + pMenu1->addAction(pAction_newproject); + pMenu1->addAction(pAction_openproject); + //在菜单项之间添加分割线 + pMenu1->addSeparator(); + pMenu1->addAction(pAction_save); + + pMenu2->addAction(pAction_parameter_config); + pMenu2->addAction(pAction_syn); + + + pMenu3->addAction(pActionTest5); + pMenu3->addAction(pActionTest6); + + //将子菜单添加到菜单栏 + pMenuBar->addMenu(pMenu1); + pMenuBar->addMenu(pMenu2); + pMenuBar->addMenu(pMenu3); + + // 终端窗口 + ui->pushButton_run_cmd->setFocus(); + ui->pushButton_run_cmd->setShortcut(Qt::Key_Return); + + m_process_bash = new QProcess; + m_process_bash->start("bash"); + m_process_bash->waitForStarted(); + m_process_bash->write("cd / \n"); + + + // 设置module列表 + this->model_module = new QStandardItemModel; + model_module->setHorizontalHeaderLabels(QStringList()<<"module name"<<"state"); + this->ui->treeView_module->setModel(model_module); + this->ui->treeView_module->setColumnWidth(0, 200); + this->ui->treeView_module->setColumnWidth(1, 50); + + QMenu *menu_module = new QMenu(this); + QAction *pAction_newmodule = new QAction("new module", this); + QAction *pAction_delmodule = new QAction("delete module", this); + menu_module->addAction(pAction_newmodule); + menu_module->addAction(pAction_delmodule); + ui->treeView_module->setContextMenuPolicy(Qt::CustomContextMenu); + + // 建立信号槽连接,处理module树形列表右键菜单事件 + connect(ui->treeView_module, &QTreeView::customContextMenuRequested, this, [=](const QPoint &pos) { + // 显示右键菜单 + menu_module->popup(ui->treeView_module->viewport()->mapToGlobal(pos)); + }); + // new mdoule槽连接 + connect(pAction_newmodule, &QAction::triggered, this, &MainWindow::New_module); + + +#ifndef USE_DEFAULT_MENU_BAR + //当不使用QMainWindow自带的菜单栏时,必须要加上此行 + setMenuBar(pMenuBar); +#endif + + //添加菜单响应函数 + connect(pAction_newproject, &QAction::triggered, this->work_project, &Work_Project::New_Project_1); + connect(pAction_openproject,&QAction::triggered,this,&MainWindow::OpenProject); + connect(pAction_parameter_config, &QAction::triggered, this, &MainWindow::Parameter_Config); + + connect(m_process_bash, &QProcess::readyReadStandardOutput, this, &MainWindow::readBashStandardOutputInfo); + connect(m_process_bash, &QProcess::readyReadStandardError, this, &MainWindow::readBashStandardErrorInfo); + + //int Index = ui->tabWidget_src->currentIndex(); + //QTextEdit *editor = dynamic_cast(ui->tabWidget_src->currentWidget()); + //highlighter = new HighLighter(editor->document()); +// highlighter = new HighLighter(ui->tabWidget_src->currentWidget()->->document()); +} + +// 打开项目响应函数 +void MainWindow::OpenProject() +{ + this->work_project->work_project_path = QFileDialog::getExistingDirectory(this, "打开项目", "/"); + chdir(work_project->work_project_path.toStdString().data()); + work_project->Get_Work_config(); + + //设置树形文件列表 + this->model_file = new QFileSystemModel; + this->model_file->setRootPath(this->work_project->work_project_path); + this->ui->treeView_file->setModel(this->model_file); + this->ui->treeView_file->setRootIndex(this->model_file->index(this->work_project->work_project_path)); + this->ui->treeView_file->setHeaderHidden(true); + this->ui->treeView_file->setColumnHidden(1, true); + this->ui->treeView_file->setColumnHidden(2, true); + this->ui->treeView_file->setColumnHidden(3, true); + + connect(this->ui->treeView_file, &QTreeView::clicked, this, &MainWindow::TreeClicked); + + //终端进入工作项目 + string cmd_cd = "cd " + work_project->work_project_path.toStdString() + "\n pwd \n"; + this->m_process_bash->write(cmd_cd.data()); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +string get_current_date(); +// 参数配置响应函数 +void MainWindow::Parameter_Config() +{ + this->variate_map->add_variate("TCLPATH", "."); + this->variate_map->add_variate("DCWORK", "./dc.work"); + this->variate_map->add_variate("current_date", get_current_date()); + //this->variate_map->Generate_Config_File(); + + this->ui->textEdit_cmd->append("Parameter config completed!\n"); +} + +// 新建项目1响应函数 +void Work_Project::New_Project_1() +{ + QDialog *qdialog = new QDialog; + qdialog->setWindowTitle("新建项目"); + qdialog->setFixedSize(800, 450); + + QHBoxLayout *layout = new QHBoxLayout(qdialog); + QListWidget *listWidget = new QListWidget; + listWidget->setMinimumWidth(150); + listWidget->setFont(QFont("宋体",14)); + listWidget->addItem("Project1"); + listWidget->addItem(""); + QWidget *widget1 = new QWidget, *widget2 = new QWidget; + widget1->setMaximumHeight(350); widget2->setMaximumHeight(350); + QLabel *lab1 = new QLabel("创建项目流程主要包括导入项目路径、导入代码\n路径、选择顶层模块", widget1); + lab1->setFont(QFont("宋体", 15)); + lab1->setWordWrap(true); + lab1->adjustSize(); + lab1->setMinimumSize(500, 100); + QLabel *lab2 = new QLabel("", widget2); + QStackedLayout *stackedLayout = new QStackedLayout; + stackedLayout->addWidget(widget1); + stackedLayout->addWidget(widget2); + + layout->addWidget(listWidget, 2); + layout->addLayout(stackedLayout, 3); + qdialog->setLayout(layout); + + QPushButton *button_next = new QPushButton("下一步", qdialog); + button_next->move(568, 400); + QPushButton *button_cancel = new QPushButton("取消", qdialog); + button_cancel->move(675, 400); + + QObject::connect(listWidget, &QListWidget::currentRowChanged, stackedLayout, &QStackedLayout::setCurrentIndex); + QObject::connect(button_next, &QPushButton::clicked, qdialog, &QDialog::close); + QObject::connect(button_next, &QPushButton::clicked, this, &Work_Project::New_Project_2); + QObject::connect(button_cancel, &QPushButton::clicked, qdialog, &QDialog::close); + + qdialog->exec(); +} + + +// 新建项目2响应函数(新建项目2对话框) +void Work_Project::New_Project_2() +{ + QDialog *qdialog = new QDialog; + qdialog->setWindowTitle("新建项目"); + qdialog->setFixedSize(800,450); + + //添加表格布局 + QFormLayout* layout = new QFormLayout(); + layout->setRowWrapPolicy(QFormLayout::DontWrapRows); + edit_work_project_path = new QLineEdit(); + edit_work_project_name = new QLineEdit(); + layout->addRow("项目路径:", edit_work_project_path); + layout->addRow("新建项目名称:", edit_work_project_name); + + // 选择路径按钮 + QPushButton *button_work_project_path = new QPushButton(edit_work_project_path); + button_work_project_path->setText("......"); + button_work_project_path->setCursor(Qt::ArrowCursor); + QWidgetAction* action = new QWidgetAction(edit_work_project_path); + action->setDefaultWidget(button_work_project_path); + edit_work_project_path->addAction(action, QLineEdit::TrailingPosition); + + // 将布局添加到对话框 + qdialog->setLayout(layout); + + // 操作按键 + QPushButton *button_next = new QPushButton("下一步", qdialog); + button_next->move(568, 400); + QPushButton *button_back = new QPushButton("上一步", qdialog); + button_back->move(675, 400); + + // 按键响应信号槽函数 + connect(button_work_project_path, &QPushButton::clicked, this, &Work_Project::Work_Project_path_choose); + connect(button_next, &QPushButton::clicked, qdialog, &QDialog::close); + connect(button_next, &QPushButton::clicked, this, &Work_Project::New_Project_setup); + QObject::connect(button_back, &QPushButton::clicked, qdialog, &QDialog::close); + QObject::connect(button_back, &QPushButton::clicked, this, &Work_Project::New_Project_1); + + // 显示对话框 + qdialog->exec(); +} + + +// 工作项目setup设置界面 +void Work_Project::New_Project_setup() +{ + // 新建对话框 + QDialog *qdialog = new QDialog; + qdialog->setWindowTitle("setup"); + qdialog->setFixedSize(800,490); + + // 新建输入框 + QFormLayout* layout = new QFormLayout(); + layout->setRowWrapPolicy(QFormLayout::DontWrapRows); + edit_designer = new QLineEdit(); layout->addRow("designer:", edit_designer); + edit_company = new QLineEdit(); layout->addRow("company:", edit_company); + edit_synthetic_library = new QLineEdit(); layout->addRow("synthetic_library:", edit_synthetic_library); + edit_target_library = new QLineEdit(); layout->addRow("target_library:", edit_target_library); + edit_link_library = new QLineEdit(); layout->addRow("link_library:", edit_link_library); + edit_symbol_library=new QLineEdit(); layout->addRow("symbol_library:", edit_symbol_library); + edit_cache_write=new QLineEdit(); layout->addRow("cache_write:", edit_cache_write); + edit_cache_read=new QLineEdit(); layout->addRow("cache_read:", edit_cache_read); + edit_my_lib_path=new QLineEdit(); layout->addRow("my_lib_path:", edit_my_lib_path); + edit_search_path=new QLineEdit(); layout->addRow("search_path:", edit_search_path); + edit_suppress_message=new QLineEdit(); layout->addRow("suppress_message:", edit_suppress_message); + edit_define_design_lib=new QLineEdit(); layout->addRow("define_design_lib:", edit_define_design_lib); + edit_view_script_submenu_items=new QLineEdit(); layout->addRow("view_script_submenu_items:", edit_view_script_submenu_items); + + // 将布局添加到对话框 + qdialog->setLayout(layout); + + // 操作按键 + QPushButton *button_next = new QPushButton("下一步", qdialog); + button_next->move(568, 455); + QPushButton *button_back = new QPushButton("上一步", qdialog); + button_back->move(675, 455); + + // 按键响应信号槽函数 + connect(button_next, &QPushButton::clicked, qdialog, &QDialog::close); + connect(button_next, &QPushButton::clicked, this, &Work_Project::Src_Project_Environment_set); + QObject::connect(button_back, &QPushButton::clicked, qdialog, &QDialog::close); + QObject::connect(button_back, &QPushButton::clicked, this, &Work_Project::New_Project_2); + + // 显示对话框 + qdialog->exec(); +} + +// 按钮选择工作项目路径响应函数 +void Work_Project::Work_Project_path_choose() +{ + this->work_project_path = QFileDialog::getExistingDirectory(0, "选择目录", "/"); + edit_work_project_path->setText(work_project_path); +} + +// 芯片环境设置响应函数 +void Work_Project::Src_Project_Environment_set() +{ + work_project_name = edit_work_project_name->text(); + work_project_path = edit_work_project_path->text(); + + QDialog *qdialog = new QDialog; + qdialog->setWindowTitle("芯片项目环境设置"); + qdialog->setFixedSize(800, 450); + + //输入框及其按钮 + QFormLayout *layout = new QFormLayout; + layout->setRowWrapPolicy(QFormLayout::DontWrapRows); + edit_src_project_path = new QLineEdit; + edit_src_path = new QLineEdit; +// edit_module_name = new QLineEdit; + layout->addRow("芯片项目路径:", edit_src_project_path); + layout->addRow("代码路径", edit_src_path); +// layout->addRow("模块名称", edit_module_name); + + QPushButton *button_src_project_path = new QPushButton(edit_src_project_path); + QPushButton *button_src_path = new QPushButton(edit_src_path); + button_src_project_path->setText("..."); button_src_path->setText("..."); + button_src_project_path->setCursor(Qt::ArrowCursor); button_src_path->setCursor(Qt::ArrowCursor); + QWidgetAction *action_Project_path = new QWidgetAction(edit_src_project_path), *action_src_path = new QWidgetAction(edit_src_path); + action_Project_path->setDefaultWidget(button_src_project_path); action_src_path->setDefaultWidget(button_src_path); + edit_src_project_path->addAction(action_Project_path, QLineEdit::TrailingPosition); edit_src_path->addAction(action_src_path, QLineEdit::TrailingPosition); + qdialog->setLayout(layout); + + //单独按钮 + QPushButton *button_determine = new QPushButton("确定", qdialog), *button_back = new QPushButton("上一步", qdialog); + button_determine->move(568, 400); button_back->move(675, 400); + + //按钮对应槽函数 + connect(button_src_project_path, &QPushButton::clicked, this, &Work_Project::Src_Project_path_choose); + connect(button_src_path, &QPushButton::clicked, this, &Work_Project::Src_path_choose); + connect(button_determine, &QPushButton::clicked, qdialog, &QDialog::close); + connect(button_determine, &QPushButton::clicked, this, &Work_Project::Src_Prokect_Environment_set_Determine); + connect(button_back, &QPushButton::clicked, qdialog, &QDialog::close); + connect(button_back, &QPushButton::clicked, this, &Work_Project::New_Project_setup); + + qdialog->exec(); +} + +// 选择芯片项目路径响应函数 +void Work_Project::Src_Project_path_choose() +{ + this->src_project_path = QFileDialog::getExistingDirectory(0, "选择目录", "/"); + edit_src_project_path->setText(src_project_path); +} + +// 选择代码路径响应函数 +void Work_Project::Src_path_choose() +{ + src_path = QFileDialog::getExistingDirectory(0, "选择目录", "/"); + edit_src_path->setText(src_path); +} + +// 芯片项目环境配置确定响应函数 +void Work_Project::Src_Prokect_Environment_set_Determine() +{ + src_project_path = edit_src_project_path->text(); + src_path = edit_src_path->text(); +// module_name = edit_module_name->text(); + + // 生成工作项目对应文件夹 + string str_work_project_path = work_project_path.toStdString(), str_work_project_name = work_project_name.toStdString(); + chdir(str_work_project_path.data()); + mkdir(str_work_project_name.data(), 0755); + str_work_project_path += '/' + str_work_project_name; + chdir(str_work_project_path.data()); + work_project_path = QString::fromStdString(str_work_project_path); + qDebug() << work_project_path; + + // 保存配置信息 + Generate_UWE_Work_config(); + + // 设置树形文件列表 + this->father->model_file = new QFileSystemModel; + this->father->model_file->setRootPath(work_project_path); + this->father->ui->treeView_file->setModel(this->father->model_file); + this->father->ui->treeView_file->setRootIndex(this->father->model_file->index(work_project_path)); + this->father->ui->treeView_file->setHeaderHidden(true); + this->father->ui->treeView_file->setColumnHidden(1, true); + this->father->ui->treeView_file->setColumnHidden(2, true); + this->father->ui->treeView_file->setColumnHidden(3, true); + + connect(this->father->ui->treeView_file, &QTreeView::clicked, this->father, &MainWindow::TreeClicked); + + // 终端进入项目文件夹,链接src代码文件夹 + string ln_cmd = " ln -s " + this->src_path.toStdString() + ' ' + "./src"; ln_cmd += "\nln -s /home/UWE/zj/tmp/Scripts ./Scripts"; + string cmd_1 = "cd "+str_work_project_path+'\n' + "pwd\n" + ln_cmd+'\n'; + this->father->m_process_bash->write(cmd_1.data()); + + // 生成执行所需tcl文件 + ofstream out1("ProjectPathSetting.tcl", ios::out); + out1 << "set PROJECTPATH " << this->src_project_path.toStdString() << "\n" << "puts ${PROJECTPATH}"; + out1.close(); +// ofstream out2("setModuleName.tcl", ios::out); +// out2 << "set Design " << this->module_name.toStdString() << "\n" << "puts ${Design}"; +// out2.close(); + + // make Prepare的一系列操作 + string cmd_2 = "echo 'ProjectPathSetting.tcl is generated successfully!\n./src soft link is created.\nsetModuleName.tcl is created.'\n"; + string cmd_cp = "cp -r /home/UWE/zj/tmp/Template/* ./ \ntouch tmp.log \necho 'copy files in Template here.' \ncp -r /home/UWE/zj/tmp/Makefile ./ \n" + "cp -r /home/UWE/zj/test_1/syn_main.tcl ./ \n"; + string cmd_flist = "filelistpath=`find ./src/ -maxdepth 1 -name '*flist*' -type f` \nfilelistname=${filelistpath#*src/} \necho '`include \"./\"' > ./dc.work/filelist.v \n"; + string cmd_incdir = "incdirlistpath=`find ./src/ -maxdepth 1 -name '*incdir*' -type f` \nincdirlistname=${incdirlistpath#*src/} \necho -f ./src/$incdirlistname \ > ./nc.work/sim_filelist.f \n"; + string cmd_nc = "echo '-f ./src/'$filelistname'' \ >> ./nc.work/sim_filelist.f \necho \" \" >> ./nc.work/sim_filelist.f \necho //Add simulation files bellow >> ./nc.work/sim_filelist.f \n"; + string cmd_mv = "mv ./spyglass.work/demo.prj ./spyglass.work/"; cmd_mv += this->module_name.toStdString(); cmd_mv += ".prj \n"; + cmd_mv += "mv ./spyglass.work/waiver/demo.awl ./spyglass.work/waiver/"+this->module_name.toStdString()+".awl\n"; + cmd_2 += cmd_cp + cmd_flist + cmd_incdir + cmd_nc + cmd_mv; + //cout << cmd_2; + this->father->m_process_bash->write(cmd_2.data()); + + // 生成synopsys_dc.setup文件 + ofstream out_setup("synopsys_dc.setup", ios::out); + out_setup << "set designer " << this->edit_designer->text().toStdString() << '\n'; + out_setup << "set company " << this->edit_company->text().toStdString() << '\n'; + out_setup << "set synthetic_library " << this->edit_synthetic_library->text().toStdString() << '\n'; + out_setup << "set target_library " << this->edit_target_library->text().toStdString() << '\n'; + out_setup << "set link_library " << this->edit_link_library->text().toStdString() << '\n'; + out_setup << "set symbol_library " << this->edit_symbol_library->text().toStdString() << '\n'; + out_setup << "set cache_write " << this->edit_cache_write->text().toStdString() << '\n'; + out_setup << "set cache_read $cache_write\n"; + out_setup << "set my_lib_path " << this->edit_my_lib_path->text().toStdString() << '\n'; + out_setup << "set search_path " << this->edit_search_path->text().toStdString() << '\n'; + out_setup << "suppress_message " << this->edit_suppress_message->text().toStdString() << '\n'; + out_setup << "define_design_lib DEFAULT -path " << this->edit_define_design_lib->text().toStdString() << '\n'; + out_setup << "set view_script_submenu_items " << this->edit_view_script_submenu_items->text().toStdString() << '\n'; + out_setup.close(); +} + +// 生成工作项目配置文件 +void Work_Project::Generate_UWE_Work_config() +{ + ofstream out("UWE_work_config", ios::out); + out << "work_project_path = " << work_project_path.toStdString() << endl; + out << "work_project_name = " << work_project_name.toStdString() << endl; + out << "src_project_path = " << src_project_path.toStdString() << endl; + out << "src_path = " << src_path.toStdString() << endl; + out << "module_name = " << module_name.toStdString() << endl; + out.close(); +} + +// 根据配置文件获取工作项目配置 +void Work_Project::Get_Work_config() +{ + ifstream in("UWE_work_config", ios::in); + string str; + in >> str >> str >> str; + in >> str >> str >> str; work_project_name = QString::fromStdString(str); + in >> str >> str >> str; src_project_path = QString::fromStdString(str); + in >> str >> str >> str; src_path = QString::fromStdString(str); + in >> str >> str >> str; module_name = QString::fromStdString(str); + in.close(); +} + +// 获取当前系统时间 +string get_current_date() +{ + time_t timeReal; + time(&timeReal); + timeReal = timeReal + 8*3600; + tm* t = gmtime(&timeReal); + string str = to_string(t->tm_year+1900) + '_' + to_string(t->tm_mon+1)+to_string(t->tm_mday) + '_' + to_string(t->tm_hour)+to_string(t->tm_min); + return str; +} + +// 点击树形文件列表展示文本内容 +void MainWindow::TreeClicked(const QModelIndex &index) +{ + ui->dockWidget_src->show(); + QString context, file_name = model_file->fileName(index); + QString path = model_file->filePath(index); + for (int i = 0; i < ui->tabWidget_src->count(); ++i) { + if (ui->tabWidget_src->tabText(i) == file_name) { + ui->tabWidget_src->setCurrentIndex(i); + ui->dockWidget_src->show(); + ui->dockWidget_src->raise(); + return; + } + } + + QFile file(path); + file.open(QFile::ReadOnly | QFile::Text); + context = file.readAll(); + file.close(); + + if (!context.isEmpty()){ + QTextEdit *textEdit_src = new QTextEdit; + textEdit_src->setText(context); + textEdit_src->setFont(QFont("Consolas", 12)); + + ui->tabWidget_src->addTab(textEdit_src, file_name); + ui->tabWidget_src->setCurrentWidget(textEdit_src); + } + ui->dockWidget_src->raise(); +} + +// 终端输出内容响应函数 +void MainWindow::readBashStandardOutputInfo() +{ + QByteArray cmdout = m_process_bash->readAllStandardOutput(); + + // 综合完成响应函数 + if (cmdout.indexOf("Thank you...") != -1){ + qDebug() << "syn sucessfully!" << endl; + QStandardItem *item = model_module->item(row_current_module_treeview, 1); + item->setIcon(style()->standardIcon(QStyle::SP_DialogApplyButton)); + } + + if (!cmdout.isEmpty()){ + ui->textEdit_cmd->append(QString::fromLocal8Bit(cmdout)); + } + QScrollBar *scroll = ui->textEdit_cmd->verticalScrollBar(); + scroll->setSliderPosition(scroll->maximum()); +} + + +// 终端输出错误信息响应函数 +void MainWindow::readBashStandardErrorInfo() +{ + QByteArray cmdout = m_process_bash->readAllStandardError(); + if (!cmdout.isEmpty()){ + ui->textEdit_cmd->append(QString::fromLocal8Bit(cmdout)); + } + QScrollBar *scroll = ui->textEdit_cmd->verticalScrollBar(); + scroll->setSliderPosition(scroll->maximum()); +} + +// 字符串变量替换 +void MainWindow::String_Replace(string &str, string variate_key) +{ + string variate_value = this->variate_map->get_value(variate_key); + int variate_size = variate_key.size(); + while (str.find(variate_key) != string::npos) + str = str.replace(str.find(variate_key), variate_size, variate_value); +} + +// 生成配置文件 +void Variate_Map::Generate_Config_File() +{ + ofstream out("parameter.tcl", ios::out); + for (auto i : mapper) + out << "set " << i.first << ' ' << i.second << endl; + out.close(); +} + +// 保存参数配置 +void MainWindow::on_buttonBox_Save_accepted() +{ + string FLOW_value = (ui->radioButton_FLOW_TRUE->isChecked()) ? "TRUE" : "FALSE"; + variate_map->add_variate("FLOW", FLOW_value); + string LOADDDC_value = (ui->radioButton_LOADDDC_TRUE->isChecked()) ? "TRUE" : "FALSE"; + variate_map->add_variate("LOADDDC", LOADDDC_value); + string CHECKCODE_value = (ui->radioButton_CHECKCODE_TRUE->isChecked()) ? "TRUE" : "FALSE"; + variate_map->add_variate("CHECKCODE", CHECKCODE_value); + string DEBUGSDC_value = (ui->radioButton_DEBUGSDC_TRUE->isChecked()) ? "TRUE" : "FALSE"; + variate_map->add_variate("DEBUGSDC", DEBUGSDC_value); + + variate_map->Generate_Config_File(); + ui->textEdit_cmd->append("parameter.tcl has been generated sucessfully!\n"); +} + +// 运行综合按钮响应函数 +void MainWindow::on_pushButton_runsyn_clicked() +{ + Parameter_Config(); + + string syn_cmd = "dc_shell-t -f TCLPATH/syn_main.tcl | tee dc.log DCWORK/Logs/dc_current_date.log \nmake c_R0 \n"; + this->String_Replace(syn_cmd, "TCLPATH"); + this->String_Replace(syn_cmd, "DCWORK"); + this->String_Replace(syn_cmd, "current_date"); + cout << syn_cmd << endl; + this->ui->textEdit_cmd->append("run syn \n"); + this->m_process_bash->write(syn_cmd.data()); +} + +// 代码窗口关闭响应函数 +void MainWindow::on_tabWidget_src_tabCloseRequested(int index) +{ + QTextEdit *text_edit = qobject_cast(ui->tabWidget_src->widget(index)); + QString file_name = ui->tabWidget_src->tabText(index); + QString file_path = model_file->rootPath() + "/" + file_name; + + if (text_edit) { + // »ñÈ¡µ±Ç°Îı¾¿òÖеÄÄÚÈÝ + QString curr_content = text_edit->toPlainText(); + + // ¶ÁȡԭʼÎļþÄÚÈÝ + QString orig_content; + QFile file(file_path); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + orig_content = file.readAll(); + file.close(); + } + + // Èç¹ûµ±Ç°ÄÚÈÝÓëԭʼÄÚÈݲ»Í¬£¬Ôò˵Ã÷ÎļþÒѱ»±à¼­£¬ÐèÒª±£´æÐÞ¸Ä + if (curr_content != orig_content) { + if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { + QTextStream out(&file); + out << curr_content; + file.close(); + } + } + } + + // ½«±êǩҳ´Ó±êÇ©¿Ø¼þÖÐɾ³ý + ui->tabWidget_src->removeTab(index); +} + +// R0_check result按钮响应函数 +void MainWindow::on_pushButton_result_clicked() +{ + ktextEdit = new KTextEdit(dockWidget_report); + //获取result内容 + QString result_path = QDir::currentPath() + "/R0_check.result"; + QFile file(result_path); + QString context; + file.open(QFile::ReadOnly | QFile::Text); + while (!file.atEnd()) { + QByteArray line = file.readLine(); + QString str(line); + context.append(str); + } + ktextEdit->SetText(context); + //设置文本游标到文本头 + QTextCursor cursor = ktextEdit->textCursor(); + cursor.movePosition(QTextCursor::Start); + ktextEdit->setTextCursor(cursor); + + dockWidget_report->setWidget(ktextEdit); + + dockWidget_report->raise(); +} + +//终端运行按钮响应函数 +void MainWindow::on_pushButton_run_cmd_clicked() +{ + QString strCmd = ui->lineEdit->text(); + ui->textEdit_cmd->append("Linux:~$ " + strCmd); + m_process_bash->write(ui->lineEdit->text().toLocal8Bit() + '\n'); + ui->lineEdit->clear(); +} + +// New nodule响应函数 +void MainWindow::New_module() +{ + QDialog *qdialog = new QDialog; + qdialog->setWindowTitle("module name"); + qdialog->setFixedSize(500, 50); + + //输入框及其按钮 + QFormLayout *layout = new QFormLayout; + layout->setRowWrapPolicy(QFormLayout::DontWrapRows); + QLineEdit *edit_module_name = new QLineEdit; + layout->addRow("module name:", edit_module_name); + + qdialog->setLayout(layout); + + //单独按钮 + QPushButton *button_determine = new QPushButton("确定", qdialog); + button_determine->move(300, 100); + + //按钮对应槽函数 + connect(button_determine, &QPushButton::clicked, qdialog, &QDialog::close); + connect(button_determine, &QPushButton::clicked, this, [=]{ + QList items; + items.append(new QStandardItem(edit_module_name->text())); +// childItem->setIcon(style()->standardIcon(QStyle::SP_DialogApplyButton)); + QStandardItem *Item_state = new QStandardItem(); + Item_state->setIcon(QApplication::style()->standardIcon(QStyle::SP_MessageBoxQuestion)); + items.append(Item_state); + model_module->appendRow(items); + row_current_module_treeview++; + + this->work_project->module_name = edit_module_name->text(); + ofstream out2("setModuleName.tcl", ios::out); + out2 << "set Design " << edit_module_name->text().toStdString() << "\n" << "puts ${Design}"; + out2.close(); + }); + + qdialog->exec(); +} diff --git a/src/UWE_projectCode/mainwindow.h b/src/UWE_projectCode/mainwindow.h new file mode 100644 index 0000000..f49a7a8 --- /dev/null +++ b/src/UWE_projectCode/mainwindow.h @@ -0,0 +1,168 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class Variate_Map; +class Work_Project; +class KTextEdit; +class HighLighter; + +//???? +class MainWindow : public QMainWindow +{ + Q_OBJECT +private: + HighLighter *highlighter; +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + void String_Replace(string& str, string variate); + + //??? + QMenuBar *pMenuBar; + //??? + QMenu *pMenu1; + QMenu *pMenu2; + QMenu *pMenu3; + //??? + QAction *pAction_newproject; + QAction *pAction_openproject; + QAction *pAction_save; + QAction *pAction_parameter_config; + QAction *pAction_syn; + + QAction *pActionTest5; + QAction *pActionTest6; + + + QFileSystemModel *model_file; + QStandardItemModel *model_module; + int row_current_module_treeview = -1; + Ui::MainWindow *ui; + QProcess *m_process_bash; + + Variate_Map *variate_map; + QDockWidget *dockWidget_report, *dockWidget_module; + QTreeView *treeView_module; + KTextEdit *ktextEdit; + + // flag set + bool ready_syn, ready_r0_result, ready_setup, ready_prepare; + + //???? + Work_Project *work_project; + +public slots: + //???????? + //???????? + void OpenProject(); + void TreeClicked(const QModelIndex &index); + void readBashStandardOutputInfo(); + void readBashStandardErrorInfo(); + void Parameter_Config(); + void New_module(); + +private slots: + void on_buttonBox_Save_accepted(); + void on_pushButton_runsyn_clicked(); + void on_tabWidget_src_tabCloseRequested(int index); + void on_pushButton_result_clicked(); + void on_pushButton_run_cmd_clicked(); +// void on_treeView_module_clicked(const QModelIndex &index); + void on_treeView_file_collapsed(const QModelIndex &index); +}; + +//????map? +class Variate_Map +{ +public: + Variate_Map(){} + ~Variate_Map(){} + string get_value(string str){return mapper[str];} + int add_variate(string key, string value){mapper[key] = value;} + bool alter_variate(string key, string value) + { + if (mapper.find(key) == mapper.end()) + return false; + else{ + mapper[key] = value; + return true; + } + } + void Generate_Config_File(); + + +private: + map mapper; +}; + +//????? +class Work_Project : public QObject +{ + Q_OBJECT +public: + MainWindow *father; + QLineEdit *edit_work_project_path, *edit_work_project_name, *edit_src_project_path, *edit_src_path, *edit_module_name; + QLineEdit *edit_designer, *edit_company, *edit_synthetic_library, *edit_target_library, *edit_link_library, *edit_symbol_library, *edit_cache_write, + *edit_cache_read, *edit_my_lib_path, *edit_search_path, *edit_suppress_message, *edit_define_design_lib , *edit_view_script_submenu_items; + QString work_project_path, work_project_name, src_project_path, src_path, module_name; + + Work_Project(){} + ~Work_Project(){} + void Generate_UWE_Work_config(); + void Get_Work_config(); + +public slots: + void New_Project_1(); + void New_Project_2(); + void New_Project_setup(); + void Work_Project_path_choose(); + + void Src_Project_Environment_set(); + void Src_Project_path_choose(); + void Src_path_choose(); + void Src_Prokect_Environment_set_Determine(); + +}; + +class KTextEdit : public QTextEdit +{ + Q_OBJECT +public: + KTextEdit(QWidget *parent = nullptr); + void SetText(const QString &text); + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + + QList clickable_text_list; + QString error_type; + QProcess *m_process_report_man; + QByteArray man_out; + +public slots: + void OnCursorMove(); + void readBash_manOutputInfo(); +}; + + +#endif // MAINWINDOW_H diff --git a/src/UWE_projectCode/mainwindow.ui b/src/UWE_projectCode/mainwindow.ui new file mode 100644 index 0000000..e375eed --- /dev/null +++ b/src/UWE_projectCode/mainwindow.ui @@ -0,0 +1,415 @@ + + + MainWindow + + + + 0 + 0 + 1851 + 781 + + + + MainWindow + + + + + + 50 + 40 + 151 + 601 + + + + + + 60 + 370 + 81 + 28 + + + + QDialogButtonBox::Save + + + + + + 10 + 0 + 131 + 80 + + + + FLOW + + + + + 0 + 40 + 106 + 26 + + + + TRUE + + + + + + 60 + 40 + 106 + 26 + + + + FALSE + + + true + + + + + + + 10 + 90 + 131 + 80 + + + + LOADDDC + + + + + 0 + 40 + 106 + 26 + + + + TRUE + + + false + + + + + + 60 + 40 + 106 + 26 + + + + FALSE + + + true + + + + + + + 10 + 180 + 131 + 80 + + + + CHECKCODE + + + + + 0 + 40 + 106 + 26 + + + + TRUE + + + + + + 60 + 40 + 106 + 26 + + + + FALSE + + + true + + + + + + + 10 + 270 + 131 + 80 + + + + DEBUGSDC + + + + + 0 + 40 + 106 + 26 + + + + TRUE + + + + + + 60 + 40 + 106 + 26 + + + + FALSE + + + true + + + + + + + 10 + 450 + 121 + 41 + + + + run syn + + + + + + 10 + 540 + 121 + 41 + + + + R0_check result + + + + + + + 40 + 10 + 91 + 20 + + + + + 13 + 50 + false + + + + 参数配置 + + + + + + + 0 + 0 + 1851 + 25 + + + + + + TopToolBarArea + + + false + + + + + + + 1350 + 500 + + + + + 16000 + 524287 + + + + + 11 + + + + QDockWidget::DockWidgetClosable + + + 代码 + + + 2 + + + + + + + -1 + + + true + + + true + + + false + + + + + + + + + + 126 + 146 + + + + + 12 + + + + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable + + + bash + + + 2 + + + + + + + + + + run + + + + + + + + + + + + + 200 + 110 + + + + QDockWidget::NoDockWidgetFeatures + + + 项目 + + + 1 + + + + + + + + + + + + QDockWidget::NoDockWidgetFeatures + + + module + + + 1 + + + + + + 9 + 9 + 256 + 800 + + + + + + + + + + diff --git a/src/UWE_projectCode/test-JHQ.pro b/src/UWE_projectCode/test-JHQ.pro new file mode 100644 index 0000000..a6d1b72 --- /dev/null +++ b/src/UWE_projectCode/test-JHQ.pro @@ -0,0 +1,43 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2022-09-13T16:59:02 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = test +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + main.cpp \ + mainwindow.cpp \ + ktextedit.cpp \ + highlighter.cpp + +HEADERS += \ + mainwindow.h \ + highlighter.h + +FORMS += \ + mainwindow.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/src/UWE_projectCode/test-JHQ.pro.user b/src/UWE_projectCode/test-JHQ.pro.user new file mode 100644 index 0000000..bfb0116 --- /dev/null +++ b/src/UWE_projectCode/test-JHQ.pro.user @@ -0,0 +1,326 @@ + + + + + + EnvironmentId + {a65e2026-5075-402d-8461-16bc6af287b9} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + GBK + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.2 GCC 64bit + Desktop Qt 5.12.2 GCC 64bit + qt.qt5.5122.gcc_64_kit + 0 + 0 + 0 + + /home/UWE/jhq/Qt/Project/build-test-JHQ-Desktop_Qt_5_12_2_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/UWE/jhq/Qt/Project/build-test-JHQ-Desktop_Qt_5_12_2_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/UWE/jhq/Qt/Project/build-test-JHQ-Desktop_Qt_5_12_2_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + test-JHQ + + Qt4ProjectManager.Qt4RunConfiguration:/home/UWE/jhq/Qt/Project/UWE/test-JHQ.pro + test-JHQ.pro + + 3768 + false + true + true + false + false + true + + /home/UWE/jhq/Qt/Project/build-test-JHQ-Desktop_Qt_5_12_2_GCC_64bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/src/UWE_projectCode/test.pro.user b/src/UWE_projectCode/test.pro.user new file mode 100644 index 0000000..9e10715 --- /dev/null +++ b/src/UWE_projectCode/test.pro.user @@ -0,0 +1,326 @@ + + + + + + EnvironmentId + {a65e2026-5075-402d-8461-16bc6af287b9} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.2 GCC 64bit + Desktop Qt 5.12.2 GCC 64bit + qt.qt5.5122.gcc_64_kit + 0 + 0 + 0 + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + test + test2 + Qt4ProjectManager.Qt4RunConfiguration:/home/UWE/lky (copy)/Qt/Project/UWE/test.pro + test.pro + + 3768 + false + true + true + false + false + true + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/src/UWE_projectCode/test.pro.user.74ebcab b/src/UWE_projectCode/test.pro.user.74ebcab new file mode 100644 index 0000000..3e51e9f --- /dev/null +++ b/src/UWE_projectCode/test.pro.user.74ebcab @@ -0,0 +1,328 @@ + + + + + + EnvironmentId + {74ebcab9-7256-471f-b9da-4878e8807be4} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.2 MinGW 64-bit + Desktop Qt 5.12.2 MinGW 64-bit + qt.qt5.5122.win64_mingw73_kit + 0 + 0 + 0 + + D:/SoftWare/QT/program/build-test-Desktop_Qt_5_12_2_MinGW_64_bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + D:/SoftWare/QT/program/build-test-Desktop_Qt_5_12_2_MinGW_64_bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + D:/SoftWare/QT/program/build-test-Desktop_Qt_5_12_2_MinGW_64_bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + test + + Qt4ProjectManager.Qt4RunConfiguration:D:/SoftWare/QT/program/test/test.pro + test.pro + + 3768 + false + true + true + false + false + true + + D:/SoftWare/QT/program/build-test-Desktop_Qt_5_12_2_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/src/UWE_projectCode/test.pro.user.a65e202 b/src/UWE_projectCode/test.pro.user.a65e202 new file mode 100644 index 0000000..d0fbce5 --- /dev/null +++ b/src/UWE_projectCode/test.pro.user.a65e202 @@ -0,0 +1,326 @@ + + + + + + EnvironmentId + {a65e2026-5075-402d-8461-16bc6af287b9} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.2 GCC 64bit + Desktop Qt 5.12.2 GCC 64bit + qt.qt5.5122.gcc_64_kit + 0 + 0 + 0 + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + test + + Qt4ProjectManager.Qt4RunConfiguration:/home/UWE/zj/Qt/Project/test/test.pro + test.pro + + 3768 + false + true + true + false + false + true + + /home/UWE/zj/Qt/Project/build-test-Desktop_Qt_5_12_2_GCC_64bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/src/UWE_projectCode/test.pro.user.e190987 b/src/UWE_projectCode/test.pro.user.e190987 new file mode 100644 index 0000000..473764a --- /dev/null +++ b/src/UWE_projectCode/test.pro.user.e190987 @@ -0,0 +1,326 @@ + + + + + + EnvironmentId + {e190987f-41d5-4936-9d59-dca9c14f9249} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.12.2 GCC 64bit + Desktop Qt 5.12.2 GCC 64bit + qt.qt5.5122.gcc_64_kit + 0 + 0 + 0 + + /home/overlord/文档/Qt Program/build-test-Desktop_Qt_5_12_2_GCC_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/overlord/文档/Qt Program/build-test-Desktop_Qt_5_12_2_GCC_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/overlord/文档/Qt Program/build-test-Desktop_Qt_5_12_2_GCC_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Make + + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + 部署 + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + test + + Qt4ProjectManager.Qt4RunConfiguration:/home/overlord/文档/Qt Program/test/test.pro + test.pro + + 3768 + false + true + true + false + false + true + + /home/overlord/文档/Qt Program/build-test-Desktop_Qt_5_12_2_GCC_64bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/src/quickstart.txt b/src/quickstart.txt new file mode 100644 index 0000000..fd4fa00 --- /dev/null +++ b/src/quickstart.txt @@ -0,0 +1,73 @@ +echo "######################################################################" +echo "=====================quick start===============================" +echo "This script is used for generating the initial version of the files " +echo "used by synthesizing. Users should modified files manually if necessary." +echo "======================================================================" +echo "This script is generated by LIU CHANG. 2020.05.28." +echo "======================================================================" +echo "Last modifed 2020.05.29." +echo "======================================================================" +echo "######################################################################" + +# 检查当前目录下是否存在名为 ProjectPathSetting.tcl 的文件 +if [ -e ProjectPathSetting.tcl ]; then + echo "project path is exist" +# 如果不存在,则通过读取用户输入获取工程路径(PROJECTPATH),并将其存储到 ProjectPathSetting.tcl 文件中。 +else + read -p "Please type the PROJECTPATH : " projectpath + +#确保工程路径 $projectpath_ 结尾没有 / + n=${projectpath%?} + c1="${projectpath##$n}" + if [ "$c1" == "/" ]; then + projectpath_=$n + else + projectpath_=$projectpath + fi + + echo $projectpath_ + echo "set PROJECTPATH ${projectpath_}" > ProjectPathSetting.tcl# 将工程路径写入 ProjectPathSetting.tcl 文件的第一行 + echo 'puts ${PROJECTPATH}' >> ProjectPathSetting.tcl# 写入一行代码,用于在后续脚本中输出工程路径 + echo "ProjectPathSetting.tcl is generated successfully!" +fi + +if [ -e ./src ]; then + echo "./src is exist." +else + read -p "Please type the source code path: " sourcecodepath + ln -s ${sourcecodepath} ./src # 在当前目录下创建名为 src 的软链接,指向 $sourcecodepath + echo "./src soft link is created." +fi + +if [ -e setModuleName.tcl ]; then + echo "../setModuleName.tcl is exist." +else + read -p "Please type the name of top module: " moduleName + echo "set Design ${moduleName}" > setModuleName.tcl + echo 'puts ${Design}' >> setModuleName.tcl + echo " setModuleName.tcl is created." + + cp -r $RELATIVEPATH/Template/* ./ + touch tmp.log + echo "copy files in Template here." + + filelistpath=`find ./src/ -maxdepth 1 -name '*flist*' -type f`# 查找 ./src/ 目录下以 flist 结尾的文件,并将结果存储到变量 filelistpath 中 + echo $filelistpath + filelistname=${filelistpath#*src/}# 从 filelistpath 中提取 flist 文件的名称,即去掉 src/ 的部分 + echo $filelistname + echo '`'"include" '"./'$filelistname'"' > ./dc.work/filelist.v + + incdirlistpath=`find ./src/ -maxdepth 1 -name '*incdir*' -type f` + echo $incdirlistpath + incdirlistname=${incdirlistpath#*src/} + echo $incdirlistname + echo -f ./src/$incdirlistname \ > ./nc.work/sim_filelist.f + + echo ./dc.work/filelist.v \ >> ./nc.work/sim_filelist.f + echo " " >> ./nc.work/sim_filelist.f + echo //Add simulation files bellow >> ./nc.work/sim_filelist.f + echo "./$moduleName/dc.work/filelist.v is generated successfully!" + echo "./$moduleName/nc.work/sim_filelist.f is generated successfully!" + mv ./spyglass.work/demo.prj ./spyglass.work/$moduleName.prj + mv ./spyglass.work/waiver/demo.awl ./spyglass.work/waiver/$moduleName.awl +fi