From f34156105801c81677c54d1713104ac3d7c1c112 Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 11 Mar 2025 00:09:12 -0400 Subject: cli display clock cycle, parse ';' delimited commands --- inc/cli.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'inc/cli.h') diff --git a/inc/cli.h b/inc/cli.h index 2194228..a0c698a 100644 --- a/inc/cli.h +++ b/inc/cli.h @@ -25,13 +25,14 @@ class Cli * @param memory_address address of the memory where data needs to be loaded * from */ - void load(int memory_address); + void load(Accessor accessor, int memory_address); /** * Stores data into memory at the specified address. * @param accessor the pipline stage that is making this request * @param data data value to be written to the memory * @param address address of the memory where data needs to be stored + * @return the response from the storage device */ void store(Accessor accessor, int data, int address); @@ -42,15 +43,6 @@ class Cli */ void reset(); - /** - * Updates the memory at the specified address with the given data. - * This function provides a side door modification interface to the memory - * system, allowing the user to modify the memory configuration directly. - * @param memory_address address of the memory to be updated - * @param data data value to be written to the memory - */ - void update(int memory_address, int data); - /** * Advance the clock one cycle, refreshing the storage devices. */ @@ -79,17 +71,27 @@ class Cli * Initializes the cache object. */ void initialize(); + /** + * Attempts to match string to either fetch or mem, or throws + * std::invalid_argument otherwise. + * @param the string to be converted accessor + * @return the corresponding accessor + * @throws invalid_argument if the string is not fetch or mem + */ + Accessor match_accessor_or_die(std::string s); /** Map of commands and their corresponding functions. * This map is used to store the commands and their corresponding functions. */ - std::unordered_map< - std::string, - std::function)>> + std::unordered_map)>> commands; /** * The cache object to interface with. */ Cache *cache; + /** + * The current cycle. + */ + int cycle; }; #endif /* CLI_H_INCLUDED */ -- cgit v1.2.3