Compare commits

...

2 commits

Author SHA1 Message Date
d6ee19e000 fix(validator): make FlattenedRegisterMap public
warned by rustdoc
2025-04-21 21:40:06 +09:00
2accbc3910 fix(flatmap): create output file if it doesn't exist 2025-04-21 21:39:06 +09:00
2 changed files with 6 additions and 2 deletions

View file

@ -99,7 +99,11 @@ pub fn generate_flatmap(xml: &path::Path, out: Option<&path::Path>) -> Result<()
} }
let f: Box<dyn Write> = match out { let f: Box<dyn Write> = match out {
Some(f) => { Some(f) => {
let file = File::options().write(true).truncate(true).open(f)?; let file = File::options()
.create(true)
.write(true)
.truncate(true)
.open(f)?;
Box::new(BufWriter::new(file)) Box::new(BufWriter::new(file))
} }
None => Box::new(io::stdout()), None => Box::new(io::stdout()),

View file

@ -16,7 +16,7 @@ pub struct FlattenedRegisterEntry<'a> {
} }
/// Flattened register map. /// Flattened register map.
type FlattenedRegisterMap<'a> = Vec<Option<FlattenedRegisterEntry<'a>>>; pub type FlattenedRegisterMap<'a> = Vec<Option<FlattenedRegisterEntry<'a>>>;
impl Module { impl Module {
/// Validate the address assignment, generating a flatten register map. /// Validate the address assignment, generating a flatten register map.