From 1897b74f979c9050ff2ae9489e6fe45a0fca275d Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 24 Mar 2013 00:50:33 +0100 Subject: [PATCH] genlib/record: add eq --- migen/genlib/record.py | 4 ++++ 1 file changed, 4 insertions(+) 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: -- 2.30.2