uio: unified I/O object
This commit is contained in:
parent
d10df1a8ab
commit
7add4c6f3c
|
@ -6,7 +6,7 @@ from migen.fhdl.structure import _Slice
|
||||||
from migen.pytholite.reg import *
|
from migen.pytholite.reg import *
|
||||||
from migen.pytholite.expr import *
|
from migen.pytholite.expr import *
|
||||||
from migen.pytholite import transel
|
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 *
|
from migen.pytholite.fsm import *
|
||||||
|
|
||||||
def _is_name_used(node, name):
|
def _is_name_used(node, name):
|
||||||
|
@ -228,7 +228,7 @@ class _Compiler:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def make_pytholite(func, **ioresources):
|
def make_pytholite(func, **ioresources):
|
||||||
ioo = make_io_object(**ioresources)
|
ioo = Pytholite(**ioresources)
|
||||||
|
|
||||||
tree = ast.parse(inspect.getsource(func))
|
tree = ast.parse(inspect.getsource(func))
|
||||||
symdict = func.__globals__.copy()
|
symdict = func.__globals__.copy()
|
||||||
|
|
|
@ -1,24 +1,16 @@
|
||||||
import ast
|
import ast
|
||||||
|
|
||||||
from migen.fhdl.structure import *
|
from migen.fhdl.structure import *
|
||||||
from migen.flow.actor import *
|
from migen.uio.ioo import UnifiedIOObject
|
||||||
from migen.actorlib.sim import *
|
from migen.actorlib.sim import *
|
||||||
|
from migen.bus.transactions import *
|
||||||
from migen.pytholite.fsm import *
|
from migen.pytholite.fsm import *
|
||||||
from migen.pytholite.expr import ExprCompiler
|
from migen.pytholite.expr import ExprCompiler
|
||||||
|
|
||||||
class Pytholite:
|
class Pytholite(UnifiedIOObject):
|
||||||
def get_fragment(self):
|
def get_fragment(self):
|
||||||
return self.fragment
|
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):
|
class _TokenPullExprCompiler(ExprCompiler):
|
||||||
def __init__(self, symdict, modelname, ep):
|
def __init__(self, symdict, modelname, ep):
|
||||||
super().__init__(symdict)
|
super().__init__(symdict)
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue