Skip to content

Commit

Permalink
Don't offset register addresses with block address
Browse files Browse the repository at this point in the history
  • Loading branch information
SpinFast committed Dec 2, 2023
1 parent 9bd032e commit f1f8689
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generate/iface/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ pub fn render(opts: &Options, ir: &IR, b: &Block, path: &str) -> Result<TokenStr
#[inline(always)]
pub fn #name(&mut self, n: usize) -> #ty {
assert!(n < #len);
#common_path::Reg::new(self.iface, (self.addr + #offset + #offs_expr) as #addr_ty)
#common_path::Reg::new(self.iface, (#offset + #offs_expr) as #addr_ty)
}
));
} else {
items.extend(quote!(
#doc
#[inline(always)]
pub fn #name(&mut self) -> #ty {
#common_path::Reg::new(self.iface, (self.addr + #offset) as #addr_ty)
#common_path::Reg::new(self.iface, (#offset) as #addr_ty)
}
));
}
Expand Down

0 comments on commit f1f8689

Please sign in to comment.