Skip to content

Commit

Permalink
[t1rocket] fix wrong bus_size
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Aug 17, 2024
1 parent ac053cd commit ec8678c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t1rocketemu/online_dpi/src/drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ impl ShadowMem {
let addr_align = addr & ((!bus_size) + 1);

let bus_size = bus_size as usize;
assert_eq!(bus_size, masks.len());
assert_eq!(bus_size, data.len());
// should not check this, in scalar narrow write, bus_size is not equal to data.len()
// assert_eq!(bus_size, masks.len());
// assert_eq!(bus_size, data.len());

for i in 0..bus_size {
if masks[i] {
Expand Down Expand Up @@ -336,7 +337,8 @@ impl Driver {
data: &[u8],
) {
let size = 1 << awsize;
self.shadow_mem.write_mem_axi(addr, size, 32, strobe, data);
let bus_size = if size == 32 { 32 } else { 4 };
self.shadow_mem.write_mem_axi(addr, size, bus_size, strobe, data);
let data_hex = hex::encode(data);
self.last_commit_cycle = get_t();

Expand Down

0 comments on commit ec8678c

Please sign in to comment.