mirror of https://github.com/VLSIDA/OpenRAM.git
Add str function for sram_config
This commit is contained in:
parent
178f1197ca
commit
03f87cd681
|
|
@ -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 """
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue