def ScenarioCheck(Sig, Val, ArraySizes):
    """
	Return a string of scenario GPIO CHECK command for TBGen.
	"""
    CheckString = ''
    if Sig.Type == 'logic':
        SIZE = Sig.GetSize()
        if SIZE == 1:
            CheckString += '\nGPIO CHECK {Name} {Value}'.format(Name=Sig.
                Name, Value=0 if Val == 0 else 1)
        else:
            CheckString += (
                '\nGPIO CHECK_VECT {Name}_{MSb} {Name}_0 {Value:#010x}'.
                format(Name=Sig.Name, MSb=SIZE - 1, Value=Val))
    else:
        for j in range(ArraySizes[Sig.Type]):
            CheckString += (
                '\nGPIO CHECK_VECT {Name}_{MSb} {Name}_0 {Value:#010x}'.
                format(Name=Sig.Name, MSb=SIZE - 1, Value=Val))
    return CheckString
