Re: [myhdl-list] Interfaces in Interfaces
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2015-05-05 18:35:47
|
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... > <javascript:_e(%7B%7D,'cvml','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... >> <javascript:_e(%7B%7D,'cvml','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... >>> <javascript:_e(%7B%7D,'cvml','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... >>>> <javascript:_e(%7B%7D,'cvml','myh...@li...');> >>>> https://lists.sourceforge.net/lists/listinfo/myhdl-list >>>> >>> >>> >> > -- Sent from Gmail Mobile |