From 1338d8cfe3d4876e8a9327c617aefff5384e0aba Mon Sep 17 00:00:00 2001 From: Robin Ole Heinemann Date: Tue, 18 May 2021 20:43:16 +0200 Subject: [PATCH] rpc: fix parsing of negative signed parameters --- nmigen/rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmigen/rpc.py b/nmigen/rpc.py index a03ec23..f3455e6 100644 --- a/nmigen/rpc.py +++ b/nmigen/rpc.py @@ -50,7 +50,7 @@ def _serve_yosys(modules): width = len(parameter["value"]) parameter_value = int(parameter["value"], 2) if parameter_value & (1 << (width - 1)): - parameter_value = -((1 << width) - value) + parameter_value = -((1 << width) - parameter_value) elif parameter["type"] == "string": parameter_value = parameter["value"] elif parameter["type"] == "real": -- 2.30.2