Skip to content

Commit

Permalink
rpc: fix parsing of negative signed parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rroohhh authored and whitequark committed May 18, 2021
1 parent b38b2cd commit 78be9e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nmigen/rpc.py
Expand Up @@ -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":
Expand Down

0 comments on commit 78be9e7

Please sign in to comment.