diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-04-12 13:04:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-12 13:04:10 -0400 |
commit | 561f7a6e6c24b05383b6db86b48125ee80a8355f (patch) | |
tree | 6acbfd27652c2b83686df93c21918a877a0451e8 /inc/cli.h | |
parent | c9e35a8f3aa2047701e87a50f12b4bed23d5e7db (diff) | |
parent | 3ae113c7d6f1b6f46d8960b284837a44fbeb2e77 (diff) |
Merge pull request #50 from bdunahu/bdunahu
Move storage to a separate git repository.
Diffstat (limited to 'inc/cli.h')
-rw-r--r-- | inc/cli.h | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/inc/cli.h b/inc/cli.h deleted file mode 100644 index a0c698a..0000000 --- a/inc/cli.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef CLI_H -#define CLI_H -#include "cache.h" -#include <functional> -#include <string> -#include <unordered_map> - -class Cli -{ - public: - /** - * Constructor. - * @return A newly allocated CLI object. - */ - Cli(); - ~Cli(); - - /** - * Prints all available commands to the console. - */ - void help(); - - /** - * Loads data from memory from the specified memory address. - * @param memory_address address of the memory where data needs to be loaded - * from - */ - 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); - - /** - * Resets the memory configuration and cycles to their initial state. - * This function provides a side door reset interface to the memory system, - * allowing the user to reset the memory configuration directly. - */ - void reset(); - - /** - * Advance the clock one cycle, refreshing the storage devices. - */ - void clock(); - - /** - * Displays `lines` lines of the data in `level`, starting from `base`. - * - * - * This function provides a side door view into the storage system, showing - * its current state and configuration. - * @param level the level specifying the storage device. The first level - * one cache is level zero, with descending levels incrementing by a factor - * of one. - */ - void peek(int level); - - /** - * Runs the command line interface - * This function is the main entry point for the command line interface. - */ - void run(); - - private: - /** - * 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<char, std::function<void(std::vector<std::string>)>> - commands; - /** - * The cache object to interface with. - */ - Cache *cache; - /** - * The current cycle. - */ - int cycle; -}; - -#endif /* CLI_H_INCLUDED */ |