mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
decorators: fix class/instance logic
This commit is contained in:
parent
4091af69fd
commit
e702fb7727
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
import warnings
|
||||
|
||||
from migen.fhdl.structure import *
|
||||
from migen.fhdl.module import Module
|
||||
from migen.fhdl.tools import insert_reset, rename_clock_domain
|
||||
|
||||
class ModuleTransformer:
|
||||
|
@ -40,10 +41,10 @@ class ModuleTransformer:
|
|||
return victim
|
||||
|
||||
def __call__(self, victim):
|
||||
try:
|
||||
return self.wrap_class(victim)
|
||||
except TypeError:
|
||||
if isinstance(victim, Module):
|
||||
return self.wrap_instance(victim)
|
||||
else:
|
||||
return self.wrap_class(victim)
|
||||
|
||||
@classmethod
|
||||
def adhoc(cls, i, *args, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue