@pytest.mark.skipif((not flag), reason='need correct overlay to run')
def test_fsm_max_in_out():
    'Test for the Finite State Machine Generator class.\n\n    This test will test when maximum number of inputs and \n    outputs are used. At the same time, the largest available number of \n    states will be implemented.\n\n    '
    ol.download()
    input_pins = list(pin_dict.keys())[:FSM_MAX_INPUT_BITS]
    print('\nConnect {} to GND.'.format(input_pins))
    print('Disconnect all other pins.')
    input('Hit enter after done ...')
    (fsm_spec_inout, test_patterns) = build_fsm_spec_max_in_out()
    period = ((2 ** (FSM_MAX_STATE_INPUT_BITS - FSM_MAX_INPUT_BITS)) - 1)
    num_output_pins = (interface_width - FSM_MAX_INPUT_BITS)
    fsm_generator = FSMGenerator(mb_info)
    fsm_generator.trace(use_analyzer=True, num_analyzer_samples=MAX_NUM_TRACE_SAMPLES)
    fsm_generator.setup(fsm_spec_inout, frequency_mhz=100)
    fsm_generator.run()
    test_strings = ['' for _ in range(num_output_pins)]
    test_arrays = [[] for _ in range(num_output_pins)]
    for wavegroup in fsm_generator.waveform.waveform_dict['signal']:
        if (wavegroup and (wavegroup[0] == 'analysis')):
            for wavelane in wavegroup[1:]:
                for j in range(num_output_pins):
                    if (wavelane['name'] == 'output{}'.format(j)):
                        test_strings[j] = wavelane['wave']
                        test_arrays[j] = np.array(bitstring_to_int(wave_to_bitstring(test_strings[j])))
                        break
    golden_arrays = [[] for _ in range(num_output_pins)]
    for i in range(num_output_pins):
        golden_arrays[i] = np.tile(test_patterns[i], ceil((MAX_NUM_TRACE_SAMPLES / period)))
        assert np.array_equal(test_arrays[i], golden_arrays[i][:MAX_NUM_TRACE_SAMPLES]), 'Output{} not matching the generated pattern.'.format(i)
    fsm_generator.stop()
    fsm_generator.reset()
    del fsm_generator
Test for the Finite State Machine Generator class.

This test will test when maximum number of inputs and 
outputs are used. At the same time, the largest available number of 
states will be implemented.
@pytest.mark.skipif((not flag), reason='need correct overlay to run')
def test_fsm_max_in_out():
    'Test for the Finite State Machine Generator class.\n\n    This test will test when maximum number of inputs and \n    outputs are used. At the same time, the largest available number of \n    states will be implemented.\n\n    '
    ol.download()
    input_pins = list(pin_dict.keys())[:FSM_MAX_INPUT_BITS]
    print('\nConnect {} to GND.'.format(input_pins))
    print('Disconnect all other pins.')
    input('Hit enter after done ...')
    (fsm_spec_inout, test_patterns) = build_fsm_spec_max_in_out()
    period = ((2 ** (FSM_MAX_STATE_INPUT_BITS - FSM_MAX_INPUT_BITS)) - 1)
    num_output_pins = (interface_width - FSM_MAX_INPUT_BITS)
    fsm_generator = FSMGenerator(mb_info)
    fsm_generator.trace(use_analyzer=True, num_analyzer_samples=MAX_NUM_TRACE_SAMPLES)
    fsm_generator.setup(fsm_spec_inout, frequency_mhz=100)
    fsm_generator.run()
    test_strings = [ for _ in range(num_output_pins)]
    test_arrays = [[] for _ in range(num_output_pins)]
    for wavegroup in fsm_generator.waveform.waveform_dict['signal']:
        if (wavegroup and (wavegroup[0] == 'analysis')):
            for wavelane in wavegroup[1:]:
                for j in range(num_output_pins):
                    if (wavelane['name'] == 'output{}'.format(j)):
                        test_strings[j] = wavelane['wave']
                        test_arrays[j] = np.array(bitstring_to_int(wave_to_bitstring(test_strings[j])))
                        break
    golden_arrays = [[] for _ in range(num_output_pins)]
    for i in range(num_output_pins):
        golden_arrays[i] = np.tile(test_patterns[i], ceil((MAX_NUM_TRACE_SAMPLES / period)))
        assert np.array_equal(test_arrays[i], golden_arrays[i][:MAX_NUM_TRACE_SAMPLES]), 'Output{} not matching the generated pattern.'.format(i)
    fsm_generator.stop()
    fsm_generator.reset()
    del fsm_generator