Top Banner
ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer
31

ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Dec 21, 2015

Download

Documents

Edwin Ellis
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ARM HARDWARE DEBUGGER

Shane Mahon, Lyndsi Parker, and Drew Shafer

Page 2: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Project Objective

To implement a hardware debugger in the FPGA to communicate to the ARM processor through JTAG.

The hardware debugger will be controlled through a serial port to a separate computer running a graphical software interface.

Page 3: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Overview

Hardware JTAG interface to ARM UART interface to RS232 Bridge from UART to JTAG communication

Software Serial communication ISA for JTAG

commands Implement debug commands GUI interface

Page 4: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Teamwork Breakdown

Shane Mahon Physical hardware to connect ARM JTAG pins to FPGA Simulation of JTAG Logic analyzer debug

Lyndsi Parker JTAG interface JTAG to UART interface Presentation preparation

Drew Shafer Software code Graphical interface UART code Simulation of Serial and JTAG

Page 5: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Architecture

Page 6: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ArchitectureARM Processor

Page 7: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ArchitectureARM Processor

Page 8: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ArchitectureARM to FPGA Connections

ARM JTAGARM JTAG

FPGA Accessory

Pins

FPGA Accessory

Pins

Logic Analyzer Probes

Logic Analyzer Probes

Page 9: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ArchitectureJTAG Hardware

ResetReset WaitWait

TLRTLR

DRDR

IRIR

RTIRTI

CompleteComplete

Page 10: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Length

Test Logic Reset (resets JTAG state machine on ARM)

Run Test Idle (advances ARM pipeline once)

Instruction Register

Data Register

ArchitectureBridge Hardware

0000 00000000 0000

1111 11111111 1111

1000 - - - -1000 - - - -

0 - - - - - - -0 - - - - - - -

Instruction

Variable Length Data

Page 11: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ArchitectureUART Hardware

Downloaded open source UART code http://www.opencores.org/cores/sasc/

Began debug by creating a loopback Code required some minor modifications

Page 12: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ImplementationRS232

Page 13: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ImplementationJTAG Software

Implemented Functions Read ID Code Bypass Register Halt the Processor Read/Write a Register Read/Write Multiple Registers Read/Write Memory Execute a Single Instructions Return from Halt

Code developed from JTAG-Arm9 http://jtag-arm9.sourceforge.net/

Page 14: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

ImplementationUser Interface

Created in Visual Studio using C#

Page 15: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Demo: JTAG ID Code

Page 16: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Demo: Halting the Processor

Page 17: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Demo: Read/Write Registers

Page 18: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Demo: Execute Add Instruction

Page 19: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Demo: Read/Write Memory

Page 20: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Design Tradeoffs

JTAG data register accesses are not pipelined.

Debug instructions are not interleaved. For simplicity in executing ARM

instructions, entire scan chain was shifted although only 33 bits needed for simple instructions.

Page 21: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Additional Functionality

Execute code loaded from a file View disassembly of code Breakpoints/watch points Block memory accesses Standard connector for JTAG to FPGA

connections

Page 22: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Lessons Learned

Start simulation of Verilog early Ensure that adequate documentation is

available 8 LEDs != Logic Analyzer Never connect 16.5V directly to the ARM

Processor

Page 23: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Backup Slides

Page 24: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Logic Analyzer Trace

ADDI Instruction

Page 25: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Logic Analyzer Trace

Bypass

Page 26: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Logic Analyzer Trace

IDCODE

Page 27: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Logic Analyzer Trace

Read Debug Status Register

Page 28: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Logic Analyzer Trace

Select Scan Chain

Page 29: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

Logic Analyzer Trace

Write Debug Control Register

Page 30: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

TLL5000 Connections

FPGA Ball

Schematic Name

Functional Use

F26 FPGA_ACC4 tclk

G25 FPGA_ACC5 tms

H25 FPGA_ACC6 tdi

G26 FPGA_ACC7 tdo

H26 FPGA_ACC8 trst

FPGA Ball

Schematic Name

Functional Use

M2 RS232_TX tx_o

M1 RS232_RX rx_i

N1 RS232_CTS cts_i

M6 RS232_RTS rts_o

Page 31: ARM HARDWARE DEBUGGER Shane Mahon, Lyndsi Parker, and Drew Shafer.

TLL5000 Connections