From: Sebastien Bourdeauducq Date: Sat, 23 Mar 2013 23:50:33 +0000 (+0100) Subject: genlib/record: add eq X-Git-Tag: 24jan2021_ls180~2099^2~627 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1897b74f979c9050ff2ae9489e6fe45a0fca275d;p=litex.git genlib/record: add eq --- diff --git a/migen/genlib/record.py b/migen/genlib/record.py index 74bd8303..9ead8daa 100644 --- a/migen/genlib/record.py +++ b/migen/genlib/record.py @@ -27,6 +27,10 @@ class Record: setattr(self, f, Signal(1, prefix + f)) self.field_order.append((f, 1)) + def eq(self, other): + return [getattr(self, key).eq(getattr(other, key)) + for key, a in self.field_order] + def layout(self): l = [] for key, alignment in self.field_order: