From a930753de47609eadc72fcd274fd9e0d8441e186 Mon Sep 17 00:00:00 2001 From: Clo91eaf Date: Thu, 22 Aug 2024 13:33:09 +0800 Subject: [PATCH] [t1rocket] fix error data length --- t1rocketemu/online_dpi/src/dpi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t1rocketemu/online_dpi/src/dpi.rs b/t1rocketemu/online_dpi/src/dpi.rs index 0b1bd54899..f4b51f221b 100644 --- a/t1rocketemu/online_dpi/src/dpi.rs +++ b/t1rocketemu/online_dpi/src/dpi.rs @@ -40,7 +40,7 @@ unsafe fn load_from_payload( size: usize, ) -> (Vec, &[u8]) { let src = *payload as *mut u8; - let data_width_in_byte = size; + let data_width_in_byte = std::cmp::max(size, 4); let strb_width_per_byte = if data_width < 64 { 4 } else { 8 }; let strb_width_in_byte = size.div_ceil(strb_width_per_byte);