# * Copyright 2024 Thales AVS
# * Copyright 2024 PlanV Technologies
# * Copyright and related rights are licensed under the Solderpad Hardware
# * License, Version 0.51 (the Ã¢ÂÂLicenseÃ¢ÂÂ); you may not use this file except in
# * compliance with the License.  You may obtain a copy of the License at
# * http://solderpad.org/licenses/SHL-0.51. Unless required by applicable law
# * or agreed to in writing, software, hardware and materials distributed under
# * this License is distributed on an Ã¢ÂÂAS ISÃ¢ÂÂ BASIS, WITHOUT WARRANTIES OR
# * CONDITIONS OF ANY KIND, either express or implied. See the License for the
# * specific language governing permissions and limitations under the License.
# *
# * Author: Nicolas Levasseur, Thales AVS
# * Additional contributions by Angela Gonzalez, PlanV Technologies
# * Date:   8.11.2024
# * Description: Configuration file for openocd connection
# *
# */

adapter driver aji_client

if { [info exists CHIPNAME] } {
  set _CHIPNAME $CHIPNAME
} else {
  set _CHIPNAME agilex7
}

jtag newtap $_CHIPNAME.fpga tap -irlen 10 -expected-id 0xC341A0DD 
#0xC341A0DD

# VJTAG ID : 
# -------------------------------------------------------
# |   31 - 27    | 26 - 19 |   18 - 8    |     7 - 0    |
# |-----------------------------------------------------|
# | Node Version | Node ID | Node mfg_id | Node_inst_id |
# -------------------------------------------------------
# Info :     node  0 idcode=00406E00 position_n=0  CVA6 core #0

vjtag create $_CHIPNAME.fpga.tap.cva6.0 -chain-position $_CHIPNAME.fpga.tap -expected-id 0x00406E00
target create $_CHIPNAME.cva6.0 riscv -chain-position $_CHIPNAME.fpga.tap.cva6.0 -coreid 0 

scan_chain

init

halt
echo "Ready for Remote Connections"

