Open U007D opened 3 years ago
To put the question more simply, can cmsis-svd-generator
generate an .svd
from, for example, https://github.com/torvalds/linux/blob/master/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts?
cpp -nostdinc -I include -I arch -undef -x assembler-with-cpp arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts hifive-unmatched-a00.dts.preprocessed
generated a "preprocessed" dts file (and warnings--more below).
This file was also unsuitable for cmsis-svd-generator
, but a little more digging found the device tree compiler dtc
: dtc -I dts -O dts hifive-unmatched-a00.dts.preprocessed -o hifive-unmatched-a00.dts
This yielded a (postprocessed?) .dts
file which was suitable for cmsis-svd-generator
:
▶ ./cmsis-svd-generator/generate_svd.py -d hifive-unmatched-a00.dts -o hifive-unmatched-a00.svd
Generating CMSIS SVD file for 'SiFive HiFive Unmatched' model
The tool seemed to work but the peripherals
section of the resulting .svd
file is empty:
<?xml version="1.0" encoding="utf-8"?>
<device schemaVersion="1.3" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD.xsd">
<name>SiFive HiFive Unmatched</name>
<version>0.1</version>
<description>From SiFive HiFive Unmatched,model device generator</description>
<addressUnitBits>8</addressUnitBits>
<width>32</width>
<size>32</size>
<access>read-write</access>
<peripherals>
</peripherals>
</device>
Notes:
* The `.dts` and `.dts.processed` files are on the order of 15KB, but the `.svd` is only \~400B.
* `dtc` emits several warnings, but runs to completion:
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /cpus/cpu@0/interrupt-controller: Missing #address-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /cpus/cpu@1/interrupt-controller: Missing #address-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /cpus/cpu@2/interrupt-controller: Missing #address-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /cpus/cpu@3/interrupt-controller: Missing #address-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /cpus/cpu@4/interrupt-controller: Missing #address-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /soc/i2c@10030000/pmic@58: Missing #interrupt-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /soc/i2c@10030000/pmic@58: Missing #address-cells in interrupt provider
`hifive-unmatched-a00.dts: Warning (interrupt_provider): /soc/gpio@10060000: Missing #address-cells in interrupt provider
If anyone has ideas on what I could be doing wrong, I'd be grateful for a suggestion.
When I run
./generate_svd.py -d ~/Development/3rd_party/torvalds/linux/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts -o ../sifive-unleashed.svd
(https://github.com/torvalds/linux.git repo master branch).the tool rejects the
#
from#include
on line 4:I'm new to these tools--any tips?