Re: [myhdl-list] Interfaces in Interfaces
Brought to you by:
jandecaluwe
From: Ben R. <be...@re...> - 2015-05-05 19:11:09
|
Don't bother checking that first attempt. It's totally broken. I'll try and sort it out properly and do a pull request and try to refrain the spamming the list too much more. On Tue, May 5, 2015 at 11:43 AM, Ben Reynwar <be...@re...> wrote: > Here's a first attempt: > > > https://github.com/benreynwar/myhdl/commit/ae6e5cb8faddd7119cfaf8ed457d4edfc088c623 > > I wasn't sure how to test it since I really wanted to convert the DUT to > VHDL and then a testbench to VHDL and then run a simulation on the combined > product. For now I just put a test in to make sure it doesn't hit any > exceptions when converting but since there's no testbench it not a very > good one. > > On Tue, May 5, 2015 at 11:35 AM, Christopher Felton < > chr...@gm...> wrote: > >> >> >> On Tuesday, May 5, 2015, Ben Reynwar <be...@re...> wrote: >> >>> So it looks like it's possible in internal interfaces but you can't >>> currently use them in the top interface. >>> >>> >>> https://github.com/jandecaluwe/myhdl/blob/08519b452f153885d3cc43038111b7779e2bb2f1/myhdl/conversion/_analyze.py#L1255 >>> >>> Is there any deep reason that this hasn't been done? Or should I just >>> go ahead and fix this? >>> >>> >> No I don't believe there is a reason. Extending to nested interfaces >> should be feasible. >> >> Regard, >> Chris >> >> >> >>> On Tue, May 5, 2015 at 9:35 AM, Ben Reynwar <be...@re...> wrote: >>> >>>> Problem was I was wrapping the interface with Signal. >>>> >>>> i.e. >>>> self.data = Signal(Complex(width=width)) >>>> should have been >>>> self.data = Complex(width=width) >>>> >>>> On Tue, May 5, 2015 at 8:49 AM, Ben Reynwar <be...@re...> wrote: >>>> >>>>> Great, thank you. I must have been doing something else wrong. And >>>>> thanks for the upper bound tip! >>>>> >>>>> On Tue, May 5, 2015 at 6:39 AM, Christopher Felton < >>>>> chr...@gm...> wrote: >>>>> >>>>>> On 5/4/15 11:01 PM, Ben Reynwar wrote: >>>>>> > Hi all, >>>>>> > >>>>>> > Is it possible to use interface definitions in interfaces? For >>>>>> example >>>>>> > I might have an interface for a complex number, and then an >>>>>> interface >>>>>> > for a back-pressured stream of complex numbers that uses the complex >>>>>> > number interface as a component. >>>>>> >>>>>> Yes, it is possible. A basic test case exists in >>>>>> the test suite: >>>>>> >>>>>> >>>>>> https://github.com/jandecaluwe/myhdl/blob/master/myhdl/test/conversion/general/test_interfaces3.py#L28 >>>>>> >>>>>> Regards, >>>>>> Chris >>>>>> >>>>>> >>>>>> >>>>>> > >>>>>> > e.g. >>>>>> > >>>>>> > class Complex(object): >>>>>> > >>>>>> > def __init__(self, width): >>>>>> > maxval = pow(2, width-1)-1 >>>>>> >>>>>> Note, Python is exclusive on the upper bounds, MyHDL >>>>>> follows this concept. The max bound is one more than >>>>>> the max value. >>>>>> >>>>>> (python exclusive upper bound) >>>>>> http://stackoverflow.com/a/11364711/760977 >>>>>> >>>>>> Regards, >>>>>> Chris >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> One dashboard for servers and applications across >>>>>> Physical-Virtual-Cloud >>>>>> Widest out-of-the-box monitoring support with 50+ applications >>>>>> Performance metrics, stats and reports that give you Actionable >>>>>> Insights >>>>>> Deep dive visibility with transaction tracing using APM Insight. >>>>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y >>>>>> _______________________________________________ >>>>>> myhdl-list mailing list >>>>>> myh...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/myhdl-list >>>>>> >>>>> >>>>> >>>> >>> >> >> >> -- >> Sent from Gmail Mobile >> >> >> ------------------------------------------------------------------------------ >> One dashboard for servers and applications across Physical-Virtual-Cloud >> Widest out-of-the-box monitoring support with 50+ applications >> Performance metrics, stats and reports that give you Actionable Insights >> Deep dive visibility with transaction tracing using APM Insight. >> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y >> _______________________________________________ >> myhdl-list mailing list >> myh...@li... >> https://lists.sourceforge.net/lists/listinfo/myhdl-list >> >> > |