From: Sebastien Bourdeauducq Date: Sat, 17 Nov 2012 18:54:50 +0000 (+0100) Subject: uio: unified I/O object X-Git-Tag: 24jan2021_ls180~2099^2~779 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7add4c6f3c66925be3634a13f9293b1be54835b9;p=litex.git uio: unified I/O object --- diff --git a/migen/pytholite/compiler.py b/migen/pytholite/compiler.py index 269706a4..5f6420f6 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 51820a69..89effa63 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 00000000..e69de29b diff --git a/migen/uio/ioo.py b/migen/uio/ioo.py new file mode 100644 index 00000000..934cbf32 --- /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