Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
LEAP provides service for a variety of debugging styles:
Debug logs (simulation only)
LEAP generates a debug scan chain as part of every standard compilation. Software may request a dump of the contents of the scan chain at any time. The full / empty states of all soft connections are automatically added to the chain. User code may also specify objects to scan by generating a list of objects to monitor:
DEBUG_SCAN_FIELD_LIST dbg_list = List::nil; dbg_list <- addDebugScanField(dbg_list, "State", state); dbg_list <- addDebugScanMaybeField(dbg_list, "Rewind context ID", rewindCtxId); dbg_list <- addDebugScanMaybeField(dbg_list, "Emulate context ID", emulateCtxId);
and attaching the list to a debug scan node:
let dbgNode <- mkDebugScanNode("FUNCP REGMGR State", dbg_list);
The code accepts any object that can be mapped to Bits.
Fields added to the debug scan chain must be always enabled or the debug scan chain may deadlock. Methods for adding debug scan entries are implemented in source:“trunk/modules/leap/libraries/platform-services/common-services/debug-scan-service/debug-scan-local.bsv”.
The chain is scanned out to software when the Scan() method is invoked in DEBUG_SCAN_SERVER_CLASS. HAsim triggers the method automatically when it appears a timing model has deadlocked.
Scanning may also be triggered during a run using LEAP’s live file system. By default, the live file system is in the leap_debug/live subdirectory of a running workload. Reading from the debug-scan live file (i.e. leap_debug/live/debug-scan) triggers a scan and writes the result to the file. The debug-scan live file may be read multiple times during a run and triggers a new scan every time it is read. It is implemented with a named pipe.
STDIO / printf
LEAP’s debugging section of STDIO service can be used for debugging with print statements. This service is available both on hardware and in simulation. A special STDIO node, mkStdIO_Debug() is provided that can be enabled by the STDIO_ENABLE_DEBUG AWB parameter. See the STDIO#Debugging for details.