Skip to content

Instantly share code, notes, and snippets.

@pansila
Created January 28, 2019 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pansila/ab1e1a03c41cd1a8693c999904ef9fef to your computer and use it in GitHub Desktop.
Save pansila/ab1e1a03c41cd1a8693c999904ef9fef to your computer and use it in GitHub Desktop.
bitfile download configuration for openocd
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME xc6v
}
set XC6_CFG_IN 0x05
set XC6_JSHUTDOWN 0x0d
set XC6_JPROGRAM 0x0b
set XC6_JSTART 0x0c
set XC6_BYPASS 0x3f
# Device ID Code IR Length Part Name
# 84250093 10 XC6VLX240T
# 44244093 10 XC6VLX75T
# c2a96093 10 XC6VLX50T
# 442a8093 10 XC6VHX380T
jtag newtap $_CHIPNAME tap -irlen 10 -ignore-version \
-expected-id 0x84250093
pld device virtex2 $_CHIPNAME.tap
proc xc6v_program {tap} {
global XC6_JSHUTDOWN XC6_JPROGRAM XC6_JSTART XC6_BYPASS
irscan $tap $XC6_JSHUTDOWN
irscan $tap $XC6_JPROGRAM
irscan $tap $XC6_JSTART
irscan $tap $XC6_BYPASS
}
#xtp038 and xc3sprog approach
proc xc6v_program_iprog {tap} {
global XC6_JSHUTDOWN XC6_JSTART XC6_BYPASS XC6_CFG_IN XC6_CHIPNAME
irscan $tap $XC6_JSHUTDOWN
runtest 16
irscan $tap $XC6_CFG_IN
# xtp038 IPROG 16bit flipped
drscan $tap 16 0xffff 16 0x9955 16 0x66aa 16 0x850c 16 0x7000 16 0x0004
irscan $tap $XC6_JSTART
runtest 32
irscan $tap $XC6_BYPASS
runtest 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment