From 96b948f57f38b0a6ef5a22c39f1a882c62f62eb2 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 13 Feb 2018 19:54:51 +0800 Subject: [PATCH] remote_csr: add sanity check of CSR CSV type column --- artiq/gateware/remote_csr.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/gateware/remote_csr.py b/artiq/gateware/remote_csr.py index 7acbba798..ae028a9b2 100644 --- a/artiq/gateware/remote_csr.py +++ b/artiq/gateware/remote_csr.py @@ -13,7 +13,12 @@ def _get_csr_data(csv_file): region_name, csr_name = name.split(".") address = int(address, 0) length = int(length, 0) - ro = ro == "ro" + if ro == "ro": + ro = True + elif ro == "rw": + ro = False + else: + raise ValueError if region_name not in csr_data: csr_data[region_name] = [] csr_data[region_name].append((csr_name, address, length, ro))