2012-11-10 16:59:14 -05:00
|
|
|
import ast
|
|
|
|
|
2012-11-10 15:51:19 -05:00
|
|
|
from migen.flow.actor import *
|
2012-11-10 16:59:14 -05:00
|
|
|
from migen.actorlib.sim import *
|
2012-11-10 15:51:19 -05:00
|
|
|
|
|
|
|
class Pytholite:
|
|
|
|
def get_fragment(self):
|
|
|
|
return self.fragment
|
|
|
|
|
|
|
|
class DFPytholite(Pytholite, Actor):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def make_io_object(dataflow=None):
|
|
|
|
if dataflow is None:
|
|
|
|
return Pytholite()
|
|
|
|
else:
|
|
|
|
return DFPytholite(dataflow)
|
|
|
|
|
2012-11-10 16:59:14 -05:00
|
|
|
|
|
|
|
def gen_io(compiler, model, to_model, from_model):
|
2012-11-11 12:03:16 -05:00
|
|
|
print("model: " + str(model))
|
|
|
|
print("to_model:")
|
2012-11-10 16:59:14 -05:00
|
|
|
for arg in to_model:
|
|
|
|
print(ast.dump(arg))
|
2012-11-11 12:03:16 -05:00
|
|
|
print("from_model:")
|
|
|
|
for target, expr in from_model:
|
|
|
|
print(str(target) + " <= " + ast.dump(expr))
|
2012-11-10 16:59:14 -05:00
|
|
|
return [], []
|