@@ -63,7 +63,7 @@ def __init__(self, m, name, clk, rst, width=32):
63
63
64
64
self .done = False
65
65
66
- #-------------------------------------------------------------------------
66
+ # -------------------------------------------------------------------------
67
67
def input (self , data , valid = None , ready = None , width = None ):
68
68
if ready is not None and not isinstance (ready , (vtypes .Wire , vtypes .Output )):
69
69
raise TypeError ('ready port of PipelineVariable must be Wire., not %s' %
@@ -73,7 +73,7 @@ def input(self, data, valid=None, ready=None, width=None):
73
73
self .vars .append (ret )
74
74
return ret
75
75
76
- #-------------------------------------------------------------------------
76
+ # -------------------------------------------------------------------------
77
77
# self.__call__() calls this method
78
78
def stage (self , data , initval = 0 , width = None , preg = None ):
79
79
if width is None :
@@ -96,7 +96,7 @@ def stage(self, data, initval=0, width=None, preg=None):
96
96
97
97
return ret
98
98
99
- #-------------------------------------------------------------------------
99
+ # -------------------------------------------------------------------------
100
100
# Accumulator
101
101
def acc_and (self , data , initval = 0 , resetcond = None , width = None ):
102
102
return self ._accumulate ([vtypes .And ], data , width , initval , resetcond )
@@ -146,7 +146,7 @@ def acc_custom(self, data, ops, initval=0, resetcond=None, width=None, label=Non
146
146
ops = [ops ]
147
147
return self ._accumulate (ops , data , width , initval , resetcond , label )
148
148
149
- #-------------------------------------------------------------------------
149
+ # -------------------------------------------------------------------------
150
150
def make_always (self , reset = (), body = ()):
151
151
if self .done :
152
152
raise ValueError ('make_always() has been already called.' )
@@ -165,19 +165,19 @@ def make_always(self, reset=(), body=()):
165
165
self .make_code ()
166
166
))
167
167
168
- #-------------------------------------------------------------------------
168
+ # -------------------------------------------------------------------------
169
169
def make_reset (self ):
170
170
return self .seq .make_reset ()
171
171
172
- #-------------------------------------------------------------------------
172
+ # -------------------------------------------------------------------------
173
173
def make_code (self ):
174
174
return self .seq .make_code ()
175
175
176
- #-------------------------------------------------------------------------
176
+ # -------------------------------------------------------------------------
177
177
def draw_graph (self , filename = 'out.png' , prog = 'dot' ):
178
178
_draw_graph (self , filename , prog )
179
179
180
- #-------------------------------------------------------------------------
180
+ # -------------------------------------------------------------------------
181
181
def _accumulate (self , ops , data , width = None , initval = 0 , resetcond = None , oplabel = None ):
182
182
if width is None :
183
183
width = self .width
@@ -197,7 +197,7 @@ def _accumulate(self, ops, data, width=None, initval=0, resetcond=None, oplabel=
197
197
198
198
return ret
199
199
200
- #-------------------------------------------------------------------------
200
+ # -------------------------------------------------------------------------
201
201
def _add_reg (self , prefix , count , width = None , initval = 0 ):
202
202
tmp_name = '_' .join (['' , self .name , prefix , str (count )])
203
203
tmp = self .m .Reg (tmp_name , width , initval = initval )
@@ -208,7 +208,7 @@ def _add_wire(self, prefix, count, width=None):
208
208
tmp = self .m .Wire (tmp_name , width )
209
209
return tmp
210
210
211
- #-------------------------------------------------------------------------
211
+ # -------------------------------------------------------------------------
212
212
def _make_tmp (self , data , valid , ready , width = None , initval = 0 , acc_ops = ()):
213
213
tmp_data = self ._add_reg (
214
214
'data' , self .tmp_count , width = width , initval = initval )
@@ -298,7 +298,7 @@ def _make_tmp(self, data, valid, ready, width=None, initval=0, acc_ops=()):
298
298
299
299
return tmp_data , tmp_valid , tmp_ready
300
300
301
- #-------------------------------------------------------------------------
301
+ # -------------------------------------------------------------------------
302
302
def _make_prev (self , data , valid , ready , width = None , initval = 0 ):
303
303
tmp_data = self ._add_reg (
304
304
'data' , self .tmp_count , width = width , initval = initval )
@@ -320,11 +320,11 @@ def _make_prev(self, data, valid, ready, width=None, initval=0):
320
320
321
321
return tmp_data , tmp_valid , tmp_ready
322
322
323
- #-------------------------------------------------------------------------
323
+ # -------------------------------------------------------------------------
324
324
def __call__ (self , data , initval = 0 , width = None ):
325
325
return self .stage (data , initval = initval , width = width )
326
326
327
- #-------------------------------------------------------------------------
327
+ # -------------------------------------------------------------------------
328
328
329
329
330
330
class _PipelineInterface (object ):
@@ -339,7 +339,7 @@ def __str__(self):
339
339
args = [self .data , self .valid , self .ready ]
340
340
return ',' .join ([str (arg ) for arg in args ])
341
341
342
- #-------------------------------------------------------------------------
342
+ # -------------------------------------------------------------------------
343
343
344
344
345
345
class _PipelineNumeric (vtypes ._Numeric ):
@@ -451,7 +451,7 @@ def _get_preg(self, stage_id):
451
451
return self
452
452
return self .preg_dict [stage_id ]
453
453
454
- #-------------------------------------------------------------------------
454
+ # -------------------------------------------------------------------------
455
455
456
456
457
457
class _PipelineVisitor (object ):
@@ -520,7 +520,7 @@ def visit_str(self, node):
520
520
def visit_float (self , node ):
521
521
raise NotImplementedError ('visit__Constant() must be implemented' )
522
522
523
- #-------------------------------------------------------------------------
523
+ # -------------------------------------------------------------------------
524
524
525
525
526
526
class DataVisitor (_PipelineVisitor ):
@@ -655,7 +655,7 @@ def visit_str(self, node):
655
655
def visit_float (self , node ):
656
656
return (None , vtypes .Float (node ), None , [])
657
657
658
- #-------------------------------------------------------------------------
658
+ # -------------------------------------------------------------------------
659
659
660
660
661
661
def _draw_graph (df , filename = 'out.png' , prog = 'dot' ):
0 commit comments