From c9d4b54150b67e1701a920719ba2c7c03d897d27 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 11 May 2025 19:40:47 -0400 Subject: Stride load, stride store --- inc/ex.h | 9 ++++++--- inc/mm.h | 13 +++++++++++++ inc/wb.h | 3 ++- 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'inc') diff --git a/inc/ex.h b/inc/ex.h index 19b35d4..41195a1 100644 --- a/inc/ex.h +++ b/inc/ex.h @@ -78,7 +78,6 @@ class EX : public Stage * Handles operations involving three vector registers. * @param slot 1, and later, the result of the mnemonic operation. * @param slot 2 - * @param slot 3 * @param the mnemonic * @param the vector length register */ @@ -89,14 +88,18 @@ class EX : public Stage unsigned int v_len); /** - * Handles operations involving a single vector register. + * Handles operations involving a vector result and a scalar. * Currently, this is SRDL and SRDS * @param slot 1, and later, the result of the mnemonic operation. * @param slot 2 * @param the mnemonic * @param the vector length register */ - void handle_s_vector_operations(signed int &s1, signed int s2, Mnemonic m); + void handle_s_vector_operations( + std::array &s1, + signed int s2, + Mnemonic m, + unsigned int v_len); /** * Wrapper for division functions, which detects HALT instructinos (division * by 0). diff --git a/inc/mm.h b/inc/mm.h index 230b258..d54d6ad 100644 --- a/inc/mm.h +++ b/inc/mm.h @@ -29,6 +29,19 @@ class MM : public Stage private: void advance_helper() override; + /** + * Helpers for `advance_helper'. Sets the `this->status' to OK + * If the current memory IO returned OK, and all vector elements + * have been processed. Otherwise, sets `this->status' to STALLED + * @param the response from the storage devices. + */ + void try_start(); + void try_finish(int response); + /** + * The index element currently being loaded or stored. + * Used for strided load/store. + */ + int curr_element = 0; }; #endif /* MM_H_INCLUDED */ diff --git a/inc/wb.h b/inc/wb.h index 35c9240..bbba5bf 100644 --- a/inc/wb.h +++ b/inc/wb.h @@ -51,7 +51,8 @@ class WB : public Stage * @return the vector register to be stored, obtained by copying the * unfilled elements in the destination register to the source. This is * required to ensure what is written back only changes VECTOR_LENGTH number - * of elements. + * of elements. Correctly handles zeroing out ALU operations if the VECTOR + * LENGTH number is zero. */ std::array copy_extra_vector_elements(); }; -- cgit v1.2.3