Author: John E. Kent
Version: 0.2 from 2010-08-09
Captures all the CPU bus cycles to a block RAM trace buffer.
A trigger condition may be used to start or stop a trace
capture. The trigger condition is determined by the address,
data and control, comparator and qualifier registers.
The comparator registers determine the level of the signals
to trigger on. The qualifier registers determine if the
comparison is to be made for that bit (qualifier bit set)
or not (qualifier bit cleared). The hardware trace capture
module has 9 x 8 bit registers and 5 trace buffers. Separate
chip selects are provided for the register bank and trace
buffer bank. The individual trace buffers are selected via
the bank select register. Trace buffers may be read by the
CPU but are only written to when tracing CPU bus cycles.
The lowest trace buffer address always points to the start
of the trace capture. This is achieved by adding an offset
to the buffer address which points to the last cycle captured.
trace_ctrl_assign ( irq_out, qual_ctrl, rw, cpu_vma ) |
| Assign control signal input |
trace_reg_write ( clk, rst, cs_r, rw, addr, data_in ) |
| Write Trace Registers |
trace_reg_read ( addr, rw, cs_r, comp_addr_hi, comp_addr_lo, comp_data, comp_ctrl, qual_addr_hi, qual_addr_lo, qual_data, qual_ctrl, bank_reg, irq_out ) |
| Read Trace Register (output mux) |
trace_buf_read ( bank_reg, buf_data_out_0, buf_data_out_1, buf_data_out_2, buf_data_out_3, buf_data_out_4 ) |
| Read Trace Buffers |
trace_read ( cs_r, reg_data_out, buf_data_out ) |
| Read Registers or Buffers |
trace_buf_mux ( cs_b, trace_count, trace_en, buf_addr ) |
| Multiplex the trace buffer between the trace capture and the CPU read |
trace_trigger ( clk, rst, cs_r, addr, rw, cpu_vma, data_in, cpu_data_in, comp_addr_hi, comp_addr_lo, comp_data, comp_ctrl, qual_addr_hi, qual_addr_lo, qual_data, qual_ctrl) |
| Trigger comparator process |
trace_capture ( clk, rst, addr, qual_write, trigger, trace_en, qual_ctrl, irq_out, trace_count, trace_offset ) |
| Trace buffer capture on event trigger |