Commit 06b222bd authored by Andrey Filippov's avatar Andrey Filippov

Debug/bug fix

parent 703c6d5c
...@@ -26,6 +26,7 @@ import com.elphel.vdt.VDT; ...@@ -26,6 +26,7 @@ import com.elphel.vdt.VDT;
import com.elphel.vdt.VerilogUtils; import com.elphel.vdt.VerilogUtils;
import com.elphel.vdt.core.tools.params.Tool; import com.elphel.vdt.core.tools.params.Tool;
import com.elphel.vdt.core.tools.params.ToolSequence; import com.elphel.vdt.core.tools.params.ToolSequence;
import com.elphel.vdt.ui.MessageUI;
import com.elphel.vdt.veditor.VerilogPlugin; import com.elphel.vdt.veditor.VerilogPlugin;
import com.elphel.vdt.veditor.preference.PreferenceStrings; import com.elphel.vdt.veditor.preference.PreferenceStrings;
...@@ -367,6 +368,25 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe ...@@ -367,6 +368,25 @@ public class SelectedResourceManager implements IWindowListener, ISelectionListe
// Used when restoring from memento // Used when restoring from memento
public void setChosenVerilogFile(IResource file) { public void setChosenVerilogFile(IResource file) {
if (file != null){
if (file.getType() != IResource.FILE) {
String msg="Tried to use "+file+" as HDL file";
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
MessageUI.error(msg);
}
System.out.println(msg);
return;
}
if (!VerilogUtils.isHhdlFile((IFile)file)){
String msg="Tried to use non-HDL "+file+" as HDL file";
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) {
MessageUI.error(msg);
}
System.out.println(msg);
return;
}
}
fChosenVerilogFile=file; fChosenVerilogFile=file;
IProject project=getSelectedProject(); IProject project=getSelectedProject();
IProject newProject= (file == null)? null: file.getProject(); IProject newProject= (file == null)? null: file.getProject();
......
...@@ -277,6 +277,8 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -277,6 +277,8 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
System.out.println("Initiating DB rebuild HDLFile="+HDLFile); System.out.println("Initiating DB rebuild HDLFile="+HDLFile);
toolSequence.setUnfinishedBoot(null,true); toolSequence.setUnfinishedBoot(null,true);
VerilogUtils.getTopModuleNames((IFile) HDLFile); // will initiate DB rebuild, updateDirty and call doLoadDesignMenu(); VerilogUtils.getTopModuleNames((IFile) HDLFile); // will initiate DB rebuild, updateDirty and call doLoadDesignMenu();
// java.lang.ClassCastException: org.eclipse.core.internal.resources.Project cannot be cast to org.eclipse.core.resources.IFile
// at com.elphel.vdt.ui.views.DesignFlowView.doLoadDesignMenu(DesignFlowView.java:279)
} }
return; return;
} }
...@@ -1266,6 +1268,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener { ...@@ -1266,6 +1268,9 @@ public class DesignFlowView extends ViewPart implements ISelectionListener {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("Initiating DB rebuild HDLFile="+HDLFile); System.out.println("Initiating DB rebuild HDLFile="+HDLFile);
VerilogUtils.getTopModuleNames((IFile) HDLFile); VerilogUtils.getTopModuleNames((IFile) HDLFile);
// java.lang.ClassCastException: org.eclipse.core.internal.resources.Project cannot be cast to org.eclipse.core.resources.IFile
// at com.elphel.vdt.ui.views.DesignFlowView.restoreState(DesignFlowView.java:1270)
// at com.elphel.vdt.ui.views.DesignFlowView.createPartControl(DesignFlowView.java:237)
} else { } else {
if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER)) if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_OTHER))
System.out.println("Skipping DB rebuild HDLFile=NULL"); System.out.println("Skipping DB rebuild HDLFile=NULL");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment