summaryrefslogtreecommitdiff
path: root/inc/utils.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-11 11:28:25 -0400
committerGitHub <noreply@github.com>2025-03-11 11:28:25 -0400
commite24e3cd4d296599b9ef1b705846b1c868148b0fd (patch)
tree25646d98b4bfcf4b9a664eabfc2651c481984c1d /inc/utils.h
parent357e7fb37caf58cdfcdf85f7553db9378ff16e0c (diff)
parentfde996690d77b81e445450671a0723f837de4eb3 (diff)
Merge pull request #23 from bdunahu/bdunahu
Memory simulator CLI function implementation
Diffstat (limited to 'inc/utils.h')
-rw-r--r--inc/utils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/inc/utils.h b/inc/utils.h
index e258ed8..71e515b 100644
--- a/inc/utils.h
+++ b/inc/utils.h
@@ -1,5 +1,6 @@
#ifndef UTILS_H
#define UTILS_H
+#include <string>
/**
* Parse an address into a tag, index into the cache table, and a line
@@ -11,4 +12,12 @@
*/
void get_bit_fields(int address, int *tag, int *index, int *offset);
+/**
+ * Formats a string using snprintf.
+ * @param an object that represents the format string
+ * @param arguments to be formatted
+ * @return a string object holding the formatted result
+ */
+const std::string string_format(const char *const zcFormat, ...);
+
#endif /* UTILS_H_INCLUDED */