From: Robin Ole Heinemann Date: Tue, 18 May 2021 18:43:16 +0000 (+0200) Subject: rpc: fix parsing of negative signed parameters X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1338d8cfe3d4876e8a9327c617aefff5384e0aba;p=nmigen.git rpc: fix parsing of negative signed parameters --- 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":