diff --git a/migen/pytholite/compiler.py b/migen/pytholite/compiler.py index 269706a46..5f6420f6e 100644 --- a/migen/pytholite/compiler.py +++ b/migen/pytholite/compiler.py @@ -6,7 +6,7 @@ from migen.fhdl.structure import _Slice from migen.pytholite.reg import * from migen.pytholite.expr import * from migen.pytholite import transel -from migen.pytholite.io import make_io_object, gen_io +from migen.pytholite.io import Pytholite, gen_io from migen.pytholite.fsm import * def _is_name_used(node, name): @@ -228,7 +228,7 @@ class _Compiler: raise NotImplementedError def make_pytholite(func, **ioresources): - ioo = make_io_object(**ioresources) + ioo = Pytholite(**ioresources) tree = ast.parse(inspect.getsource(func)) symdict = func.__globals__.copy() diff --git a/migen/pytholite/io.py b/migen/pytholite/io.py index 51820a69c..89effa637 100644 --- a/migen/pytholite/io.py +++ b/migen/pytholite/io.py @@ -1,24 +1,16 @@ import ast from migen.fhdl.structure import * -from migen.flow.actor import * +from migen.uio.ioo import UnifiedIOObject from migen.actorlib.sim import * +from migen.bus.transactions import * from migen.pytholite.fsm import * from migen.pytholite.expr import ExprCompiler -class Pytholite: +class Pytholite(UnifiedIOObject): 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) - class _TokenPullExprCompiler(ExprCompiler): def __init__(self, symdict, modelname, ep): super().__init__(symdict) diff --git a/migen/uio/__init__.py b/migen/uio/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/migen/uio/ioo.py b/migen/uio/ioo.py new file mode 100644 index 000000000..934cbf32e --- /dev/null +++ b/migen/uio/ioo.py @@ -0,0 +1,9 @@ +from migen.fhdl.structure import * +from migen.flow.actor import * +from migen.bus import wishbone + +class UnifiedIOObject(Actor): + def __init__(self, dataflow=None, buses={}): + if dataflow is not None: + super().__init__(*dataflow) + self.buses = buses