adds explicit RFS to assertions
This commit is contained in:
parent
947d353bbf
commit
6f4daf91ed
@ -44,6 +44,7 @@
|
|||||||
#include <nonstd/variant.hpp>
|
#include <nonstd/variant.hpp>
|
||||||
|
|
||||||
namespace softvector {
|
namespace softvector {
|
||||||
|
unsigned RFS = 32;
|
||||||
|
|
||||||
bool softvec_read(void* core, uint64_t addr, uint64_t length, uint8_t* data) {
|
bool softvec_read(void* core, uint64_t addr, uint64_t length, uint8_t* data) {
|
||||||
iss::status status = static_cast<iss::arch_if*>(core)->read(iss::address_type::PHYSICAL, iss::access_type::READ,
|
iss::status status = static_cast<iss::arch_if*>(core)->read(iss::address_type::PHYSICAL, iss::access_type::READ,
|
||||||
@ -108,7 +109,7 @@ uint64_t vector_load_store(void* core, std::function<bool(void*, uint64_t, uint6
|
|||||||
for(unsigned s_idx = 0; s_idx < segment_size; s_idx++) {
|
for(unsigned s_idx = 0; s_idx < segment_size; s_idx++) {
|
||||||
// base + selected vd + current_elem + current_segment
|
// base + selected vd + current_elem + current_segment
|
||||||
uint8_t* dest_elem = V + (vd * VLEN / 8) + (eew / 8 * idx) + (VLEN / 8 * s_idx * emul_stride);
|
uint8_t* dest_elem = V + (vd * VLEN / 8) + (eew / 8 * idx) + (VLEN / 8 * s_idx * emul_stride);
|
||||||
assert(dest_elem <= V + VLEN * 32 / 8);
|
assert(dest_elem <= V + VLEN * RFS / 8);
|
||||||
if(mask_active) {
|
if(mask_active) {
|
||||||
uint64_t addr = base_addr + (eew / 8) * (idx * segment_size + s_idx) * stride;
|
uint64_t addr = base_addr + (eew / 8) * (idx * segment_size + s_idx) * stride;
|
||||||
if(!load_store_fn(core, addr, eew / 8, dest_elem))
|
if(!load_store_fn(core, addr, eew / 8, dest_elem))
|
||||||
@ -126,7 +127,7 @@ uint64_t vector_load_store(void* core, std::function<bool(void*, uint64_t, uint6
|
|||||||
for(unsigned s_idx = 0; s_idx < segment_size; s_idx++) {
|
for(unsigned s_idx = 0; s_idx < segment_size; s_idx++) {
|
||||||
// base + selected vd + current_elem + current_segment
|
// base + selected vd + current_elem + current_segment
|
||||||
uint8_t* dest_elem = V + (vd * VLEN / 8) + (eew / 8 * idx) + (VLEN / 8 * s_idx * emul_stride);
|
uint8_t* dest_elem = V + (vd * VLEN / 8) + (eew / 8 * idx) + (VLEN / 8 * s_idx * emul_stride);
|
||||||
assert(dest_elem <= V + VLEN * 32 / 8);
|
assert(dest_elem <= V + VLEN * RFS / 8);
|
||||||
// this only updates the first 8 bits, so eew > 8 would not work correctly
|
// this only updates the first 8 bits, so eew > 8 would not work correctly
|
||||||
*dest_elem = vtype.vta() ? *dest_elem : *dest_elem;
|
*dest_elem = vtype.vta() ? *dest_elem : *dest_elem;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user