# Emit a compact line-oriented debug inventory for vivado_debug_mcp.
# This template is intentionally conservative and may need adjustment per Vivado version.

puts "TARGET|name=local|state=unknown"

foreach device [get_hw_devices] {
    set device_name [get_property NAME $device]
    set part_name [get_property PART $device]
    puts "DEVICE|target=local|name=$device_name|part=$part_name"
}

foreach ila [get_hw_ilas] {
    set ila_name [get_property NAME $ila]
    set device_name ""
    catch { set device_name [get_property NAME [get_property PARENT $ila]] }
    set depth ""
    catch { set depth [get_property DATA_DEPTH $ila] }
    puts "ILA|device=$device_name|name=$ila_name|depth=$depth"
    foreach probe [get_hw_probes -of_objects $ila] {
        set probe_name [get_property NAME $probe]
        set width ""
        catch { set width [get_property WIDTH $probe] }
        puts "PROBE|core=$ila_name|name=$probe_name|width=$width"
    }
}

foreach vio [get_hw_vios] {
    set vio_name [get_property NAME $vio]
    set device_name ""
    catch { set device_name [get_property NAME [get_property PARENT $vio]] }
    puts "VIO|device=$device_name|name=$vio_name"
    foreach probe [get_hw_probes -of_objects $vio] {
        set probe_name [get_property NAME $probe]
        set width ""
        catch { set width [get_property WIDTH $probe] }
        puts "PROBE|core=$vio_name|name=$probe_name|width=$width"
    }
}
