cxxrtl: add .get() and .set() accessors on value<> and wire<>.
authorwhitequark <whitequark@whitequark.org>
Thu, 18 Jun 2020 21:51:30 +0000 (21:51 +0000)
committerwhitequark <whitequark@whitequark.org>
Fri, 19 Jun 2020 02:31:35 +0000 (02:31 +0000)
commit962a2f3bff9da3ae1ccf0bf05fabdbecf30f15c8
treeaf91ada1c50ac0e40e5495135f9bcfd71a5bb009
parentdfde1cf1c540d5580d7bc7d24f9f59a004202d60
cxxrtl: add .get() and .set() accessors on value<> and wire<>.

For several reasons:
  * They're more convenient than accessing .data.
  * They accommodate variably-sized types like size_t transparently.
  * They statically ensure that no out of range conversions happen.

For now these are only provided for unsigned integers, but eventually
they should be provided for signed integers too. (Annoyingly this
affects conversions to/from `char` at the moment.)

Fixes #2127.
backends/cxxrtl/cxxrtl.h