Stefan Wallentowitz - November 12, 2015
Hardware building blocks for SoC Debugging
Infrastructure for debug systems for system-on-chip around those building blocks
Basic host libraries to interact with the debug system
Benefit from existing building blocks
Interoperability with other SoCs
Efficient debug systems become more important
Modular design, clear interfaces, composability
Not defined: Physical interface and protocols
Use Generic Logic Interface Project (glip) as transport
One common interface for different interfaces
Wrappers around open source interfaces
Currently: USB 2/3 (with Cypress FX), JTAG, PCIE
Simple FIFO interface, usually 16-bit
Hardware:
wire [WIDTH-1:0] data;
wire valid;
wire ready;
Software:
void glip_send(size_t len, uint16_t* data);
// poll
int glip_receive(size_t maxlen, uint16_t* data);
// callback
glip_register_callback(void (*recv)(size_t maxlen, uint16_t* data));
Control, data and events are transmitted as packets
Each module and the host have a unique ID
Basic Format:
Packets are routed over a NoC
Baseline is a simple, uni-directional ring
Low cost
Arrange positions with traffic demands
Each module and host are participants
Common interface: NoC packets
Modules can consume and produce packets
Convenience wrapper: Memory-mapped registers
Common basic functions: version, capabilities, enumeration
Share a timebase via a globally distributed counter
Implement traditional run-control debugging
Control functions: Run, step, reset
Data functions: Read and write registers
Breakpoint functions: Set and enable
Generate breakpoint event
Emit debug events of execution trace
Configurable
On each instruction, branch, etc.
Compression mechanism
Set trigger conditions to reduce trace sizes
Correlate trigger events
Ease debugging of complex systems
"Trace this core if the DMA takes to long"
"Trace the interconnect load during synchronization events"
Separate trigger network for precise timing correlation
Debug modules with an entire subsystem
Configure trace events to go there
Aggregate and filter events
Small microporgrams to genrate information from data
Can generate trace events or even control messages
Standard: online debugging
Possible multiplexed trace targets, e.g.,
Trace to SD card
Trace to system memory
Common module to all open soc debug systems
Platform/Chip identifier
Possibly clock gating for emulation mode
Overflow configuration:
Gate clocks (care needed with respect to I/O)
Drop packets and notify host about this
Trace and debug devices
Memory access module (read, write memory)
Interconnect load traces
...
void osd_send(uint16_t module, uint8_t class,
size_t len, uint16_t *packet) {
int16_t dbgpacket[MAX_DBGPKT_LEN];
assert((len+2) <= MAX_DBGPKT_LEN);
dbg_packet[0] = module << 6;
dbg_packet[1] = (OSD_HOST_ID << 6) | (class & 0x1f);
memcpy(&dbg_packet[2], packet, len);
glip_send(len + 2, dbg_packet);
}
void osd_mm_read(uint16_t module, uint16_t address,
uint16_t *value) {
int rv;
int16_t packet[1];
packet[0] = address;
osd_send(module, OSD_CLASS_MMRD, 2, packet);
osd_receive(module, OSD_CLASS_MMRD, 1, packet);
*value = packet[0];
}
opensocdebug library as interface to debug infrastructure
Low-level and memory-mapped functions
APIs for different debug modules
Integrate with (open) debug software
Looking for people to discuss, write spec and contribute.