Skip to content
Snippets Groups Projects
Commit 77a1e9a9 authored by Johannes Kung's avatar Johannes Kung
Browse files

Renamed constants in memory

parent a386daca
No related branches found
No related tags found
1 merge request!27Docstring refactor of core
......@@ -6,8 +6,8 @@ from simudator.core.module import Module
from simudator.core.signal import Signal
# Used to pad the values of the memory when saving to file
VALUE_PADDING = 2
ADDRESS_PADDING = 2
MEMORY_VALUE_PADDING = 2
MEMORY_ADDRESS_PADDING = 2
class Memory(Module):
......@@ -133,9 +133,9 @@ class Memory(Module):
file.write(self.name + ":\n")
for index, value in enumerate(self._memory):
# Write the address in hex and add ': ' to the end
file.write(hex(index)[2:].rjust(ADDRESS_PADDING, "0") + ": ")
file.write(hex(index)[2:].rjust(MEMORY_ADDRESS_PADDING, "0") + ": ")
# Write the value in hex
file.write(hex(value)[2:].rjust(VALUE_PADDING, "0"))
file.write(hex(value)[2:].rjust(MEMORY_VALUE_PADDING, "0"))
file.write("\n")
file.write("\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment