From 1364ac3657619bccd1b2adc398d592c493da5d5e Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 22 Jun 2017 17:53:19 +0200 Subject: [PATCH] soc/cores/identifier: append 0 to contents to indicate end of string --- litex/soc/cores/identifier.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litex/soc/cores/identifier.py b/litex/soc/cores/identifier.py index ca9fec9b..07fc08ef 100644 --- a/litex/soc/cores/identifier.py +++ b/litex/soc/cores/identifier.py @@ -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): -- 2.30.2