export csv of padconf for ds0
authorBrad Griffis <bgriffis@ti.com>
Fri, 21 Oct 2016 20:59:16 +0000 (15:59 -0500)
committerBrad Griffis <bgriffis@ti.com>
Fri, 21 Oct 2016 20:59:16 +0000 (15:59 -0500)
am335x-ds0-analysis.dss

index 941060ebea65e87bab17b6df11899c49b2203c1f..474d4b49a3936e8264250dbf8885537197c99038 100644 (file)
@@ -35,12 +35,17 @@ function d2h(d) {return ("00000000" + (d).toString(16)).slice(-8);}
 \r
 function printRegisterValue(ds, name, addr)\r
 {\r
-       value = debugSessionDAP.memory.readWord(0,addr,false);\r
+       value = ds.memory.readWord(0,addr,false);\r
        value_string = d2h(value);\r
        file.write(name + " = 0x" + value_string + "\n");\r
        return value; // return the register value for interrogation\r
 }\r
 \r
+function getRegisterValue(ds, addr)\r
+{\r
+       return ds.memory.readWord(0,addr,false);\r
+}\r
+\r
 // Build a filename that includes date/time\r
 var today = new Date();\r
 var year4digit = today.getFullYear();\r
@@ -120,5 +125,203 @@ if ( reg_val == 0x00200001 ) {
 \r
 file.close();\r
 print("Created file " + filename);\r
+\r
+/***************************************************************************************\r
+Create CSV File that dumps out padconf data for use\r
+in conjunction with the spreadsheet from:\r
+http://processors.wiki.ti.com/index.php/Optimizing_AM335x_IO_Power_in_DeepSleep0\r
+****************************************************************************************/\r
+\r
+\r
+\r
+var filename = userHomeFolder + '/Desktop/' + 'am335x-ds0-padconf' + filename_date + '.csv';\r
+file = new java.io.FileWriter(filename);\r
+\r
+var ds0_padconf_regs = [\r
+       0x44E10800,\r
+       0x44E10804,\r
+       0x44E10808,\r
+       0x44E1080c,\r
+       0x44E10810,\r
+       0x44E10814,\r
+       0x44E10818,\r
+       0x44E1081c,\r
+       0x44E10820,\r
+       0x44E10824,\r
+       0x44E10828,\r
+       0x44E1082c,\r
+       0x44E10830,\r
+       0x44E10834,\r
+       0x44E10838,\r
+       0x44E1083c,\r
+       0x44E10840,\r
+       0x44E10844,\r
+       0x44E10848,\r
+       0x44E1084c,\r
+       0x44E10850,\r
+       0x44E10854,\r
+       0x44E10858,\r
+       0x44E1085c,\r
+       0x44E10860,\r
+       0x44E10864,\r
+       0x44E10868,\r
+       0x44E1086c,\r
+       0x44E10870,\r
+       0x44E10874,\r
+       0x44E10878,\r
+       0x44E1087c,\r
+       0x44E10880,\r
+       0x44E10884,\r
+       0x44E10888,\r
+       0x44E1088c,\r
+       0x44E10890,\r
+       0x44E10894,\r
+       0x44E10898,\r
+       0x44E1089c,\r
+       0x44E108a0,\r
+       0x44E108a4,\r
+       0x44E108a8,\r
+       0x44E108ac,\r
+       0x44E108b0,\r
+       0x44E108b4,\r
+       0x44E108b8,\r
+       0x44E108bc,\r
+       0x44E108c0,\r
+       0x44E108c4,\r
+       0x44E108c8,\r
+       0x44E108cc,\r
+       0x44E108d0,\r
+       0x44E108d4,\r
+       0x44E108d8,\r
+       0x44E108dc,\r
+       0x44E108e0,\r
+       0x44E108e4,\r
+       0x44E108e8,\r
+       0x44E108ec,\r
+       0x44E108f0,\r
+       0x44E108f4,\r
+       0x44E108f8,\r
+       0x44E108fc,\r
+       0x44E10900,\r
+       0x44E10904,\r
+       0x44E10908,\r
+       0x44E1090c,\r
+       0x44E10910,\r
+       0x44E10914,\r
+       0x44E10918,\r
+       0x44E1091c,\r
+       0x44E10920,\r
+       0x44E10924,\r
+       0x44E10928,\r
+       0x44E1092c,\r
+       0x44E10930,\r
+       0x44E10934,\r
+       0x44E10938,\r
+       0x44E1093c,\r
+       0x44E10940,\r
+       0x44E10944,\r
+       0x44E10948,\r
+       0x44E1094c,\r
+       0x44E10950,\r
+       0x44E10954,\r
+       0x44E10958,\r
+       0x44E1095c,\r
+       0x44E10960,\r
+       0x44E10964,\r
+       0x44E10968,\r
+       0x44E1096c,\r
+       0x44E10970,\r
+       0x44E10974,\r
+       0x44E10978,\r
+       0x44E1097c,\r
+       0x44E10980,\r
+       0x44E10984,\r
+       0x44E10988,\r
+       0x44E1098c,\r
+       0x44E10990,\r
+       0x44E10994,\r
+       0x44E10998,\r
+       0x44E1099c,\r
+       0x44E109a0,\r
+       0x44E109a4,\r
+       0x44E109a8,\r
+       0x44E109ac,\r
+       0x44E109b0,\r
+       0x44E109b4,\r
+       0x44E109b8,\r
+       0x44E109bc,\r
+       0x44E109c0,\r
+       0x44E109c4,\r
+       0x44E109c8,\r
+       0x44E109d0,\r
+       0x44E109d4,\r
+       0x44E109d8,\r
+       0x44E109dc,\r
+       0x44E109e0,\r
+       0x44E109e4,\r
+       0x44E109e8,\r
+       0x44E109ec,\r
+       0x44E109f0,\r
+       0x44E109f8,\r
+       0x44E10a00,\r
+       0x44E109f4,\r
+       0x44E10a04,\r
+       0x44E10a08,\r
+       0x44E10a0c,\r
+       0x44E10a10,\r
+       0x44E10a14,\r
+       0x44E10a18,\r
+       0x44E10a1c,\r
+       0x44E10a20,\r
+       0x44E10a24,\r
+       0x44E10a28,\r
+       0x44E10a2c,\r
+       0x44E10a30,\r
+       0x44E10a34];\r
+\r
+// Column Headers for CSV\r
+file.write("Address,dts offset,Raw Reg Val,Mux Mode,Pull,RxActive,Slew\r\n");\r
+\r
+// Fill out one line per loop iteration\r
+for (i=0; i<ds0_padconf_regs.length; i++)\r
+{\r
+       reg_val = getRegisterValue(debugSessionDAP, ds0_padconf_regs[i]);\r
+       file.write("0x" + d2h(ds0_padconf_regs[i])); // Address\r
+       file.write(",0x" + d2h(ds0_padconf_regs[i]-0x44e10800)); // dts offset\r
+       file.write(",0x" + d2h(reg_val)); // Raw Reg Val\r
+       file.write("," + (reg_val & 7) ); // Mux Mode\r
+\r
+       // Pullup/Pulldown Decoding\r
+       if ( (reg_val & (1<<3)) == 0 )\r
+       {\r
+               if( (reg_val & (1<<4)) == 0 )\r
+                       file.write(",pulldown");\r
+               else\r
+                       file.write(",pullup");\r
+       }\r
+       else\r
+       {\r
+               file.write(",no pull");\r
+       }\r
+\r
+       // RxActive\r
+       if( (reg_val & (1<<5)) )\r
+               file.write(",enabled");\r
+       else\r
+               file.write(",disabled");\r
+\r
+       // Slew \r
+       if( (reg_val & (1<<6)) )\r
+               file.write(",slow");\r
+       else\r
+               file.write(",fast");\r
+\r
+       file.write("\r\n");  // CSV specifies CR/LF for line endings\r
+\r
+}\r
+\r
+file.close();\r
+print("Created file " + filename);\r
+\r
 debugSessionDAP.target.disconnect();\r
 \r