generic_platform: add name
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 14 Feb 2013 19:02:35 +0000 (20:02 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 14 Feb 2013 19:02:35 +0000 (20:02 +0100)
mibuild/generic_platform.py

index 844bcab96ded780651ee828feeaac3134f1bab9d..09a182147b72d40c48277197060e8d651d93057a 100644 (file)
@@ -163,10 +163,13 @@ class ConstraintManager:
                self.request, self.platform_commands, self.io_signals = backup
 
 class GenericPlatform:
-       def __init__(self, device, io, default_crg_factory=None):
+       def __init__(self, device, io, default_crg_factory=None, name=None):
                self.device = device
                self.constraint_manager = ConstraintManager(io)
                self.default_crg_factory = default_crg_factory
+               if name is None:
+                       name = self.__module__.split(".")[-1]
+               self.name = name
                self.sources = []
 
        def request(self, *args, **kwargs):