From 53edc3557e9d828a7899888dde028f6dffe2ac7c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 25 Mar 2013 14:43:44 +0100 Subject: [PATCH] bank/description/Register: add get_size --- migen/bank/description.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migen/bank/description.py b/migen/bank/description.py index 3b9846db..160f2fb4 100644 --- a/migen/bank/description.py +++ b/migen/bank/description.py @@ -19,6 +19,9 @@ class RegisterRaw(_Register): self.r = Signal(self.size) self.w = Signal(self.size) + def get_size(self): + return self.size + (READ_ONLY, WRITE_ONLY, READ_WRITE) = range(3) class Field: @@ -45,6 +48,9 @@ class RegisterFields(_Register): _Register.__init__(self, name) self.fields = fields + def get_size(self): + return sum(field.size for field in self.fields) + class RegisterField(RegisterFields): def __init__(self, size=1, access_bus=READ_WRITE, access_dev=READ_ONLY, reset=0, atomic_write=False, name=None): self.field = Field(size, access_bus, access_dev, reset, atomic_write, name="") -- 2.30.2