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):
|
||||
contents = list(ident.encode())
|
||||
l = len(contents)
|
||||
if l > 256:
|
||||
if l > 255:
|
||||
raise ValueError("Identifier string must be 255 characters or less")
|
||||
contents.append(0)
|
||||
self.mem = Memory(8, len(contents), init=contents)
|
||||
|
||||
def get_memories(self):
|
||||
|
|
Loading…
Reference in New Issue