hdl.ast: add Value.{as_signed,as_unsigned}.
authorwhitequark <whitequark@whitequark.org>
Thu, 6 Feb 2020 18:27:55 +0000 (18:27 +0000)
committerwhitequark <whitequark@whitequark.org>
Thu, 6 Feb 2020 18:27:55 +0000 (18:27 +0000)
commitb22b6c9cfba05b662015f0c3a73cd0a63d2d141f
tree374674b727bd3dd5ec9575e2bdcc9293e4a99f55
parent463e5c7c3f302d626ba22b52ce6c345969b733cd
hdl.ast: add Value.{as_signed,as_unsigned}.

Before this commit, there was no way to do so besides creating and
assigning an intermediate signal, which could not be extracted into
a helper function due to Module statefulness.

Fixes #292.
nmigen/back/pysim.py
nmigen/back/rtlil.py
nmigen/hdl/ast.py
nmigen/test/test_hdl_ast.py
nmigen/test/test_sim.py