Skip to content

Commit

Permalink
csv: make all named register accesses lowercase
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Cross <sean@xobs.io>
  • Loading branch information
xobs committed Sep 26, 2019
1 parent 0eebc06 commit 61b0f8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wishbone-tool/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions wishbone-tool/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Config {
let register_mapping = Self::parse_csr_csv(matches.value_of("csr-csv"));

let memory_address = if let Some(addr) = matches.value_of("address") {
if let Some(addr) = register_mapping.get(addr) {
if let Some(addr) = register_mapping.get(&addr.to_lowercase()) {
Some(*addr)
} else {
Some(parse_u32(addr)?)
Expand Down Expand Up @@ -212,11 +212,11 @@ impl Config {
// If this is the case, create indexed offsets for those registers.
match num_regs {
1 => {
map.insert(reg_name.to_string(), base_addr);
map.insert(reg_name.to_string().to_lowercase(), base_addr);
},
n => {
for offset in 0..n {
map.insert(format!("{}{}", reg_name.to_string(), n - offset - 1), base_addr+(offset*4));
map.insert(format!("{}{}", reg_name.to_string().to_lowercase(), n - offset - 1), base_addr+(offset*4));
}
}
}
Expand Down

0 comments on commit 61b0f8a

Please sign in to comment.