Commit fcd0f044 authored by Andrey Filippov's avatar Andrey Filippov

Bug fix in restoring states for Vivado, debugging ISE XST

parent 1e47ffcc
...@@ -985,51 +985,56 @@ public class Tool extends Context implements Cloneable, Inheritable { ...@@ -985,51 +985,56 @@ public class Tool extends Context implements Cloneable, Inheritable {
return; return;
} }
DEBUG_PRINT("restoring "+getName()+" state for project "+project); DEBUG_PRINT("restoring "+getName()+" state for project "+project);
QualifiedName qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_PINNED); if (getState()!=TOOL_STATE.KEPT_OPEN) { // do not
String str= pp.get(qn); QualifiedName qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_PINNED);
if (str!=null) try { String str= pp.get(qn);
setPinned(Boolean.parseBoolean(str)); if (str!=null) try {
} catch (Exception e){ setPinned(Boolean.parseBoolean(str));
System.out.println(project+"Failed setPinned(), e="+e);
}
qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_STATE);
str= pp.get(qn);
if (str!=null) {
try {
setStateJustThis(TOOL_STATE.valueOf(str));
} catch (IllegalArgumentException e){
System.out.println("Invalid tool state: "+str+" for tool "+getName()+" in memento");
}
if (getState()==TOOL_STATE.KEPT_OPEN)
setStateJustThis(TOOL_STATE.NEW);
}
qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_TIMESTAMP);
str= pp.get(qn);
if (str!=null) setTimeStamp(str);
qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_LASTRUNHASH);
str= pp.get(qn);
if (str!=null) {
try {
Integer hc=Integer.parseInt(str);
setLastRunHash(hc);
} catch (Exception e){ } catch (Exception e){
System.out.println("Invalid hashCode: "+str+" for tool "+getName()+" for project "+project); System.out.println(project+"Failed setPinned(), e="+e);
} }
} qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_STATE);
clearDependStamps(); str= pp.get(qn);
String statePrefix=PROJECT_TOOL_NAME+name+PROJECT_TOOL_DEPSTATE; if (str!=null) {
String filePrefix= PROJECT_TOOL_NAME+name+PROJECT_TOOL_DEPFILE; try {
for (QualifiedName qName: pp.keySet()){ setStateJustThis(TOOL_STATE.valueOf(str));
// qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_DEPSTATE+state); } catch (IllegalArgumentException e){
if (qName.getLocalName().startsWith(statePrefix)){ System.out.println("Invalid tool state: "+str+" for tool "+getName()+" in memento");
String value=pp.get(qName); }
setStateTimeStamp(qName.getLocalName().substring(statePrefix.length()), value); if (getState()==TOOL_STATE.KEPT_OPEN)
setStateJustThis(TOOL_STATE.NEW);
// See if console with this name is open
} }
if (qName.getLocalName().startsWith(filePrefix)){ qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_TIMESTAMP);
String value=pp.get(qName); str= pp.get(qn);
setFileTimeStamp(qName.getLocalName().substring(filePrefix.length()), value); if (str!=null) setTimeStamp(str);
qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_LASTRUNHASH);
str= pp.get(qn);
if (str!=null) {
try {
Integer hc=Integer.parseInt(str);
setLastRunHash(hc);
} catch (Exception e){
System.out.println("Invalid hashCode: "+str+" for tool "+getName()+" for project "+project);
}
}
clearDependStamps();
String statePrefix=PROJECT_TOOL_NAME+name+PROJECT_TOOL_DEPSTATE;
String filePrefix= PROJECT_TOOL_NAME+name+PROJECT_TOOL_DEPFILE;
for (QualifiedName qName: pp.keySet()){
// qn= new QualifiedName(VDT.ID_VDT, PROJECT_TOOL_NAME+name+PROJECT_TOOL_DEPSTATE+state);
if (qName.getLocalName().startsWith(statePrefix)){
String value=pp.get(qName);
setStateTimeStamp(qName.getLocalName().substring(statePrefix.length()), value);
}
if (qName.getLocalName().startsWith(filePrefix)){
String value=pp.get(qName);
setFileTimeStamp(qName.getLocalName().substring(filePrefix.length()), value);
}
} }
} else {
DEBUG_PRINT("Do not update state of the open session "+getName()+" for project "+project);
} }
} }
......
...@@ -307,6 +307,52 @@ ...@@ -307,6 +307,52 @@
<parameter id="ISESedPaths" type="String" format="CopyValue" <parameter id="ISESedPaths" type="String" format="CopyValue"
label="sed command line" tooltip="Remote file prefix to be removed for the local error parser when running ISE tools" label="sed command line" tooltip="Remote file prefix to be removed for the local error parser when running ISE tools"
default="sed -u 's@/home/%RemoteUser/%ISEProjectRoot/%%ProjectName/@@'"/> default="sed -u 's@/home/%RemoteUser/%ISEProjectRoot/%%ProjectName/@@'"/>
<parameter id="ISEWorkspace" label="Workspace directory" tooltip="Relative (to user home directory) path of the workspace on ISE server"
type="String" default="%ISEProjectRoot" format="CopyValue" readonly="true" />
<parameter id="ISESnapshotSynth"
label="Synthesis snapshot" tooltip="Name of ISE snapshot archive after synthesis"
default="%%ProjectName-synth.tgz"
type="String" format="CopyValue" />
<parameter id="ISESnapshotOptPlace"
label="Placement snapshot" tooltip="Name of ISE snapshot archive after optimization/placement"
default="%%ProjectName-opt-place.tgz"
type="String" format="CopyValue" />
<parameter id="ISESnapshotOpt"
label="Optimization snapshot" tooltip="Name of ISE snapshot archive after optimization"
default="%%ProjectName-opt.tgz"
type="String" format="CopyValue" />
<parameter id="ISESnapshotOptPower"
label="Power optimization snapshot" tooltip="Name of ISE snapshot archive after power optimization"
default="%%ProjectName-opt-power.tgz"
type="String" format="CopyValue" />
<parameter id="ISESnapshotPlace"
label="Placement snapshot" tooltip="Name of ISE snapshot archive after placement"
default="%%ProjectName-place.tgz"
type="String" format="CopyValue" />
<parameter id="ISESnapshotOptPhys"
label="Physical optimization snapshot" tooltip="Name of ISE snapshot archive after physical optimization"
default="%%ProjectName-opt-phys.tgz"
type="String" format="CopyValue" />
<parameter id="ISESnapshotRoute"
label="Routing snapshot" tooltip="Name of ISE snapshot archive after routing"
default="%%ProjectName-route.tgz"
type="String" format="CopyValue" />
<parameter id="ISECleanRestore" label="ISE Clean restore"
tooltip= "Remove remote ISE project files before unpacking snapshot archives"
default="true" visible="true" type="Boolean" format="None"/>
<input> <input>
<group name="Genaral" label="General parameters"> <group name="Genaral" label="General parameters">
...@@ -328,15 +374,6 @@ ...@@ -328,15 +374,6 @@
"VivadoIgnoreSource" "VivadoIgnoreSource"
"VivadoSedPaths" "VivadoSedPaths"
</group> </group>
<group name="ISE" label="ISE general properties">
"ISEProjectRoot"
"ISERemoteDir"
"ISELocalDir"
"ISELocalResultDir"
"ISELogDir"
"ISEIgnoreSource"
"ISESedPaths"
</group>
<group name="VivadoDisable" label="Selectively disable Vivado tools"> <group name="VivadoDisable" label="Selectively disable Vivado tools">
"DisableVivadoSynth" "DisableVivadoSynth"
<!-- "DisableVivadoOptPlace" --> <!-- "DisableVivadoOptPlace" -->
...@@ -357,6 +394,25 @@ ...@@ -357,6 +394,25 @@
"SnapshotOptPhys" "SnapshotOptPhys"
"SnapshotRoute" "SnapshotRoute"
</group> </group>
<group name="ISE" label="ISE general properties">
"ISEProjectRoot"
"ISERemoteDir"
"ISELocalDir"
"ISELocalResultDir"
"ISELogDir"
"ISEIgnoreSource"
"ISESedPaths"
</group>
<group name="ISESnapshots" label="ISE snapshot archives">
"ISECleanRestore"
"ISESnapshotSynth"
<!-- "ISESnapshotOptPlace" -->
"ISESnapshotOpt"
"ISESnapshotOptPower"
"ISESnapshotPlace"
"ISESnapshotOptPhys"
"ISESnapshotRoute"
</group>
</input> </input>
<output> <output>
</output> </output>
......
...@@ -44,20 +44,21 @@ ...@@ -44,20 +44,21 @@
<output> <output>
<line name="ise_pre_restore"> <line name="ise_pre_restore">
"-c" "-c"
<!-- Create project directory on remote server if it did not exist --> <!-- Create workspace directory on remote server if it did not exist -->
"ssh" "ssh"
"-oBatchMode=yes" "-oBatchMode=yes"
"-l %RemoteUser %RemoteHost" "-l %RemoteUser %RemoteHost"
"'" "'"
"mkdir -p" "mkdir -p"
"%ISEProjectRoot" "%ISEWorkspace"
"' ;" "' ;"
<!-- Copy snapshot generated after synthesis from local to remote --> <!-- Copy snapshot generated earlier from local to remote -->
"rsync -avrR -e ssh" <!-- "rsync -avrR -e ssh" -->
"rsync -avr -e ssh"
<!-- from: --> <!-- from: -->
"%ISELocalDir/%%StateFile" "%ISELocalDir/%%StateFile"
<!-- to: --> <!-- to: -->
"%RemoteUser@%RemoteHost:%ISEProjectRoot" "%RemoteUser@%RemoteHost:%ISEWorkspace/"
";" ";"
</line> </line>
...@@ -68,11 +69,19 @@ ...@@ -68,11 +69,19 @@
failure="ERROR" failure="ERROR"
prompt="@@FINISH@@" prompt="@@FINISH@@"
log=""> log="">
"cd ~/%ISEProjectRoot\n" "cd ~/%ISEWorkspace\n"
"set outputDir ~/%ISEProjectRoot/%ISERemoteDir\n" <!-- optionally remove project directory on remote before unpacking snapshot -->
"file mkdir $outputDir\n" <if ISECleanRestore="true">
"open_checkpoint %ISERemoteDir/%%StateFile\n" "rm -f -r"
"puts \"@@FINISH@@\"\n" "%ISEProjectRoot;"
</if>
<!-- Unpack snapshot on remote -->
"tar -xzf"
"%%StateFile\n"
<!-- Delete snapshot archive on remote -->
"rm -f"
"%%StateFile\n"
"echo \"@@FINISH@@\"\n"
</line> </line>
</output> </output>
</tool> </tool>
...@@ -93,18 +102,33 @@ ...@@ -93,18 +102,33 @@
prompt="@@FINISH@@" prompt="@@FINISH@@"
failure="ERROR" failure="ERROR"
log=""> log="">
"cd ~/%ISEProjectRoot\n" "cd ~/%ISEWorkspace\n"
"set outputDir ~/%ISEProjectRoot/%ISERemoteDir\n" <!-- Remove old snapshot if it exists (unlikely as it includes timestamp?) -->
"file mkdir $outputDir\n" "rm -f"
"write_checkpoint -force %ISERemoteDir/%%StateFile\n" "%%StateFile"
"puts \"@@FINISH@@\"\n" "\n"
<!-- Create snapshot at remote (workspace, below project) -->
"tar -czf"
"%%StateFile"
"%%ProjectName"
"\n"
"echo \"@@FINISH@@\"\n"
</line> </line>
<line name="ise_copy_after_save"> <line name="ise_copy_after_save">
"-c" "-c"
<!-- Copy snapshot from remote to local -->
"mkdir -p %ISELocalDir ;" "mkdir -p %ISELocalDir ;"
"rsync -avr -e ssh" "rsync -avr -e ssh"
"%RemoteUser@%RemoteHost:%ISEProjectRoot/%ISERemoteDir/%%StateFile" "%RemoteUser@%RemoteHost:%ISEWorkspace/%%StateFile"
"%%StateDir/" "%%StateDir/ ;"
<!-- Remove snapshot at remote -->
"ssh"
"-oBatchMode=yes"
"-l %RemoteUser %RemoteHost"
"'"
"rm -f"
"%ISEWorkspace/%%StateFile"
"' ;"
</line> </line>
</output> </output>
</tool> </tool>
......
...@@ -183,8 +183,6 @@ ...@@ -183,8 +183,6 @@
</paramtype> </paramtype>
</typedef> </typedef>
<syntax name="XSTPrjFile" format="%(verilog work %%ParamValue%|\n%)" /> <syntax name="XSTPrjFile" format="%(verilog work %%ParamValue%|\n%)" />
</interface> </interface>
<tool name="ISExst" label="run XST" <tool name="ISExst" label="run XST"
...@@ -194,8 +192,12 @@ ...@@ -194,8 +192,12 @@
shell="/bin/bash" shell="/bin/bash"
ignore="%ISEIgnoreSource" ignore="%ISEIgnoreSource"
description="Run XST" description="Run XST"
result="ISESnapshotSynth"
log-dir="ISELogDir" log-dir="ISELogDir"
state-dir="ISELocalDir" state-dir="ISELocalDir"
restore="RestoreISESynthesis"
autosave="AutosaveISESynthesis"
save="SaveISESynthesis"
inherits="ISEToolPrototype" inherits="ISEToolPrototype"
> >
<!-- disable="TRUE" --> <!-- disable="TRUE" -->
...@@ -214,6 +216,11 @@ ...@@ -214,6 +216,11 @@
<depends files="FilteredSourceListPar"/> <depends files="FilteredSourceListPar"/>
<depends files="constraints"/> <depends files="constraints"/>
</depends-list> </depends-list>
<parameter id="clean_start" label="Clean start" tooltip= "Delete all files on remote before running XST"
default="false" visible="true" omit="false" type="BoolYesNo" format="Dash"/>
<parameter id="SkipSnapshotSynth" label="Skip snapshot" tooltip="Do not create snapshot after synthesis"
default="false"
type= "Boolean" format="None"/>
<!-- Constraints parameters --> <!-- Constraints parameters -->
<parameter id="arch" label="VHDL architecture" tooltip= "VHDL Top Level Architecture" <parameter id="arch" label="VHDL architecture" tooltip= "VHDL Top Level Architecture"
default="" visible="true" omit="" type="String" format="Dash"/> default="" visible="true" omit="" type="String" format="Dash"/>
...@@ -463,13 +470,16 @@ ...@@ -463,13 +470,16 @@
readonly="true" visible="true" /> readonly="true" visible="true" />
<parameter id="xst_prj_content" default="%%FilteredSourceList" <parameter id="xst_prj_content" default="%%FilteredSourceList"
type="Stringlist" format="XSTPrjFile" visible="false" /> type="Stringlist" format="XSTPrjFile" visible="false" />
<!-- hidden (calculated) parameters --> <!-- hidden (calculated) parameters -->
<parameter id="AutosaveISESynthesis" default="?%%ChosenActionIndex=0 ^ %SkipSnapshotSynth=false : true, false"
visible="false" type="Boolean" format="None"/>
<parameter id= "useRedirect" label="debug condition" <parameter id= "useRedirect" label="debug condition"
default="?(%info = true | %arch # ) ^ %redirect # : true , false" visible="true" omit="false" type="Boolean" format="None"/> default="?(%info = true | %arch # ) ^ %redirect # : true , false" visible="true" omit="false" type="Boolean" format="None"/>
<input> <input>
<group name="General options"> <group name="General options">
"clean_start"
"SkipSnapshotSynth"
"top" "top"
"ConstraintsFiles" "ConstraintsFiles"
"ifmt" "ifmt"
...@@ -477,10 +487,13 @@ ...@@ -477,10 +487,13 @@
"output_format" <!-- outid="ofmt" --> "output_format" <!-- outid="ofmt" -->
"output_file" <!-- outid="ofn" --> "output_file" <!-- outid="ofn" -->
"target_device" <!-- outid="p" --> "target_device" <!-- outid="p" -->
"---"
"FilteredSourceListPar" "FilteredSourceListPar"
"RawOutFile" "RawOutFile"
"xst_prj" "xst_prj"
"---"
"ISEProjectRoot"
"ISERemoteDir"
</group> </group>
<group name ="Synthesis Options"> <group name ="Synthesis Options">
"constraints" <!-- outid="uc" --> "constraints" <!-- outid="uc" -->
...@@ -588,14 +601,16 @@ ...@@ -588,14 +601,16 @@
> >
"%xst_prj_content" "%xst_prj_content"
</line> </line>
//xst_prj
<line name="ise_copy_pre_synth"> <line name="ise_copy_pre_synth">
"-c" "-c"
"ssh" "ssh"
"-oBatchMode=yes" "-oBatchMode=yes"
"-l %RemoteUser %RemoteHost" "-l %RemoteUser %RemoteHost"
"'" "'"
<if clean_start="true">
"rm -f -r"
"%ISEProjectRoot;"
</if>
"mkdir -p" "mkdir -p"
"%ISEProjectRoot;" "%ISEProjectRoot;"
<if-not tmpdir="/tmp"> <if-not tmpdir="/tmp">
...@@ -726,7 +741,8 @@ ...@@ -726,7 +741,8 @@
"\n" "\n"
"quit\n" "quit\n"
</line> </line>
<!-- TODO: copy results --> <!-- TODO: copy results -->
<!--
<line name="ise_copy_after_partgen"> <line name="ise_copy_after_partgen">
"-c" "-c"
"mkdir -p %ISELocalResultDir ;" "mkdir -p %ISELocalResultDir ;"
...@@ -738,7 +754,22 @@ ...@@ -738,7 +754,22 @@
</if> </if>
"%ISELocalResultDir/" "%ISELocalResultDir/"
</line> </line>
-->
</output> </output>
</tool> </tool>
<!-- Restore tool for ISESynthesis -->
<tool name="RestoreISESynthesis"
project="FPGA_project"
interface="ISEInterface"
package="FPGA_package"
inherits="RestoreISE"/>
<!-- Save tool for ISESynthesis -->
<tool name="SaveISESynthesis"
project="FPGA_project"
interface="ISEInterface"
package="FPGA_package"
inherits="SaveISE"/>
</vdt-project> </vdt-project>
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
<if-not reference_bitfile=""> <if-not reference_bitfile="">
<line name="vivado_copy_pre_opt"> <line name="vivado_copy_pre_opt">
"-c" "-c"
"rsync -avrR -e ssh" <!-- "rsync -avrR -e ssh" -->
"rsync -avr -e ssh"
<!-- from: (trying full name) --> <!-- from: (trying full name) -->
"%VivadoLocalResultDir/%reference_bitfile" "%VivadoLocalResultDir/%reference_bitfile"
<!-- to: --> <!-- to: -->
......
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
"%VivadoProjectRoot" "%VivadoProjectRoot"
"' ;" "' ;"
<!-- Copy snapshot generated after synthesis from local to remote --> <!-- Copy snapshot generated after synthesis from local to remote -->
"rsync -avrR -e ssh" <!-- "rsync -avrR -e ssh" -->
"rsync -avr -e ssh"
<!-- from: --> <!-- from: -->
"%VivadoLocalDir/%%StateFile" "%VivadoLocalDir/%%StateFile"
<!-- to: --> <!-- to: -->
......
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