#
# Andes AICE
#
# http://www.andestech.com
#

jtag newtap $_CHIPNAME cpu0 -expected-id 0x1000063d

set number_of_core 01
for {set i 0} {$i < $number_of_core} {incr i} {
    set _TARGETNAME $_CHIPNAME.cpu$i
    target create $_TARGETNAME nds32_v3 -endian little -chain-position $_TARGETNAME -coreid $i -variant $_ACE_CONF
    set _CONNECTED connected$i
    set $_CONNECTED 0
    $_TARGETNAME configure -event gdb-attach {
        if  {$_CONNECTED == 0} {
          #<--boot>
          set $_CONNECTED 1
          #targets $_TARGETNAME
        }
    }
    $_TARGETNAME configure -event gdb-detach {
        if {$_CONNECTED == 1} {
          set $_CONNECTED 0
        }
    }
}
