summary refs log tree commit diff stats
path: root/hw/net/virtio-net.c
diff options
context:
space:
mode:
authorTaylor Simpson <ltaylorsimpson@gmail.com>2023-12-10 15:07:05 -0700
committerBrian Cain <bcain@quicinc.com>2024-01-21 22:01:59 -0800
commitb44780740d4a1b70ff45a6e4d923e29880ce3c0e (patch)
tree01e745aca7353b492c2b5909db7d84ae3a632bff /hw/net/virtio-net.c
parent421b53d589e2a714b3f3175dddedda9755e83387 (diff)
downloadfocaccia-qemu-b44780740d4a1b70ff45a6e4d923e29880ce3c0e.tar.gz
focaccia-qemu-b44780740d4a1b70ff45a6e4d923e29880ce3c0e.zip
Hexagon (target/hexagon) Make generators object oriented - gen_tcg_funcs
The generators are generally a bunch of Python if-then-else
statements based on the regtype and regid.  Encapsulate regtype/regid
into a class hierarchy.  Clients lookup the register and invoke
methods.

This has several advantages for making the code easier to read,
understand, and maintain
- The class name makes it more clear what the operand does
- All the methods for a given type of operand are together
- Don't need hex_common.bad_register
  If a regtype/regid is missing, the lookup in hex_common.get_register
  will fail
- We can remove the functions in hex_common that use regtype/regid
  (e.g., is_read)

This patch creates the class hierarchy in hex_common and converts
gen_tcg_funcs.py.  The other scripts will be converted in subsequent
patches in this series.

Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Message-Id: <20231210220712.491494-3-ltaylorsimpson@gmail.com>
Signed-off-by: Brian Cain <bcain@quicinc.com>
Diffstat (limited to 'hw/net/virtio-net.c')
0 files changed, 0 insertions, 0 deletions