File tree 4 files changed +12
-11
lines changed
4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 2
2
from collections import OrderedDict
3
3
4
4
from migen .fhdl .std import *
5
- from migen .fhdl .decorators import ModuleDecorator
6
5
from migen .genlib .resetsync import AsyncResetSynchronizer
7
6
from migen .genlib .record import *
8
7
from migen .genlib .fsm import FSM , NextState
Original file line number Diff line number Diff line change
1
+ from migen .fhdl .decorators import ModuleTransformer
1
2
from misoclib .com .liteeth .common import *
2
3
3
4
# Generic classes
@@ -10,15 +11,16 @@ def connect(self, port):
10
11
return r
11
12
12
13
# Generic modules
13
- class BufferizeEndpoints (ModuleDecorator ):
14
- def __init__ (self , submodule , * args ):
15
- ModuleDecorator . __init__ ( self , submodule )
14
+ class BufferizeEndpoints (ModuleTransformer ):
15
+ def __init__ (self , * names ):
16
+ self . names = names
16
17
18
+ def transform_instance (self , submodule ):
17
19
endpoints = get_endpoints (submodule )
18
20
sinks = {}
19
21
sources = {}
20
22
for name , endpoint in endpoints .items ():
21
- if name in args or len ( args ) == 0 :
23
+ if not self . names or name in self . names :
22
24
if isinstance (endpoint , Sink ):
23
25
sinks .update ({name : endpoint })
24
26
elif isinstance (endpoint , Source ):
Original file line number Diff line number Diff line change 1
1
import math
2
2
3
3
from migen .fhdl .std import *
4
- from migen .fhdl .decorators import ModuleDecorator
4
+ from migen .fhdl .decorators import ModuleTransformer
5
5
from migen .genlib .resetsync import *
6
6
from migen .genlib .fsm import *
7
7
from migen .genlib .record import *
@@ -252,15 +252,16 @@ def sectors2dwords(n):
252
252
return n * logical_sector_size // 4
253
253
254
254
# Generic modules
255
- class BufferizeEndpoints (ModuleDecorator ):
256
- def __init__ (self , submodule , * args ):
257
- ModuleDecorator . __init__ ( self , submodule )
255
+ class BufferizeEndpoints (ModuleTransformer ):
256
+ def __init__ (self , * names ):
257
+ self . names = names
258
258
259
+ def transform_instance (self , submodule ):
259
260
endpoints = get_endpoints (submodule )
260
261
sinks = {}
261
262
sources = {}
262
263
for name , endpoint in endpoints .items ():
263
- if name in args or len ( args ) == 0 :
264
+ if not self . names or name in self . names :
264
265
if isinstance (endpoint , Sink ):
265
266
sinks .update ({name : endpoint })
266
267
elif isinstance (endpoint , Source ):
Original file line number Diff line number Diff line change 1
1
from misoclib .mem .litesata .common import *
2
2
from misoclib .mem .litesata .core .link .scrambler import Scrambler
3
3
4
- from migen .fhdl .decorators import ModuleDecorator
5
4
from migen .bank .description import *
6
5
7
6
class LiteSATABISTGenerator (Module ):
You can’t perform that action at this time.
0 commit comments