def build_device(svdpath): """build the device structure from the svd file""" # read and parse the svd file svd_device = svd.parser(svdpath).parse() d = device() # general device information d.svdpath = svdpath d.vendor = svd_device.vendor d.name = svd_device.name d.description = description_cleanup(svd_device.description) d.series = svd_device.series d.version = svd_device.version # device sub components build_cpu_info(d, svd_device) build_peripherals(d, svd_device) build_interrupts(d, svd_device) return d