]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/arm_itm/pd.py
sdcard_spi: Use SrdIntEnum for annotation classes.
[libsigrokdecode.git] / decoders / arm_itm / pd.py
index f6a021226bb93aefc5b8d47c7d58c75e11f23eeb..8ceeac464ae6545872a30ef3f166755c430b85f6 100644 (file)
@@ -14,8 +14,7 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
 import sigrokdecode as srd
@@ -38,14 +37,15 @@ ARM_EXCEPTIONS = {
 }
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'arm_itm'
     name = 'ARM ITM'
     longname = 'ARM Instrumentation Trace Macroblock'
-    desc = 'Trace data from Cortex-M / ARMv7m ITM module.'
+    desc = 'ARM Cortex-M / ARMv7m ITM trace protocol.'
     license = 'gplv2+'
     inputs = ['uart']
-    outputs = ['arm_itm']
+    outputs = []
+    tags = ['Debug/trace']
     options = (
         {'id': 'objdump', 'desc': 'objdump path',
             'default': 'arm-none-eabi-objdump'},
@@ -55,7 +55,7 @@ class Decoder(srd.Decoder):
             'default': ''},
     )
     annotations = (
-        ('trace', 'Trace information'),
+        ('trace', 'Trace info'),
         ('timestamp', 'Timestamp'),
         ('software', 'Software message'),
         ('dwt_event', 'DWT event'),
@@ -69,18 +69,21 @@ class Decoder(srd.Decoder):
         ('function', 'Current function'),
     )
     annotation_rows = (
-        ('trace', 'Trace information', (0, 1)),
-        ('software', 'Software trace', (2,)),
-        ('dwt_event', 'DWT event', (3,)),
-        ('dwt_watchpoint', 'DWT watchpoint', (4,)),
-        ('dwt_exc', 'Exception trace', (5,)),
-        ('dwt_pc', 'Program counter', (6,)),
-        ('mode', 'Current mode', (7, 8, 9)),
-        ('location', 'Current location', (10,)),
-        ('function', 'Current function', (11,)),
+        ('traces', 'Trace info', (0, 1)),
+        ('softwares', 'Software traces', (2,)),
+        ('dwt_events', 'DWT events', (3,)),
+        ('dwt_watchpoints', 'DWT watchpoints', (4,)),
+        ('dwt_excs', 'Exception traces', (5,)),
+        ('dwt_pcs', 'Program counters', (6,)),
+        ('modes', 'Current modes', (7, 8, 9)),
+        ('locations', 'Current locations', (10,)),
+        ('functions', 'Current functions', (11,)),
     )
 
-    def __init__(self, **kwargs):
+    def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.buf = []
         self.syncbuf = []
         self.swpackets = {}