Add str function for sram_config

This commit is contained in:
mrg 2021-09-07 16:49:31 -07:00
parent 178f1197ca
commit 03f87cd681
1 changed files with 15 additions and 0 deletions

View File

@ -43,6 +43,21 @@ class sram_config:
self.compute_sizes() self.compute_sizes()
def __str__(self):
""" override print function output """
config_items = ["num_banks",
"word_size",
"num_words",
"words_per_row",
"write_size",
"num_spare_rows",
"num_spare_cols"]
str = ""
for item in config_items:
val = getattr(self, item)
str += "{} : {}\n".format(item, val)
return str
def set_local_config(self, module): def set_local_config(self, module):
""" Copy all of the member variables to the given module for convenience """ """ Copy all of the member variables to the given module for convenience """