soc/integration/common: simplify get_version

This commit is contained in:
Florent Kermarrec 2020-02-11 17:16:24 +01:00
parent 4d761e1afd
commit 0a737cb624
1 changed files with 2 additions and 6 deletions

View File

@ -20,12 +20,8 @@ def mem_decoder(address, size=0x10000000):
return lambda a: (a[log2_int(size):] == (address >> log2_int(size)))
def get_version(with_time=True):
if with_time:
return datetime.datetime.fromtimestamp(
time.time()).strftime("%Y-%m-%d %H:%M:%S")
else:
return datetime.datetime.fromtimestamp(
time.time()).strftime("%Y-%m-%d")
fmt = "%Y-%m-%d %H:%M:%S" if with_time else "%Y-%m-%d"
return datetime.datetime.fromtimestamp(time.time()).strftime(fmt)
def get_mem_data(filename_or_regions, endianness="big", mem_size=None):
# create memory regions