⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coregen.restore

📁 VHDL xilinx例子...............
💻 RESTORE
📖 第 1 页 / 共 4 页
字号:
      }   }}# Helper to add files to the project and set their origination. # Valid origination values are:#   0 - User#   1 - Generated#   2 - Imported# Files of origination "User" are added through the facilitator, # otherwise they are added directly to the File Manager.proc AddImportedFiles { iProjHelper files origination } {   switch $origination {      0 { INFO "Adding User files." }      1 { INFO "Adding Generated files." }      2 { INFO "Adding Imported files." }      default {         ERR "Invalid parameter: origination was set to \"$origination\", but may only be 0, 1, or 2."         return 0      }   }   set iFileMgr [ GetFileManager $iProjHelper ]   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}# put a string message in a GUI popup message dialog (if possible),# Get a user Yes/No response. If the GUI isn't active just 'puts' # the message to stdout and return the default value.#		sMessageGUI - string, the message to display in GUI environment#		sMessageCmdLine - string, the message to display in CMdLine environment#		defaultValue - integer, the response to return on a timeout</In>#		hasCancel - integer, defaulting to 0. If 1, show Yes/No/Cancel buttons</In>proc dpm_DisplayQuestionDialog { sMessageGUI sMessageCmdLine defaultValue { hasCancel 0} } {   set iMessageDisplay 0   if {[catch {	   set iInterface [Xilinx::CitP::GetInstance $::xilinx::GuiI::IMessageDlgID]	   set iMessageDisplay [$iInterface GetInterface $::xilinx::GuiI::IMessageDlgID]   }]} { 	   # if we cannot get the IMessageDlgID interface then we are most likely	   # running from command line and not in the GUI.	   puts $sMessageCmdLine   } else {	   # got a good dialog singleton	   set nTimeout 999999	   set buttonValue [$iMessageDisplay Question "Project Navigator" $sMessageGUI $hasCancel $nTimeout]	   if { $buttonValue == 2 } { ; # cancel		   return 3	   } elseif { $buttonValue == 3 } { ; # yes		   return 1	   } elseif { $buttonValue == 4 } { ; # no		   return 2	   } else { # probably timeout		   return $defaultValue	   }   }   return $defaultValue}# Call this proc to restore the ISE project.proc restore { { project_dir "" } } {   set script_file "coregen.restore"   set project_file "coregen.ise"   set backup_file "coregen.fail"   set old_working_dir [pwd]   # Make sure a project isn't already open.   if {[IsProjectOpen]} {      ERR "The project must be closed before performing this operation."      cd $old_working_dir      return   }   # If a project directory was supplied, cd into it.   if {![IsBlank $project_dir]} {     cd $project_dir   }   # capture the project directory ... it should be CWD at this point   set project_dir [pwd]   # before proceeding detect if lock files exist and if so ask the user what to do   set proj_rootname [file rootname $project_file]   set intermediate_proj_dir [file join $project_dir ${proj_rootname}_xdb]   set proj_temp_dir [file join $intermediate_proj_dir "projtemp"]   set repo_temp_dir [file join $proj_temp_dir $project_file]   set new_lock_file [file join $proj_temp_dir ${project_file}.lock]   set old_lock_file [GetProjectLockFile $project_file]   set bLockFilesExist 0   # see if any lock files are there   if {[file exists $new_lock_file] || ![IsBlank "$old_lock_file" ] } {      set bLockFilesExist 1   }      # if lock file(s) are found ask the user what to do   if { $bLockFilesExist == 1 } {       set lockFileMsgGUI "The project to be restored appears to be locked. Remove Lock and continue the restore project process ?"       set lockFileMsgCmdLine "The project to be restored appears to be locked. Please remove the lock file \"$new_lock_file\" and try the restore process again."       set answer [dpm_DisplayQuestionDialog $lockFileMsgGUI $lockFileMsgCmdLine 2]      if { $answer == 1 } {         # remove the lock file(s) and the repo temo dir, if present         # remove the new style lock file if it exists         if {[file exists $new_lock_file]} {            INFO "Removing lock file \"$new_lock_file\"."            file delete -force $new_lock_file         }         # remove the old style lock file if it exists         if {[file exists $old_lock_file]} {            INFO "Removing lock file \"$old_lock_file\"."            file delete -force $old_lock_file         }         # remove the temp proj dir if it exists         if {[file exists $repo_temp_dir]} {            INFO "Removing old temporary project directory \"$repo_temp_dir\"."            file delete -force $repo_temp_dir         }      } else {         # the user answered 'no' so exist without doing anything         INFO "Exiting without restoring project."         return      }   }      # Backup this script because it will be overwritten the next time   # the project is saved, which happens right after it is created!   file copy -force "$script_file" "${script_file}.last"   # Back up the project.   set wasBackedUp [ BackUpProject "$project_file" "$backup_file" ]   # Remove the project file, so that it can be recreated, since the old.   # is presumably corrupted and can no longer be opened.   OnFail [ RemoveProject "$project_file" ] {      cd $old_working_dir      return   }   # Open the project.   HandleException {      set iProjHelper [ OpenFacilProject "$project_file"]   } "A problem occurred while creating the project \"$project_file\"."   if {$iProjHelper == 0} {      cd $old_working_dir      return   }   INFO "Recreating project \"$project_file\"."  set project_settings {      "PROP_DevFamily" "Spartan3E"     "PROP_DevDevice" "xc3s500e"     "PROP_DevPackage" "fg320"     "PROP_DevSpeed" "-4"     "PROP_Top_Level_Module_Type" "HDL"     "PROP_Synthesis_Tool" "XST (VHDL/Verilog)"     "PROP_Simulator" "ISE Simulator (VHDL/Verilog)"     "PROP_PreferredLanguage" "Verilog"     "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 {       "bbfifo_16x8.vhd"       "kcpsm3.vhd"       "kcuart_rx.vhd"       "kcuart_tx.vhd"       "loopback.ucf"       "loopback.vhd"       "my_dcm.xaw"       "uart_rx.vhd"       "uart_tx.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_xilxBitgCfg_Rate_spartan3e" "Default (1)"       "A" "" "" "" "PROPEXT_xilxMapGenInputK_virtex2" "4"       "A" "" "" "" "PROPEXT_xilxSynthAddBufg_spartan3" "8"       "A" "" "" "" "PROPEXT_xilxSynthAddBufg_spartan3e" "24"       "A" "" "" "" "PROPEXT_xilxSynthMaxFanout_virtex2" "500"       "A" "" "" "" "PROP_AutoGenFile" "false"       "A" "" "" "" "PROP_BehavioralSimTop" "Architecture|loopback|Behavioral"       "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" "coregen"       "A" "" "" "" "PROP_Dummy" "dum1"       "A" "" "" "" "PROP_Enable_Incremental_Messaging" "false"       "A" "" "" "" "PROP_Enable_Message_Capture" "true"       "A" "" "" "" "PROP_Enable_Message_Filtering" "false"       "A" "" "" "" "PROP_FitterReportFormat" "HTML"       "A" "" "" "" "PROP_FlowDebugLevel" "0"       "A" "" "" "" "PROP_ISimOtherCompilerOptions_behav" ""       "A" "" "" "" "PROP_ISimOtherCompilerOptions_par" ""       "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" "Default"       "A" "" "" "" "PROP_LastAppliedGoal" "Balanced"       "A" "" "" "" "PROP_LastAppliedStrategy" "Xilinx Default (unlocked)"       "A" "" "" "" "PROP_LastUnlockStatus" "false"       "A" "" "" "" "PROP_Parse_Target" "synthesis"       "A" "" "" "" "PROP_PartitionCreateDelete" ""       "A" "" "" "" "PROP_PartitionForcePlacement" ""       "A" "" "" "" "PROP_PartitionForceSynth" ""       "A" "" "" "" "PROP_PartitionForceTranslate" ""       "A" "" "" "" "PROP_PostMapSimTop" ""       "A" "" "" "" "PROP_PostParSimTop" ""       "A" "" "" "" "PROP_PostSynthSimTop" ""       "A" "" "" "" "PROP_PostTrceFastPath" "false"       "A" "" "" "" "PROP_PostTrceGenDatasheet" "true"       "A" "" "" "" "PROP_PostTrceGenTimegroups" "false" 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -