示例#1
0
文件: FPGA.py 项目: MIPS/overtest
def LoadFile(fname, addr, len, size=4, memtype=1) :
  
  addr = int(addr, 16)
  len = int(len, 16)
  DAtiny.LoadBinaryFile(fname, addr, len, size, memtype)  
   
  return
示例#2
0
文件: FPGA.py 项目: MIPS/overtest
def MemWrite(dest, data) :
  data = int(data,16)
  addr = getAddress(dest)
  
  DAtiny.WriteMemory(addr, data, 4, 1)
   
  return
示例#3
0
文件: FPGA.py 项目: MIPS/overtest
def readLongSafe(addr) :
  done = 0
  count = 0
  while done == 0 and count < 3 :
    try:
      res = DAtiny.ReadMemory(addr, 4, 1)
      prog = re.compile(r"^[0-9\-]+$")
      if prog.match(str(res)):
        done = 1
      else :
        count = count + 1
        msg = "ERROR : Read error at " + hexaddr + " " + res
        print msg
    except DA.Error, e:
      err_msg = "ERROR : Failed to read 0x%x address from memory" %(addr)
      print err_msg
      count = count + 1
示例#4
0
文件: FPGA.py 项目: MIPS/overtest
def stopTarget() :

  DAtiny.Disconnect()
   
  return
示例#5
0
文件: FPGA.py 项目: MIPS/overtest
def ResetTarget(halt=0) :

  DAtiny.Reset(halt)

  return
示例#6
0
文件: FPGA.py 项目: MIPS/overtest
def UseTarget(Identifier) :
    
  DAtiny.UseTarget(Identifier)
   
  return
示例#7
0
文件: FPGA.py 项目: MIPS/overtest
def SAB(fname, dest, len, esize=4, memtype=1):
  addr = getAddress(dest)
  DAtiny.SaveBinaryFile(fname, addr, len, esize, memtype)
  return
示例#8
0
文件: FPGA.py 项目: MIPS/overtest
def MemRead(dest) :

  addr = getAddress(dest)
  data = DAtiny.ReadMemory(addr, 4, 1)

  return data
示例#9
0
文件: FPGA.py 项目: MIPS/overtest
def WriteMemoryBlock(addr, dataCount, ElememtType, data, MemoryType=1) :
    
  DAtiny.WriteMemoryBlock(addr, dataCount, ElememtType, data, MemoryType)
   
  return