rebar3_rdl
This is a rebar3 plugin that transform SystemRDL .rdl files into Erlang modules.
The main focus is to provide APIs for serialize and deserialize register values read/write from hardware.
How to use
In our rebar.config file add rebar3_rdl as a plugin:
{plugins, [rebar3_rdl]}.Create a folder called rdl and add all your .rdl files there. The plugin will generate erlang modules from all .rdl files.
It's possible to configure the rebar3_rdl with the following properties:
{rdl_opts, [{peakrdl, "/home/joaohf/peakrdl/PeakRDL-beam/venv/bin/peakrdl"},
{module_name_prefix, "rebar3_rdl_example_"},
{module_name_suffix, "_pb"}]}.- peakrdl: specify an alternative peakrdl location
- module_name_prefix: prefix for erlang module name
- module_name_suffix: suffix for erlang module name
How does it work ?
This plugin just implements the callbacks for rebar3 Custom Compiler Modules.
Under the hood the rebar3_rdl_compiler module calls the peakrdl command line, passing the right arguments. It's very convenient because
you don't need to create any additional scripts to transform .rdl files into .erl modules.
Links
- SystemRDL
- SystemRDL Compiler
- SystemRDL Specification
- peakrdl: PeakRDL is a free and open-source control & status register (CSR) generator toolchain
References
- Custom Compiler Modules
- rebar3_caramel: I got some examples from there in order to understand how custom compile modules works.
TODO
- Implement compile_and_track callback
- Improve needed_files callback
- Add unit tests
License
Released under Apache License 2.0.