Compare commits

...

3 commits

6 changed files with 34 additions and 18 deletions

View file

@ -5,10 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.1.0]
## [Unreleased]
### Fixed
- Loosen Cargo.toml dependencies
- Separate bin crate as optional feature to reduce dependency
## [0.1.0] - 2025-02-07
### Added
- Implemented basic code generation covering current CSR XML.
[unreleased]: https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/compare/v0.1.0...main
[0.1.0]: https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/~/tags/v0.1.0

1
Cargo.lock generated
View file

@ -370,7 +370,6 @@ dependencies = [
"sha2",
"syn",
"thiserror",
"typenum",
"vergen-gitcl",
]

View file

@ -10,28 +10,31 @@ build = "build.rs"
[[bin]]
name = "endcap-sl-software-ri-generator"
path = "src/main.rs"
required-features = ["bin"]
[lib]
name = "endcap_sl_software_ri_generator"
path = "src/lib.rs"
[dependencies]
anyhow = "1.0.95"
chrono = "0.4.39"
clap = { version = "4.5.28", features = ["derive"] }
env_logger = "0.11.6"
anyhow = { version = "1.0", optional = true }
chrono = "0.4"
clap = { version = "4.5", features = ["derive"] }
env_logger = { version = "0.11", optional = true }
heck = "0.5"
hex = "0.4.3"
hex = "0.4"
itertools = "0.14"
log = "0.4"
prettyplease = "0.2"
proc-macro2 = "1.0.93"
proc-macro2 = "1.0"
quote = "1.0"
roxmltree = "0.20"
sha2 = "0.10"
syn = "2.0.96"
syn = "2.0"
thiserror = "2.0"
typenum = "1.17.0"
[build-dependencies]
vergen-gitcl = { version = "1.0.0", features = ["build", "cargo", "rustc", "si"] }
vergen-gitcl = { version = "1.0", features = ["build", "cargo", "rustc", "si"] }
[features]
bin = ["anyhow", "env_logger"]

View file

@ -1,5 +1,8 @@
# Endcap SL Software RI Generator
[![pipeline status](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/badges/main/pipeline.svg)](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/commits/main)
[![Latest Release](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/badges/release.svg)](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/releases)
これはXMLのレジスタマップからMPSoCソフトで使う用のコードを生成するソフトです。
XMLおよびそのスキーマは[L0 Muon Endcap/Endcap Sl CSR XML](https://gitlab.cern.ch/l0muon-endcap/endcap-sl-csr-xml)にあります。

View file

@ -1,5 +1,8 @@
# Endcap SL Software RI Generator
[![pipeline status](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/badges/main/pipeline.svg)](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/commits/main)
[![Latest Release](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/badges/release.svg)](https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator/-/releases)
[日本語版](README-ja.md)
Generates register interface for mpsoc software from register map in xml format.

View file

@ -12,21 +12,21 @@
//! ```no_run
//! use endcap_sl_software_ri_generator::types;
//!
//! let xmlfile = std::fs::read_to_string("./csr.xml")?;
//! let xmlfile = std::fs::read_to_string("./csr.xml").expect("failed to open file");
//! let doc = roxmltree::Document::parse_with_options(
//! &xmlfile,
//! roxmltree::ParsingOptions {
//! allow_dtd: true,
//! nodes_limit: u32::MAX,
//! },
//! )?;
//! )
//! .expect("failed to parse");
//!
//! let register_map = types::Module::from_xml_dom(doc.root_element())?;
//! let register_map = types::Module::from_xml_dom(doc.root_element()).expect("failed to convert");
//!
//! let files = register_map.generate_code()?;
//! endcap_sl_software_ri_generator::write_to_files(files, &std::path::PathBuf::from("out"))?;
//!
//! # Ok::<(), anyhow::Error>(())
//! let files = register_map.generate_code().expect("failed to generate code");
//! endcap_sl_software_ri_generator::write_to_files(files,
//! &std::path::PathBuf::from("out")).expect("failed to write");
//! ```
//!
//! # Overview