soc/cores/identifier: append 0 to contents to indicate end of string
This commit is contained in:
parent
bdc61106d1
commit
1364ac3657
|
@ -5,8 +5,9 @@ class Identifier(Module):
|
||||||
def __init__(self, ident):
|
def __init__(self, ident):
|
||||||
contents = list(ident.encode())
|
contents = list(ident.encode())
|
||||||
l = len(contents)
|
l = len(contents)
|
||||||
if l > 256:
|
if l > 255:
|
||||||
raise ValueError("Identifier string must be 255 characters or less")
|
raise ValueError("Identifier string must be 255 characters or less")
|
||||||
|
contents.append(0)
|
||||||
self.mem = Memory(8, len(contents), init=contents)
|
self.mem = Memory(8, len(contents), init=contents)
|
||||||
|
|
||||||
def get_memories(self):
|
def get_memories(self):
|
||||||
|
|
Loading…
Reference in New Issue