Example #1
0
 def scan_chain(self):
   urc = urjtag.chain()
   urc.bsdl_set_path(self.bsdlp)
   urc.cable("roach-2")
   urc.test_cable()
   urc.set_frequency(100000)
   #not sure why this is neccesary, but without it the chain does not scan
   urc.set_trst(0)
   urc.reset()
   urc.tap_detect()
   urc.disconnect()
Example #2
0
 def __init__(self,cable,partid,index,a_width,d_width):
   self.u=urjtag.chain()
   self.u.cable(cable)
   #u.cable("DLC5 ppdev /dev/parport0")
   self.u.tap_detect()
   self.m_width=max(a_width,d_width)
   self.mask=(1<<self.m_width)-1
   #Now we find the part we want to control
   for i in range(0,self.u.len()):
      self.u.part(i)
      if self.u.partid(i)== partid and index==1: 
         self.u.add_register("BAR",self.m_width+2)
         self.u.add_instruction("BUSACC","000010","BAR")
         self.u.set_instruction("BUSACC")
         self.u.shift_ir()
         self.part_nr = i
      else:
         self.u.set_instruction("BYPASS")
         self.u.shift_ir()
      if self.u.partid(i)==partid:
         index -= 1
Example #3
0
def printf(format, *args):
    """Format args with the first argument as format string, and print.
     If the format is not a string, it is converted to one with str.
     You must use printf('%s', x) instead of printf(x) if x might
     contain % or backslash characters."""
    sys.stdout.write(str(format) % args)


import sys
sys.path.append(".")

import urjtag

#urjtag.loglevel(0) # ALL

urc = urjtag.chain()
printf("%s\n", urc)

urc.cable("JTAGKey")
printf("urc.cable done %s\n", urc)

urc.test_cable()
printf("urc.test_cable done\n")

# trst = urc.get_trst()
# printf("TRST=%d\n", trst)
# urc.set_trst(0)
# trst = urc.get_trst()
# printf( "TRST set 0 -> %d\n", trst)

# urc.set_trst(1)
Example #4
0
# works in both python 2 and 3
def printf(format, *args):
     """Format args with the first argument as format string, and print.
     If the format is not a string, it is converted to one with str.
     You must use printf('%s', x) instead of printf(x) if x might
     contain % or backslash characters."""
     sys.stdout.write(str(format) % args)

import sys
sys.path.append( "." )

import urjtag

#urjtag.loglevel(0) # ALL

urc = urjtag.chain()
printf("%s\n", urc);

urc.cable("JTAGKey")
printf("urc.cable done %s\n", urc)

urc.test_cable()
printf("urc.test_cable done\n")

# trst = urc.get_trst()
# printf("TRST=%d\n", trst)
# urc.set_trst(0)
# trst = urc.get_trst()
# printf( "TRST set 0 -> %d\n", trst)

# urc.set_trst(1)
Example #5
0
import urjtag

urc1 = urjtag.chain()

urc1.cable('usbblaster')        
urc1.reset()                                      
urc1.addpart(10)                                                      
urc1.addpart(4)                                                       

urc1.part(1)                                                          
urc1.set_instruction('BYPASS')     

urc1.shift_ir()                                                       
urc1.shift_dr()                                                       


urc1.part(0)                                                          
urc1.add_register('BSR', 240)                                         
urc1.add_instruction('SAMPLE', '0000000101', 'BSR')                   
urc1.set_instruction('SAMPLE')                                        
                                                       

urc1.shift_ir()                                                       
urc1.shift_dr()                                                       

dr = urc1.get_dr_out_string()                                               
print(dr)
Example #6
0
from i2c_tools import *
from i2c_obj import *
from Si57x import *
from ADN4604 import *
from FM_S14 import *
import urjtag
import time
#First set the SCANSTA and configure I2C controller
#as the configuration is long, I've added a way
#to disable itm, when you know, that the board
#is already configured
reconfigure = True
#reconfigure = False
if reconfigure:
  t1=time.time()
  u=urjtag.chain()
  u.cable("xpc_ext")
  u.set_frequency(6000000)
  u.addpart(8)
  u.run_svf("st111.svf")
  u.tap_detect()
  print "Next operation may take even 15 minutes. Don't interrupt it, ot the XPC programmer may hang"
  u.run_svf("AFCK_i2c_bscan_ctrl.svf")
  u.disconnect()
  t2=time.time()
  print "Initialization time:" + str(t2-t1)
  del(u)
#If we got here, it means, that SCANSTA111 got configured
#and I2C_BSCAN controller is loaded into FPGA

#build the controller interface object