X-ALP uses the xheep_gen Python package (vendored in util/xheep_gen) to model the platform and to generate the RTL, software headers and linker scripts from Mako .tpl templates. For example, hw/x_alp.sv.tpl generates hw/x_alp.sv and sw/device/lib/runtime/core_v_mcu.h.tpl generates sw/device/lib/runtime/core_v_mcu.h.
To generate the default configuration of X-ALP, run from the repository root:
make mcu-genThis command:
- renders every
.tplfile of the repository (outsidehw/vendor,utilandtest) with the platform described inconfigs/soc.pyand the pads described inconfigs/pad_cfg.py; - generates the register files of the peripherals (
make reg-gen, see Generating peripheral registers); - rebuilds the boot ROM (
make boot-rom); - formats the generated code (
make format).
Run `make mcu-gen` after cloning the repository and every time you change a configuration file or a `.tpl` template. Never edit a generated file directly: edit its `.tpl` template and run `make mcu-gen` again.
To generate a different platform, pass your own configuration files:
make mcu-gen X_ALP_CFG=configs/my_soc.py PADS_CFG=configs/my_pad_cfg.pyUnlike X-HEEP, X-ALP is configured only through Python files: there are no CPU, BUS or MEMORY_BANKS make arguments. You can find the full documentation in the Configuration section.
The generated address map is also written to docs/addressmap.md and shown in Address Map.