📄 hostmot2_import.tcl
字号:
if {$iFileMgr == 0} { return 0 } foreach filename $files { set file_type 0 set hdl_file 0 set result [$iFileMgr AddFile "$filename" $file_type hdl_file] OnFail $result { if {$result == 6} { INFO "The file \"$filename\" is already in the project." } elseif { $hdl_file == 0 } { ERR "A problem occurred adding the file \"$filename\" to the project." } } OnOkPtr hdl_file { set ifile [ GetInterface $hdl_file $xilinx::Dpm::IFileID IFile ] OnOkPtr ifile { set result [ $ifile SetOrigination $origination ] if {$result != 1} { ERR "A problem occurred setting the origination of \"$filename\" to \"$origination\"." } Release $ifile } } } return 1}proc RestoreProjectSettings { iProjHelper project_settings } { INFO "Restoring device settings" set iScratch [GetScratchPropertyManager $iProjHelper] set iPropIter 0 set iPropSet [ GetInterface $iScratch $xilinx::Dpm::IPropertyNodeSetID IPropertyNodeSet ] OnOkPtr iPropSet { $iPropSet GetIterator iPropIter } set index 0 set lastindex [llength $project_settings] ForEachIterEle prop_node $iPropIter { set prop_instance 0 $prop_node GetPropertyInstance prop_instance if { $index < $lastindex } { set argname [ lindex $project_settings $index ] set argvalue [ lindex $project_settings [ expr $index + 1 ] ] } else { set argname {} set argvalue {} } if { $prop_instance != 0 } { set name {} $prop_instance GetName name if { [string equal $name $argname ] } { $prop_instance SetStringValue $argvalue incr index incr index } } Release $prop_instance } $iScratch Commit # initialize $iProjHelper Init}# Helper to load a source control configuration from a stream# and then store it back into an ise file.proc RestoreSourceControlOptions { prjfile istream } { INFO "Restoring source control options" set config_comp [::Xilinx::Cit::FactoryCreate $::xilinx::Dpm::SourceControlConfigurationCompID ] OnOkPtr config_comp { set ipersist [ $config_comp GetInterface $xilinx::Prjrep::IPersistID ] } OnOkPtr config_comp { set igetopts [ $config_comp GetInterface $xilinx::Dpm::SrcCtrl::IGetOptionsID ] } set helper_comp [::Xilinx::Cit::FactoryCreate $::xilinx::Dpm::SourceControlHelpCompID ] OnOkPtr helper_comp { set ihelper [ $config_comp GetInterface $xilinx::Dpm::SrcCtrl::IHelperID ] } OnOkPtr ipersist { $ipersist Load istream } OnOkPtr ihelper { OnOkPtr igetopts { $ihelper SaveOptions $prjfile $igetopts } } Release $helper_comp $config_comp}proc import { {working_area ""} {staging_area ""} { srcctrl_comp 0 } } { set project_file "hostmot2.ise" set old_working_dir [pwd] # intialize the new project directory (work) and # source control reference directory (staging) to # current working directory, when not specified if { $working_area == "" } { set working_area [pwd] } if { $staging_area == "" } { set staging_area [pwd] } set copy_option relative set import_files { "7i43.ucf" "IDParms.vhd" "atrans.vhd" "boutreg.vhd" "hostmot2.vhd" "hostmotid.vhd" "i43hostmot2.vhd" "i43hostmot2_guide.ncd" "idrom.vhd" "irqlogic.vhd" "kubstepgeny.vhd" "pwmpdmgenh.vhd" "pwmrefh.vhd" "qcounterate.vhd" "qcountersf.vhd" "simplespix.vhd" "timestamp.vhd" "uartr.vhd" "uartx.vhd" "ubrategen.vhd" "watchdog.vhd" "wordpr.vhd" "wordrb.vhd"} INFO "Copying files from \"$staging_area\" to \"$working_area\"" # Must be in the staging directory before calling CopyIn. cd [file normalize "$staging_area"] foreach file $import_files { CopyIn "$file" "$working_area" $copy_option } set iProjHelper 0 # Bail if a project currently open. if {[IsProjectOpen]} { ERR "The project must be closed before performing this operation." return 0 } # Must be in the working area (i.e. project directory) before calling recreating the project. cd [file normalize "$working_area"] INFO "Recreating project \"$project_file\"." HandleException { set iProjHelper [ OpenFacilProject "$project_file"] } "A problem occurred while creating the project \"$project_file\"." if {$iProjHelper == 0} { cd "$old_working_dir" return 0 } set project_settings { "PROP_DevFamily" "Spartan3" "PROP_DevDevice" "xc3s400" "PROP_DevPackage" "tq144" "PROP_DevSpeed" "-4" "PROP_Top_Level_Module_Type" "HDL" "PROP_Synthesis_Tool" "XST (VHDL/Verilog)" "PROP_Simulator" "ISE Simulator (VHDL/Verilog)" "PROP_PreferredLanguage" "VHDL" "PROP_Enable_Message_Capture" "true" "PROP_Enable_Message_Filtering" "false" "PROP_Enable_Incremental_Messaging" "false" } HandleException { RestoreProjectSettings $iProjHelper $project_settings } "A problem occured while restoring project settings." set user_files { "7i43.ucf" "IDParms.vhd" "atrans.vhd" "boutreg.vhd" "hostmot2.vhd" "hostmotid.vhd" "i43hostmot2.vhd" "idrom.vhd" "irqlogic.vhd" "kubstepgeny.vhd" "pwmpdmgenh.vhd" "pwmrefh.vhd" "qcounterate.vhd" "qcountersf.vhd" "simplespix.vhd" "timestamp.vhd" "uartr.vhd" "uartx.vhd" "ubrategen.vhd" "watchdog.vhd" "wordpr.vhd" "wordrb.vhd"} HandleException { AddUserFiles $iProjHelper $user_files } "A problem occured while restoring user files." set imported_files {} set origination 2 HandleException { AddImportedFiles $iProjHelper $imported_files $origination } "A problem occured while restoring imported files." set process_props { "A" "" "" "" "PROPEXT_SynthMultStyle_virtex2" "Auto" "A" "" "" "" "PROPEXT_xilxBitgCfg_DCIUpdateMode_spartan3" "As Required" "A" "" "" "" "PROPEXT_xilxBitgCfg_Rate_spartan3" "Default (6)" "A" "" "" "" "PROPEXT_xilxMapGenInputK_virtex2" "4" "A" "" "" "" "PROPEXT_xilxSynthAddBufg_spartan3" "8" "A" "" "" "" "PROPEXT_xilxSynthMaxFanout_virtex2" "500" "A" "" "" "" "PROP_CPLDFitkeepio" "false" "A" "" "" "" "PROP_CompxlibAbelLib" "true" "A" "" "" "" "PROP_CompxlibCPLDDetLib" "true" "A" "" "" "" "PROP_CompxlibOtherCompxlibOpts" "" "A" "" "" "" "PROP_CompxlibOutputDir" "$XILINX/<language>/<simulator>" "A" "" "" "" "PROP_CompxlibOverwriteLib" "Overwrite" "A" "" "" "" "PROP_CompxlibSimPrimatives" "true" "A" "" "" "" "PROP_CompxlibXlnxCoreLib" "true" "A" "" "" "" "PROP_CurrentFloorplanFile" "" "A" "" "" "" "PROP_DesignName" "hostmot2" "A" "" "" "" "PROP_Dummy" "dum1" "A" "" "" "" "PROP_EnableWYSIWYG" "None" "A" "" "" "" "PROP_Enable_Incremental_Messaging" "false" "A" "" "" "" "PROP_Enable_Message_Capture" "true" "A" "" "" "" "PROP_Enable_Message_Filtering" "false" "A" "" "" "" "PROP_FitterReportFormat" "Text" "A" "" "" "" "PROP_FlowDebugLevel" "0" "A" "" "" "" "PROP_FunctionBlockInputLimit" "38" "A" "" "" "" "PROP_ISimLibSearchOrderFile" "" "A" "" "" "" "PROP_ISimSDFTimingToBeRead" "Setup Time" "A" "" "" "" "PROP_ISimUseCustomCompilationOrder" "false" "A" "" "" "" "PROP_ISimUseCustomSimCmdFile_behav_tb" "false" "A" "" "" "" "PROP_ISimUseCustomSimCmdFile_behav_tbw" "false" "A" "" "" "" "PROP_ISimUseCustomSimCmdFile_gen_tbw" "false" "A" "" "" "" "PROP_ISimUseCustomSimCmdFile_par_tb" "false" "A" "" "" "" "PROP_ISimUseCustomSimCmdFile_par_tbw" "false" "A" "" "" "" "PROP_ISimUutInstName" "UUT" "A" "" "" "" "PROP_ImpactProjectFile" "" "A" "" "" "" "PROP_Parse_Target" "synthesis" "A" "" "" "" "PROP_PartitionCreateDelete" "" "A" "" "" "" "PROP_PartitionForcePlacement" "" "A" "" "" "" "PROP_PartitionForceSynth" "" "A" "" "" "" "PROP_PartitionForceTranslate" "" "A" "" "" "" "PROP_PlsClockEnable" "true" "A" "" "" "" "PROP_PostTrceFastPath" "false" "A" "" "" "" "PROP_PreTrceFastPath" "false" "A" "" "" "" "PROP_SimModelGenerateTestbenchFile" "false" "A" "" "" "" "PROP_SimModelInsertBuffersPulseSwallow" "false" "A" "" "" "" "PROP_SimModelOtherNetgenOpts" "" "A" "" "" "" "PROP_SimModelRetainHierarchy" "true" "A" "" "" "" "PROP_SynthCaseImplStyle" "None" "A" "" "" "" "PROP_SynthDecoderExtract" "true" "A" "" "" "" "PROP_SynthEncoderExtract" "Yes" "A" "" "" "" "PROP_SynthExtractMux" "Yes" "A" "" "" "" "PROP_SynthExtractRAM" "true" "A" "" "" "" "PROP_SynthExtractROM" "true" "A" "" "" "" "PROP_SynthFsmEncode" "Auto" "A" "" "" "" "PROP_SynthLogicalShifterExtract" "true" "A" "" "" "" "PROP_SynthMultStyle" "LUT" "A" "" "" "" "PROP_SynthOpt" "Speed" "A" "" "" "" "PROP_SynthOptEffort" "Normal" "A" "" "" "" "PROP_SynthResSharing" "true" "A" "" "" "" "PROP_SynthShiftRegExtract" "true" "A" "" "" "" "PROP_SynthXORCollapse" "true" "A" "" "" "" "PROP_Top_Level_Module_Type" "HDL" "A" "" "" "" "PROP_UseDataGate" "true" "A" "" "" "" "PROP_UserConstraintEditorPreference" "Constraints Editor" "A" "" "" "" "PROP_UserEditorCustomSetting" "" "A" "" "" "" "PROP_UserEditorPreference" "ISE Text Editor" "A" "" "" "" "PROP_XPowerOptInputTclScript" "" "A" "" "" "" "PROP_XPowerOptLoadPCFFile" "Default" "A" "" "" "" "PROP_XPowerOptLoadVCDFile" "Default" "A" "" "" "" "PROP_XPowerOptLoadXMLFile" "Default" "A" "" "" "" "PROP_XPowerOptOutputFile" "Default" "A" "" "" "" "PROP_XPowerOptVerboseRpt" "false" "A" "" "" "" "PROP_XPowerOtherXPowerOpts" "" "A" "" "" "" "PROP_XplorerMode" "Off" "A" "" "" "" "PROP_bitgen_otherCmdLineOptions" "" "A" "" "" "" "PROP_cpldBestFit" "false" "A" "" "" "" "PROP_cpldfitHDLeqStyle" "Source" "A" "" "" "" "PROP_cpldfit_otherCmdLineOptions" "" "A" "" "" "" "PROP_fitGenSimModel" "false" "A" "" "" "" "PROP_hprep6_autosig" "false" "A" "" "" "" "PROP_hprep6_otherCmdLineOptions" "" "A" "" "" "" "PROP_ibiswriterShowAllModels" "false" "A" "" "" "" "PROP_impactConfigFileName_CPLD" "" "A" "" "" "" "PROP_mapUseRLOCConstraints" "true" "A" "" "" "" "PROP_map_otherCmdLineOptions" "" "A" "" "" "" "PROP_mpprRsltToCopy" "" "A" "" "" "" "PROP_mpprViewPadRptsForAllRslt" "true" "A" "" "" "" "PROP_mpprViewParRptsForAllRslt" "true" "A" "" "" "" "PROP_ngdbuildUseLOCConstraints" "true" "A" "" "" "" "PROP_ngdbuild_otherCmdLineOptions" "" "A" "" "" "" "PROP_parTimingAnalyzerLoadDesign" "true" "A" "" "" "" "PROP_parUseTimingConstraints" "true" "A" "" "" "" "PROP_par_otherCmdLineOptions" "" "A" "" "" "" "PROP_primeCorrelateOutput" "false" "A" "" "" "" "PROP_primeFlatternOutputNetlist" "false" "A" "" "" "" "PROP_primeTopLevelModule" "" "A" "" "" "" "PROP_primetimeBlockRamData" "" "A" "" "" "" "PROP_taengine_otherCmdLineOptions" "" "A" "" "" "" "PROP_xcpldFitDesInit" "Low" "A" "" "" "" "PROP_xcpldFitDesInputLmt_xbr" "32" "A" "" "" "" "PROP_xcpldFitDesMultiLogicOpt" "true" "A" "" "" "" "PROP_xcpldFitDesSlew" "Fast" "A" "" "" "" "PROP_xcpldFitDesTimingCst" "true" "A" "" "" "" "PROP_xcpldFitDesTriMode" "Keeper" "A" "" "" "" "PROP_xcpldFitDesUnused" "Keeper" "A" "" "" "" "PROP_xcpldFitDesVolt" "LVCMOS18" "A" "" "" "" "PROP_xcpldFitTemplate_xpla3" "Optimize Density" "A" "" "" "" "PROP_xcpldFittimRptOption" "Summary" "A" "" "" "" "PROP_xcpldUseGlobalClocks" "true" "A" "" "" "" "PROP_xcpldUseGlobalOutputEnables" "true" "A" "" "" "" "PROP_xcpldUseGlobalSetReset" "true" "A" "" "" "" "PROP_xcpldUseLocConst" "Always" "A" "" "" "" "PROP_xilxBitgCfg_Clk" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_Code" "0xFFFFFFFF" "A" "" "" "" "PROP_xilxBitgCfg_DCMShutdown" "false" "A" "" "" "" "PROP_xilxBitgCfg_Done" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_ASCIIFile" "false" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_BinaryFile" "false" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_BitFile" "true" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_Compress" "false" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_DRC" "true" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_EnableCRC" "true" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_GClkDel0" "11111" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_GClkDel1" "11111" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_GClkDel2" "11111" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_GClkDel3" "11111" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_IEEE1532File" "false" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_IEEE1532File_xbr" "false" "A" "" "" "" "PROP_xilxBitgCfg_GenOpt_ReadBack" "false" "A" "" "" "" "PROP_xilxBitgCfg_M0" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_M1" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_M2" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_Pgm" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_Rate" "4" "A" "" "" "" "PROP_xilxBitgCfg_TCK" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_TDI" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_TDO" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_TMS" "Pull Up" "A" "" "" "" "PROP_xilxBitgCfg_Unused" "Pull Down"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -