[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Simulavr-devel] [patch #6835] New tracing subsystem with .vcd file gene
From: |
Onno Kortmann |
Subject: |
[Simulavr-devel] [patch #6835] New tracing subsystem with .vcd file generation for viewing with e.g. gtkwave |
Date: |
Thu, 21 May 2009 22:14:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.8.1.19) Gecko/20081202 Iceweasel/2.0.0.19 (Debian-2.0.0.19-0etch1) |
URL:
<http://savannah.nongnu.org/patch/?6835>
Summary: New tracing subsystem with .vcd file generation
for viewing with e.g. gtkwave
Project: Simulavr: an AVR simulator
Submitted by: onnokort
Submitted on: Fr 22 Mai 2009 00:14:54 CEST
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Component Version: simulavrxx
_______________________________________________________
Details:
Overview: This patch is the first try at implementing a very general and
better tracing facility in simulavrxx, to allow tracing of arbitrary states in
the simulation, such as hidden states in the SPI or the UART.
Debugging the of AVR hardware components such as SPI, UART requires checking
the correctness of the simulated hardware as well as a detailed view while
debugging. Viewing just the state of the external pins is often not very
helpful.
This patch implements a very general, named registry of pointers to various
variables inside the simulator, which can then be queried for their value. The
class 'TraceVCD' produces a .vcd file which can then be viewed in gtkwave as
graphical traces (Note that in principle, it should also be possible to do
real-time tracing with gtkwave through a fifo or similar). The TraceVCD object
is driven through a step() method from the avrdevice's Step() method.
Enabling tracing for a value is trivially easy, as only a link has to be made
between its name in the dump file and the location in memory.
The perfomance penality is practically non-existant if the tracing is
disabled (one conditional jump per step() invocation) and only very moderate
when enabled. The current
tracing code is littered with a lot of "if (core->trace_on)" checks, which
are basically all redundant when one factors out the check like this patch
does.
The command line options have been extended by a "-c" and "-o" option to
specify the list of variables to be traced resp. the output .vcd file.
Extension ideas:
- more tracing points, of course
- write support
- verilog read/write support
- replace old tracing code for pins as well as for human-readable output by a
more generalized variant of this code
- performance improvements by removing the string matching code in the .vcd
output loop
- as I understand it, the GDB interface of simulavr currently only allows a
view on a fixed subset (flash, ram, regs, PC etc.) of the hardware. By porting
the GDB interface to this general registry, a lot more details could be
queried.
The patch is just compilable & *seems* to do the right thing, so probably
pre-alpha quality. It is also completely independent of the verilog
interface.
Like for all my patches, feedback is very much appreciated :-)
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fr 22 Mai 2009 00:14:54 CEST Name: trace-vcd.patch Size: 21kB By:
onnokort
<http://savannah.nongnu.org/patch/download.php?file_id=18178>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?6835>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Simulavr-devel] [patch #6835] New tracing subsystem with .vcd file generation for viewing with e.g. gtkwave,
Onno Kortmann <=