From 747da3da15318d50f152d13d9ea1525c611634e8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 4 Nov 2016 15:17:19 +0800 Subject: [PATCH] drtio: differentiate local and remote unknown packet type errors --- artiq/gateware/drtio/rt_packets.py | 11 ++++++----- artiq/test/gateware/drtio/test_full_stack.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/artiq/gateware/drtio/rt_packets.py b/artiq/gateware/drtio/rt_packets.py index f756fb70a..84243e903 100644 --- a/artiq/gateware/drtio/rt_packets.py +++ b/artiq/gateware/drtio/rt_packets.py @@ -50,12 +50,13 @@ def get_s2m_layouts(alignment): error_codes = { - "unknown_type": 0, + "unknown_type_local": 0, + "unknown_type_remote": 1, # The transmitter is normally responsible for avoiding # overflows and underflows. Those error reports are only # for diagnosing internal ARTIQ bugs. - "write_overflow": 1, - "write_underflow": 2 + "write_overflow": 2, + "write_underflow": 3 } @@ -254,7 +255,7 @@ class RTPacketSatellite(Module): NextState("FIFO_SPACE"), "default": [ err_set.eq(1), - NextValue(err_code, error_codes["unknown_type"])] + NextValue(err_code, error_codes["unknown_type_remote"])] }) ) ) @@ -528,7 +529,7 @@ class RTPacketMaster(Module): rx_plm.types["fifo_space_reply"]: NextState("FIFO_SPACE"), "default": [ error_not.eq(1), - error_code.eq(error_codes["unknown_type"]) + error_code.eq(error_codes["unknown_type_local"]) ] }) ) diff --git a/artiq/test/gateware/drtio/test_full_stack.py b/artiq/test/gateware/drtio/test_full_stack.py index b7cd67833..23d95da2e 100644 --- a/artiq/test/gateware/drtio/test_full_stack.py +++ b/artiq/test/gateware/drtio/test_full_stack.py @@ -170,7 +170,7 @@ class TestFullStack(unittest.TestCase): err_present = yield from csrs.err_present.read() err_code = yield from csrs.err_code.read() self.assertEqual(err_present, 1) - self.assertEqual(err_code, 2) + self.assertEqual(err_code, 3) yield from csrs.err_present.write(1) yield err_present = yield from csrs.err_present.read()