Nios® V Embedded Processor Design Handbook

ID 726952
Date 5/13/2024
Document Table of Contents JTAG to Avalon® Host Bridge Core

The JTAG to Avalon® Host Bridge cores provide a connection between System Console and Platform Designer systems via the JTAG interfaces. System Console can initiate Avalon® Memory-Mapped ( Avalon® -MM) transactions by sending encoded streams of bytes via the core. The core support reads and writes, but not burst transactions.

The debugging process is as follows:

  1. Starting System Console
  2. Locating available services
  3. Opening a service
  4. Applying Tcl commands
  5. Closing a service

The example below demonstrates a Tcl script to access the device registers of Generic Serial Flash Interface Intel® FPGA IP thru System Console.

Sample .tcl script

#set GSFI IP CSR base address according to Platform Designer system
set base 0x8000000

#set GSFI IP register map
set control_register [expr {$base + 0x0}]
set spi_clock_baud_rate_register [expr {$base + 0x4}]
set cs_delay_setting_register [expr {$base + 0x8}]
set read_capturing_register [expr {$base + 0xc}]
set operating_protocols_setting [expr {$base + 0x10}]
set read_instr [expr {$base + 0x14}]
set write_instr [expr {$base + 0x18}]
set flash_cmd_setting [expr {$base + 0x1c}]
set flash_cmd_ctrl [expr {$base + 0x20}]
set flash_cmd_addr_register [expr {$base + 0x24}]
set flash_cmd_write_data_0 [expr {$base + 0x28}]
set flash_cmd_write_data_1 [expr {$base + 0x2c}]
set flash_cmd_read_data_0 [expr {$base + 0x30}]
set flash_cmd_read_data_1 [expr {$base + 0x34}]

#locate and open JTAG to Avalon Master Bridge service
set mp [claim_service master [lindex [get_service_paths master] 0] top]  
#print the value of Control Register
set reg [master_read_32 $mp $control_register 0x1]
puts "Control Register : $reg"

#modify the value of Control Register’s Enable bit field  
#to disable the GSFI IP
set reg2 [expr {$reg & 0xfffffffe}]
master_write_32 $mp $control_register $reg2  

#close JTAG to Avalon Master Bridge service
close_service master $mp