src | ||
.gitignore | ||
.gitlab-ci.yml | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
README-ja.md | ||
README.md |
Endcap SL Software RI Generator
Generates register interface for mpsoc software from register map in xml format.
The XML and its schema definition are in L0 Muon Endcap/Endcap Sl CSR XML.
The generated code is intended to be used in MPSoC Software, which provides definition of register traits (RegisterSpec
) used in the generated code.
Usage
This project provides both binary and library crates. Binary crates can be used from shell, while library crates can be used in other programs.
Setting up building environment
This code is written in Rust, so you need to install rustup.
You can use either officially provided curl
script, or system package manager to install.
You can check the installation by executing cargo
in the terminal.
Note that cargo
is available on lxplus, so you might be able to use that (it is not the latest version though).
Binary crate usage
Execute
cargo build --features=bin --bins --release
to build.
--release
is optional(this is a compiler optimization config).
Execute the binary generated in target/release/
, or run with cargo run -- <XML> <OUT>
.
See the --help
for more information.
Library crate usage
See the doc, which is available with
cargo doc --open
Development
See the doc with private items with
cargo doc --document-private-items --open
You can execute test, format and lint with:
$ cargo test # test
$ cargo fmt # format
$ cargo clippy # lint (run `rustup component add clippy` to install)
rust-analyzer
It is heavily recommended to use rust-analyzer in development. It is not only essential for displaying inferred types and completion, but also it can execute formatter and clippy.
About CI
In the CI, test for build, format and clippy run. Please format your code and check clippy before pushing.
About Rust
You can learn Rust with the following webpage.
Or in terminal, execute
rustup doc
It has a lot of links to helpful documents (personally, I appreciate "The Book", std library doc and "Rust By Example").