View Source 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

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

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.

references

References

todo

TODO

  • Implement compile_and_track callback
  • Improve needed_files callback
  • Add unit tests

license

License

Released under Apache License 2.0.