From 4cd74bba2c010e4d714ec72fe11128069ea0495a Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Fri, 19 Mar 2021 17:18:01 -0700 Subject: Add getBelPinType to Python interface. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- common/arch_pybindings_shared.h | 2 ++ fpga_interchange/examples/devices/xc7a35t/test_data.yaml | 4 ++++ python/check_arch_api.py | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/common/arch_pybindings_shared.h b/common/arch_pybindings_shared.h index 81469df3..ef355a54 100644 --- a/common/arch_pybindings_shared.h +++ b/common/arch_pybindings_shared.h @@ -60,6 +60,8 @@ fn_wrapper_0a, conv_from_str, conv_from_str>::def_wrap(ctx_cls, "getBelPinWire"); +fn_wrapper_2a, + conv_from_str, conv_from_str>::def_wrap(ctx_cls, "getBelPinType"); fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "getWireBelPins"); diff --git a/fpga_interchange/examples/devices/xc7a35t/test_data.yaml b/fpga_interchange/examples/devices/xc7a35t/test_data.yaml index 268d180a..88c6feda 100644 --- a/fpga_interchange/examples/devices/xc7a35t/test_data.yaml +++ b/fpga_interchange/examples/devices/xc7a35t/test_data.yaml @@ -34,3 +34,7 @@ bel_pin_test: - bel: $CONSTANTS_X0Y0.$CONSTANTS/VCC pin: P wire: $CONSTANTS_X0Y0.$CONSTANTS/$VCC_SOURCE + - bel: SLICE_X1Y19.SLICEL/SRUSEDGND + pin: "0" + wire: SLICE_X1Y19.SLICEL/SRUSEDGND_HARD0 + type: PORT_OUT diff --git a/python/check_arch_api.py b/python/check_arch_api.py index 166f1fd3..4c21d223 100644 --- a/python/check_arch_api.py +++ b/python/check_arch_api.py @@ -78,6 +78,10 @@ def check_arch_api(ctx): wire_name = ctx.getBelPinWire(bel_pin_test['bel'], bel_pin_test['pin']) assert bel_pin_test['wire'] == wire_name, (bel_pin_test['wire'], wire_name) + if 'type' in bel_pin_test: + pin_type = ctx.getBelPinType(bel_pin_test['bel'], bel_pin_test['pin']) + assert bel_pin_test['type'] == pin_type.name, (bel_pin_test['type'], pin_type) + bel_pins_tested += 1 print('Tested {} pips and {} bel pins'.format(pips_tested, bel_pins_tested)) -- cgit v1.2.3