From: Uwe Hermann Date: Sat, 24 Sep 2016 10:21:16 +0000 (+0200) Subject: uart: Add a test-case for overlapping RX/TX bytes. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=50fd1925211bbe17e20cc988987038cce4555375;p=sigrok-test.git uart: Add a test-case for overlapping RX/TX bytes. --- diff --git a/decoder/test/uart/rxtx_overlapped.bin_rx b/decoder/test/uart/rxtx_overlapped.bin_rx new file mode 100644 index 0000000..db7636e --- /dev/null +++ b/decoder/test/uart/rxtx_overlapped.bin_rx @@ -0,0 +1,10 @@ +76-215 uart: 7e +249-388 uart: 00 +422-561 uart: 10 +595-734 uart: 20 +769-908 uart: 01 +942-1081 uart: c0 +1115-1254 uart: a8 +1289-1428 uart: b0 +1462-1601 uart: 1f +1635-1774 uart: 9a diff --git a/decoder/test/uart/rxtx_overlapped.bin_tx b/decoder/test/uart/rxtx_overlapped.bin_tx new file mode 100644 index 0000000..bb8e43b --- /dev/null +++ b/decoder/test/uart/rxtx_overlapped.bin_tx @@ -0,0 +1,7 @@ +518-657 uart: 7e +691-830 uart: 00 +864-1003 uart: 03 +1038-1177 uart: 89 +1211-1350 uart: 01 +1384-1523 uart: 00 +1558-1697 uart: 75 diff --git a/decoder/test/uart/rxtx_overlapped.output b/decoder/test/uart/rxtx_overlapped.output new file mode 100644 index 0000000..0f5a13d --- /dev/null +++ b/decoder/test/uart/rxtx_overlapped.output @@ -0,0 +1,187 @@ +59-76 uart: rx-start: "Start bit" "Start" "S" +76-93 uart: rx-data-bits: "0" +93-110 uart: rx-data-bits: "1" +111-128 uart: rx-data-bits: "1" +128-145 uart: rx-data-bits: "1" +145-162 uart: rx-data-bits: "1" +163-180 uart: rx-data-bits: "1" +180-197 uart: rx-data-bits: "1" +198-215 uart: rx-data-bits: "0" +76-215 uart: rx-data: "~" +215-232 uart: rx-parity-ok: "Stop bit" "Stop" "T" +232-249 uart: rx-start: "Start bit" "Start" "S" +249-266 uart: rx-data-bits: "0" +266-283 uart: rx-data-bits: "0" +284-301 uart: rx-data-bits: "0" +301-318 uart: rx-data-bits: "0" +318-335 uart: rx-data-bits: "0" +336-353 uart: rx-data-bits: "0" +353-370 uart: rx-data-bits: "0" +371-388 uart: rx-data-bits: "0" +249-388 uart: rx-data: "[00]" +388-405 uart: rx-parity-ok: "Stop bit" "Stop" "T" +405-422 uart: rx-start: "Start bit" "Start" "S" +422-439 uart: rx-data-bits: "0" +439-456 uart: rx-data-bits: "0" +457-474 uart: rx-data-bits: "0" +474-491 uart: rx-data-bits: "0" +491-508 uart: rx-data-bits: "1" +501-518 uart: tx-start: "Start bit" "Start" "S" +509-526 uart: rx-data-bits: "0" +518-535 uart: tx-data-bits: "0" +526-543 uart: rx-data-bits: "0" +535-552 uart: tx-data-bits: "1" +544-561 uart: rx-data-bits: "0" +422-561 uart: rx-data: "[10]" +553-570 uart: tx-data-bits: "1" +561-578 uart: rx-parity-ok: "Stop bit" "Stop" "T" +570-587 uart: tx-data-bits: "1" +578-595 uart: rx-start: "Start bit" "Start" "S" +587-604 uart: tx-data-bits: "1" +595-612 uart: rx-data-bits: "0" +605-622 uart: tx-data-bits: "1" +612-629 uart: rx-data-bits: "0" +622-639 uart: tx-data-bits: "1" +630-647 uart: rx-data-bits: "0" +640-657 uart: tx-data-bits: "0" +518-657 uart: tx-data: "~" +647-664 uart: rx-data-bits: "0" +657-674 uart: tx-parity-ok: "Stop bit" "Stop" "T" +664-681 uart: rx-data-bits: "0" +674-691 uart: tx-start: "Start bit" "Start" "S" +682-699 uart: rx-data-bits: "1" +691-708 uart: tx-data-bits: "0" +699-716 uart: rx-data-bits: "0" +708-725 uart: tx-data-bits: "0" +717-734 uart: rx-data-bits: "0" +595-734 uart: rx-data: " " +726-743 uart: tx-data-bits: "0" +734-751 uart: rx-parity-ok: "Stop bit" "Stop" "T" +743-760 uart: tx-data-bits: "0" +752-769 uart: rx-start: "Start bit" "Start" "S" +760-777 uart: tx-data-bits: "0" +769-786 uart: rx-data-bits: "1" +778-795 uart: tx-data-bits: "0" +786-803 uart: rx-data-bits: "0" +795-812 uart: tx-data-bits: "0" +804-821 uart: rx-data-bits: "0" +813-830 uart: tx-data-bits: "0" +691-830 uart: tx-data: "[00]" +821-838 uart: rx-data-bits: "0" +830-847 uart: tx-parity-ok: "Stop bit" "Stop" "T" +838-855 uart: rx-data-bits: "0" +847-864 uart: tx-start: "Start bit" "Start" "S" +856-873 uart: rx-data-bits: "0" +864-881 uart: tx-data-bits: "1" +873-890 uart: rx-data-bits: "0" +881-898 uart: tx-data-bits: "1" +891-908 uart: rx-data-bits: "0" +769-908 uart: rx-data: "[01]" +899-916 uart: tx-data-bits: "0" +908-925 uart: rx-parity-ok: "Stop bit" "Stop" "T" +916-933 uart: tx-data-bits: "0" +925-942 uart: rx-start: "Start bit" "Start" "S" +933-950 uart: tx-data-bits: "0" +942-959 uart: rx-data-bits: "0" +951-968 uart: tx-data-bits: "0" +959-976 uart: rx-data-bits: "0" +968-985 uart: tx-data-bits: "0" +977-994 uart: rx-data-bits: "0" +986-1003 uart: tx-data-bits: "0" +864-1003 uart: tx-data: "[03]" +994-1011 uart: rx-data-bits: "0" +1003-1020 uart: tx-parity-ok: "Stop bit" "Stop" "T" +1011-1028 uart: rx-data-bits: "0" +1021-1038 uart: tx-start: "Start bit" "Start" "S" +1029-1046 uart: rx-data-bits: "0" +1038-1055 uart: tx-data-bits: "1" +1046-1063 uart: rx-data-bits: "1" +1055-1072 uart: tx-data-bits: "0" +1064-1081 uart: rx-data-bits: "1" +942-1081 uart: rx-data: "[C0]" +1073-1090 uart: tx-data-bits: "0" +1081-1098 uart: rx-parity-ok: "Stop bit" "Stop" "T" +1090-1107 uart: tx-data-bits: "1" +1098-1115 uart: rx-start: "Start bit" "Start" "S" +1107-1124 uart: tx-data-bits: "0" +1115-1132 uart: rx-data-bits: "0" +1125-1142 uart: tx-data-bits: "0" +1132-1149 uart: rx-data-bits: "0" +1142-1159 uart: tx-data-bits: "0" +1150-1167 uart: rx-data-bits: "0" +1160-1177 uart: tx-data-bits: "1" +1038-1177 uart: tx-data: "[89]" +1167-1184 uart: rx-data-bits: "1" +1177-1194 uart: tx-parity-ok: "Stop bit" "Stop" "T" +1184-1201 uart: rx-data-bits: "0" +1194-1211 uart: tx-start: "Start bit" "Start" "S" +1202-1219 uart: rx-data-bits: "1" +1211-1228 uart: tx-data-bits: "1" +1219-1236 uart: rx-data-bits: "0" +1228-1245 uart: tx-data-bits: "0" +1237-1254 uart: rx-data-bits: "1" +1115-1254 uart: rx-data: "[A8]" +1246-1263 uart: tx-data-bits: "0" +1254-1271 uart: rx-parity-ok: "Stop bit" "Stop" "T" +1263-1280 uart: tx-data-bits: "0" +1272-1289 uart: rx-start: "Start bit" "Start" "S" +1280-1297 uart: tx-data-bits: "0" +1289-1306 uart: rx-data-bits: "0" +1298-1315 uart: tx-data-bits: "0" +1306-1323 uart: rx-data-bits: "0" +1315-1332 uart: tx-data-bits: "0" +1324-1341 uart: rx-data-bits: "0" +1333-1350 uart: tx-data-bits: "0" +1211-1350 uart: tx-data: "[01]" +1341-1358 uart: rx-data-bits: "0" +1350-1367 uart: tx-parity-ok: "Stop bit" "Stop" "T" +1358-1375 uart: rx-data-bits: "1" +1367-1384 uart: tx-start: "Start bit" "Start" "S" +1376-1393 uart: rx-data-bits: "1" +1384-1401 uart: tx-data-bits: "0" +1393-1410 uart: rx-data-bits: "0" +1401-1418 uart: tx-data-bits: "0" +1411-1428 uart: rx-data-bits: "1" +1289-1428 uart: rx-data: "[B0]" +1419-1436 uart: tx-data-bits: "0" +1428-1445 uart: rx-parity-ok: "Stop bit" "Stop" "T" +1436-1453 uart: tx-data-bits: "0" +1445-1462 uart: rx-start: "Start bit" "Start" "S" +1453-1470 uart: tx-data-bits: "0" +1462-1479 uart: rx-data-bits: "1" +1471-1488 uart: tx-data-bits: "0" +1479-1496 uart: rx-data-bits: "1" +1488-1505 uart: tx-data-bits: "0" +1497-1514 uart: rx-data-bits: "1" +1506-1523 uart: tx-data-bits: "0" +1384-1523 uart: tx-data: "[00]" +1514-1531 uart: rx-data-bits: "1" +1523-1540 uart: tx-parity-ok: "Stop bit" "Stop" "T" +1531-1548 uart: rx-data-bits: "1" +1541-1558 uart: tx-start: "Start bit" "Start" "S" +1549-1566 uart: rx-data-bits: "0" +1558-1575 uart: tx-data-bits: "1" +1566-1583 uart: rx-data-bits: "0" +1575-1592 uart: tx-data-bits: "0" +1584-1601 uart: rx-data-bits: "0" +1462-1601 uart: rx-data: "" +1593-1610 uart: tx-data-bits: "1" +1601-1618 uart: rx-parity-ok: "Stop bit" "Stop" "T" +1610-1627 uart: tx-data-bits: "0" +1618-1635 uart: rx-start: "Start bit" "Start" "S" +1627-1644 uart: tx-data-bits: "1" +1635-1652 uart: rx-data-bits: "0" +1645-1662 uart: tx-data-bits: "1" +1652-1669 uart: rx-data-bits: "1" +1662-1679 uart: tx-data-bits: "1" +1670-1687 uart: rx-data-bits: "0" +1680-1697 uart: tx-data-bits: "0" +1558-1697 uart: tx-data: "u" +1687-1704 uart: rx-data-bits: "1" +1697-1714 uart: tx-parity-ok: "Stop bit" "Stop" "T" +1704-1721 uart: rx-data-bits: "1" +1722-1739 uart: rx-data-bits: "0" +1739-1756 uart: rx-data-bits: "0" +1757-1774 uart: rx-data-bits: "1" +1635-1774 uart: rx-data: "[9A]" +1774-1791 uart: rx-parity-ok: "Stop bit" "Stop" "T" diff --git a/decoder/test/uart/rxtx_overlapped.python b/decoder/test/uart/rxtx_overlapped.python new file mode 100644 index 0000000..cd507ea --- /dev/null +++ b/decoder/test/uart/rxtx_overlapped.python @@ -0,0 +1,51 @@ +59-76 uart: ['STARTBIT', 0, 0] +76-215 uart: ['DATA', 0, (126, [[0, 76, 92], [1, 93, 109], [1, 111, 127], [1, 128, 144], [1, 145, 161], [1, 163, 179], [1, 180, 196], [0, 198, 214]])] +215-232 uart: ['STOPBIT', 0, 1] +232-249 uart: ['STARTBIT', 0, 0] +249-388 uart: ['DATA', 0, (0, [[0, 249, 265], [0, 266, 282], [0, 284, 300], [0, 301, 317], [0, 318, 334], [0, 336, 352], [0, 353, 369], [0, 371, 387]])] +388-405 uart: ['STOPBIT', 0, 1] +405-422 uart: ['STARTBIT', 0, 0] +501-518 uart: ['STARTBIT', 1, 0] +422-561 uart: ['DATA', 0, (16, [[0, 422, 438], [0, 439, 455], [0, 457, 473], [0, 474, 490], [1, 491, 507], [0, 509, 525], [0, 526, 542], [0, 544, 560]])] +561-578 uart: ['STOPBIT', 0, 1] +578-595 uart: ['STARTBIT', 0, 0] +518-657 uart: ['DATA', 1, (126, [[0, 518, 534], [1, 535, 551], [1, 553, 569], [1, 570, 586], [1, 587, 603], [1, 605, 621], [1, 622, 638], [0, 640, 656]])] +657-674 uart: ['STOPBIT', 1, 1] +674-691 uart: ['STARTBIT', 1, 0] +595-734 uart: ['DATA', 0, (32, [[0, 595, 611], [0, 612, 628], [0, 630, 646], [0, 647, 663], [0, 664, 680], [1, 682, 698], [0, 699, 715], [0, 717, 733]])] +734-751 uart: ['STOPBIT', 0, 1] +752-769 uart: ['STARTBIT', 0, 0] +691-830 uart: ['DATA', 1, (0, [[0, 691, 707], [0, 708, 724], [0, 726, 742], [0, 743, 759], [0, 760, 776], [0, 778, 794], [0, 795, 811], [0, 813, 829]])] +830-847 uart: ['STOPBIT', 1, 1] +847-864 uart: ['STARTBIT', 1, 0] +769-908 uart: ['DATA', 0, (1, [[1, 769, 785], [0, 786, 802], [0, 804, 820], [0, 821, 837], [0, 838, 854], [0, 856, 872], [0, 873, 889], [0, 891, 907]])] +908-925 uart: ['STOPBIT', 0, 1] +925-942 uart: ['STARTBIT', 0, 0] +864-1003 uart: ['DATA', 1, (3, [[1, 864, 880], [1, 881, 897], [0, 899, 915], [0, 916, 932], [0, 933, 949], [0, 951, 967], [0, 968, 984], [0, 986, 1002]])] +1003-1020 uart: ['STOPBIT', 1, 1] +1021-1038 uart: ['STARTBIT', 1, 0] +942-1081 uart: ['DATA', 0, (192, [[0, 942, 958], [0, 959, 975], [0, 977, 993], [0, 994, 1010], [0, 1011, 1027], [0, 1029, 1045], [1, 1046, 1062], [1, 1064, 1080]])] +1081-1098 uart: ['STOPBIT', 0, 1] +1098-1115 uart: ['STARTBIT', 0, 0] +1038-1177 uart: ['DATA', 1, (137, [[1, 1038, 1054], [0, 1055, 1071], [0, 1073, 1089], [1, 1090, 1106], [0, 1107, 1123], [0, 1125, 1141], [0, 1142, 1158], [1, 1160, 1176]])] +1177-1194 uart: ['STOPBIT', 1, 1] +1194-1211 uart: ['STARTBIT', 1, 0] +1115-1254 uart: ['DATA', 0, (168, [[0, 1115, 1131], [0, 1132, 1148], [0, 1150, 1166], [1, 1167, 1183], [0, 1184, 1200], [1, 1202, 1218], [0, 1219, 1235], [1, 1237, 1253]])] +1254-1271 uart: ['STOPBIT', 0, 1] +1272-1289 uart: ['STARTBIT', 0, 0] +1211-1350 uart: ['DATA', 1, (1, [[1, 1211, 1227], [0, 1228, 1244], [0, 1246, 1262], [0, 1263, 1279], [0, 1280, 1296], [0, 1298, 1314], [0, 1315, 1331], [0, 1333, 1349]])] +1350-1367 uart: ['STOPBIT', 1, 1] +1367-1384 uart: ['STARTBIT', 1, 0] +1289-1428 uart: ['DATA', 0, (176, [[0, 1289, 1305], [0, 1306, 1322], [0, 1324, 1340], [0, 1341, 1357], [1, 1358, 1374], [1, 1376, 1392], [0, 1393, 1409], [1, 1411, 1427]])] +1428-1445 uart: ['STOPBIT', 0, 1] +1445-1462 uart: ['STARTBIT', 0, 0] +1384-1523 uart: ['DATA', 1, (0, [[0, 1384, 1400], [0, 1401, 1417], [0, 1419, 1435], [0, 1436, 1452], [0, 1453, 1469], [0, 1471, 1487], [0, 1488, 1504], [0, 1506, 1522]])] +1523-1540 uart: ['STOPBIT', 1, 1] +1541-1558 uart: ['STARTBIT', 1, 0] +1462-1601 uart: ['DATA', 0, (31, [[1, 1462, 1478], [1, 1479, 1495], [1, 1497, 1513], [1, 1514, 1530], [1, 1531, 1547], [0, 1549, 1565], [0, 1566, 1582], [0, 1584, 1600]])] +1601-1618 uart: ['STOPBIT', 0, 1] +1618-1635 uart: ['STARTBIT', 0, 0] +1558-1697 uart: ['DATA', 1, (117, [[1, 1558, 1574], [0, 1575, 1591], [1, 1593, 1609], [0, 1610, 1626], [1, 1627, 1643], [1, 1645, 1661], [1, 1662, 1678], [0, 1680, 1696]])] +1697-1714 uart: ['STOPBIT', 1, 1] +1635-1774 uart: ['DATA', 0, (154, [[0, 1635, 1651], [1, 1652, 1668], [0, 1670, 1686], [1, 1687, 1703], [1, 1704, 1720], [0, 1722, 1738], [0, 1739, 1755], [1, 1757, 1773]])] +1774-1791 uart: ['STOPBIT', 0, 1] diff --git a/decoder/test/uart/test.conf b/decoder/test/uart/test.conf index 2d54f33..f501edb 100644 --- a/decoder/test/uart/test.conf +++ b/decoder/test/uart/test.conf @@ -114,6 +114,14 @@ test hello_world_8o1_115200 output uart python match hello_world_8o1_115200.python output uart binary class tx match hello_world_8o1_115200.bin_tx +test rxtx_overlapped + protocol-decoder uart channel rx=3 channel tx=4 + input uart/rxtx_overlapped/rxtx_overlapped.sr + output uart annotation match rxtx_overlapped.output + output uart python match rxtx_overlapped.python + output uart binary class rx match rxtx_overlapped.bin_rx + output uart binary class tx match rxtx_overlapped.bin_tx + test exception_samplerate protocol-decoder uart input misc/no-samplerate.sr