From 9cdc88eadff3581b4685f99edc5f901f6cf15f77 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 13 Jul 2012 18:16:50 +0200 Subject: [PATCH] fhdl: len() for Constant --- migen/fhdl/structure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 332f5bf9..a0a8da50 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -134,6 +134,9 @@ class Constant(Value): self.bv = bv or BV(bits_for(n), n < 0) self.n = n + def __len__(self): + return self.bv.width + def __repr__(self): return str(self.bv) + str(self.n) -- 2.30.2