On Wed, 28 Jun 2017, Benjamin Henrion wrote:
On Jun 27, 2017 01:29, "Steve Tell" <[email protected]> wrote:
The attached patch against git head adds to the python bindings
Can you use this bindings with something like ipython?
I would imagine so.
I generally write scripts, but it would work the same interactively.
The urjtag classes are meant to be used in an object-oriented style;.
Or do you have examples of python code?
There's a bit of tutorial in doc/urjtag-python.txt,
and a little bit of sample code in bindings/python/t_*.py
Its hard to do demonstrate much without getting into knowledge of the
registers and instruction of the chips on your jtag chain.
A most basic usage is something like:
#!/usr/bin/python
import sys
sys.path.append( "/usr/local/lib64/python2.7/site-packages" ) # might be needed
import urjtag
chain = urjtag.chain()
chain.cable("JTAGKey") # name of your cable here
chain.tap_detect()
print chain.len()
print chain.partid(0)
# object-oriented register usage:
idreg=chain.get_register(0, "DIR", "IDCODE");
idreg.shift_ir();
idreg.shift_dr();
print idreg.get_dr_out_string(11,1) # fetch mfr-id field of register scanout
value as string
print idreg.get_dr_out(11,1) # as an integer
# if it made sense to write to the id register, you could do somthing like:
idreg.set_dr_in(0xf00f, 31, 16); # change the high 16 bits
idreg.set_dr_in(1, 3, 3); # and change bit 3
idreg.shift_dr()
chain.flush() # sometimes needed to make sure urjtag flushes to the hardware
Steve
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development