This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AFE7906:AF7906脚本寄存器日志文件创建 Afe79xxPg1Format5.txt

Guru**** 2340070 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/rf-microwave-group/rf-microwave/f/rf-microwave-forum/1499715/afe7906-af7906-script-register-log-file-creation-afe79xxpg1format5-txt

器件型号:AFE7906

工具/软件:

你(们)好

我在定制模块中使用 AF7906

我尝试运行脚本 AFE Latte 2.6版本软件、我将得到'Afe79xxPg1Format5.txt"

但现在我安装了最新版本2.8在这里我得到了'Afe79xxPg1Format5C.txt'

有没有反正我可以得到旧格式'Afe79xxPg1Format5.txt'在新的软件版本2.8 Latte

1.我运行 Latte(它似乎现在被称为 AFE79xx )

2.运行 setup.py (run->buffer)

3.运行 devlnit.py (run->buffer)

4.输入以下命令。

   logDumpInst.logFormat = 0x21
  logDumpInst.rewriteFile = 1
  logDumpInst.rewriteFileFormat4 = 1
  device.optimizeWrites = 0
  device.rawWriteLogEn = 1

6.跑步

7. 完成第6步后,我得到了一个'Afe79xxPg1Format5.txt'。 在旧版本中、但在新版本中、它在 C 语言中

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Rajeshmani:

    我们看到在最新版本中替换了此日志格式。 我们正在与团队核实、以便在下一次 Latte 更新中将此内容重新添加。  

    "那你打算怎么办?" 您不能使用格式为5 C 的 C 代码吗?  

    可以完成的一件事是使用格式1、并使用如下所示的脚本将其转换为所需的格式:

    Filename = 'Afe79xxPg1'
    inpFile = open(DEVICES_DIR+Filename+r".txt",'r')  #Path and filename for Latte's dump file
    lines = inpFile.readlines()
    f2 = open(DEVICES_DIR+Filename+r"_Ccode.txt",'w')  #Path and filename for SPI output file 
    
    f2.write('\tint rdVal=0;\n')
    f2.write('\tint pollIter=0;\n')
    f2.write('\tint pollVal=0;\n')
    f2.write('\tint pollDel=1000;\n\n')
    
    lineNo = 1
    for line in lines:
    	if line[0:8]=='SPIWrite': #SPIWrite
    		addr = int(line[9:13],16)
    		data = int(line[14:16],16)
    		lsb = int(line[17],16)
    		msb = int(line[19],16)
    		
    		if lsb!=0 or msb!=7:
    			f2.write('\trdVal = spi_read(inst_ptr,0x%x);\n'%addr)
    			f2.write('\tspi_write(inst_ptr, 0x%x,(rdVal&0x%x)|0x%x);\n'%(addr,(0xff&(~((2**(msb-lsb+1)-1)<<lsb))),data))
    		else:
    			f2.write("\tspi_write(inst_ptr,0x%x,0x%x);\n"%(addr,data))#device.writeReg(addr,data)
    	elif line[0:13]=='SPIBurstWrite':
    		linesplit = line.split(']')[0].split(',')
    		address = int(linesplit[0][-4:],16)
    		counterdata = 0
    		f2.write("//BurstWriteStart 0x%x 0x%x\n"%(address,len(linesplit[1:])))#device.writeReg(addr,data)
    		for data in linesplit[1:]:
    			f2.write("\tspi_write(inst_ptr,0x%x,0x%x);\n"%(address+counterdata,int(data[-2:],16)))#device.writeReg(addr,data)
    			counterdata =counterdata+1
    		f2.write("//BurstWriteEnd\n")
    	elif line[0:12]=='SPIReadCheck': #SPIReadCHeck
    		addr = int(line[13:17],16)
    		data = int(line[22:24],16)
    		lsb = int(line[18],16)
    		msb = int(line[20],16)
    		f2.write('\trdVal = spi_read(inst_ptr,0x%x);\n'%addr)
    		f2.write('\tif ((rdVal&0x%x) != 0x%x)\n'%((2**(msb-lsb+1)-1)<<lsb,data))
    		f2.write('\t\txil_printf("Readcheck Error in Line %d of bringupLog; Register: 0x%x; Expected: 0x%x; Read Value: 0x%%x;\\r\\n",rdVal);\n'%(lineNo,addr,data))
    	elif line[0:7]=='SPIPoll': #SPIPoll
    		addr = int(line[8:12],16)
    		data = int(line[17:19],16)
    		lsb = int(line[13],16)
    		msb = int(line[15],16)
    		f2.write('\tfor(pollIter=0;pollIter<10000;pollIter++)\n')
    		f2.write('\t{\tpollVal = spi_read(inst_ptr,0x%x);\n'%addr)
    		f2.write('\t\tif ((pollVal&0x%x) == 0x%x)\n'%((2**(msb-lsb+1)-1)<<lsb,data))
    		f2.write('\t\t\tbreak;\n')
    		f2.write('\t\tusleep(pollDel);\n\t}\n')
    		f2.write('\tif (pollIter==9999)\n')
    		f2.write('\t\txil_printf("Poll Error in Line %d of bringupLog; Register: 0x%x;Read Value: 0x%%x;\\r\\n",pollVal);\n'%(lineNo,addr))
    		f2.write('\t//xil_printf("Number of iterations of poll in line %d 0x%x : %%d\\r\\n",pollIter);\n'%(lineNo,addr))
    	elif line[0:4]=='WAIT': #Wait
    		waitS = float(line[5:10])
    		f2.write("\tusleep(%d);\n"%(int(waitS*1e6)))
    	lineNo=lineNo+1
    f2.write('\n')		
    inpFile.close()
    f2.close()
    

    此致、

    Camilo