local common = {}
local s_match = string.match
common.block_io_method = { 'Read', 'Write', 'WriteRead', 'ComboWriteRead', 'BatchWrite' }
function common.get_access_property(object_name)
return s_match(object_name, '^%w+_(.*)')
end
function common.get_access_property_with_position(object_name)
return s_match(object_name, '^%w+_(.*)_.*$')
end
function common.remove_position(object_name)
return s_match(object_name, '(.*)_.*$')
end
function common.get_class_type(object_name)
return s_match(object_name, '(.-)_')
end
common.csr_syntax_tag = { REF_TAG = '#/' }
function common.is_ref(value)
return type(value) == 'string' and string.sub(value, 1, 2) == common.csr_syntax_tag.REF_TAG
end
common.csr_key = {
PARENT = '@Parent',
}
function common.is_parent(name, value)
return name == common.csr_key.PARENT and type(value) == 'string'
end
common.support_access = { ['Smc'] = true, ['Pca9555'] = true }
common.mux_class = { ['I2cMux'] = true, ['JtagMux'] = true }
return common