TPC Tools Debugger

This document describes how to install and use the habanalabs-tpcdebug Visual Studio Code extension, which provides a front-end for debugging Tensor Processor Core™ (TPC™) kernels running in simulation.

The TPC Tools package provides all the components required for developing TPC kernels including a compiler, TPC simulation library and TPC test core library. The TPC test core library enables writing a TPC test program which loads and invokes a TPC kernel in simulation. The TPC simulation library includes a debugger back-end which communicates with the Visual Studio Code TPC extension and provides step level debugging interface in both disassembly and TPC-C source level.

This document does not cover how to write a TPC test program. It describes how to use the debugger for debugging TPC kernels running in an existing TPC test program.

The following figure contains the components of a TPC test program and its connection to a Visual Studio Code’s debug session. The Visual Studio Code communicates with the TPC simulator’s debugger back-end using DAP (Debug Adapter Protocol) over TCP/IP port. The TPC test program can be run on a local or remote machine.

tpc debug diagram

Figure 45 Active TPC Debug Session