diff --git a/src/simudator/core/module.py b/src/simudator/core/module.py index dc654349b03ec12c0f3498374de1cfac5e2d5b65..82beff32cff66772847216379af3f57ac89491ae 100644 --- a/src/simudator/core/module.py +++ b/src/simudator/core/module.py @@ -117,10 +117,18 @@ class Module: print(self.name) def _helper_save_state_to_file(self, file_path: str, content: str) -> bool: - """ - Tries to save the content to a given file. - - Returns true on success and false otherwise. + """Save the given content to a given file. + + Parameters + ---------- + file_path : str + Path to file to save to. + content : str + Content to save to file. + + Returns + ------- + ``True`` on success, ``False`` otherwise. """ try: with open(file_path, "a") as file: diff --git a/src/simudator/processor/mia/modules/alu.py b/src/simudator/processor/mia/modules/alu.py index edb4eb6e328533db4d16436783191c0a2167b41f..3f9cbdb3484545f7ff5febc2849020b61f3406f8 100644 --- a/src/simudator/processor/mia/modules/alu.py +++ b/src/simudator/processor/mia/modules/alu.py @@ -67,7 +67,8 @@ class ALU(Module): pass def save_state_to_file(self, file_path: str) -> bool: - """ + """Do nothing. + The alu is state-less. """ return True diff --git a/src/simudator/processor/mia/modules/bus.py b/src/simudator/processor/mia/modules/bus.py index 71125ffb384ae3dee8f19727857f5320992e5e17..9e1112abbce45e8b85fbe3b488289df213b9ad1d 100644 --- a/src/simudator/processor/mia/modules/bus.py +++ b/src/simudator/processor/mia/modules/bus.py @@ -70,7 +70,8 @@ class Bus(Module): pass def save_state_to_file(self, file_path: str) -> bool: - """ + """Do nothing. + The bus is state-less. """ return True diff --git a/src/simudator/processor/mia/modules/ir.py b/src/simudator/processor/mia/modules/ir.py index 57cd353f83cba08b8ade4e2ebdc8ca0cefc0ac56..776df1eec8d75f25e35373b9c6293ea139922b87 100644 --- a/src/simudator/processor/mia/modules/ir.py +++ b/src/simudator/processor/mia/modules/ir.py @@ -129,9 +129,6 @@ class IR(Module, MiaBusConnector): ) def save_state_to_file(self, file_path: str) -> bool: - """ - Tries to save the modules state to a given file. - """ content = self.name + ":\n" content += "Instruction: " + hex(self.instruction)[2:] + "\n\n" return super()._helper_save_state_to_file(file_path, content)