Re: [myhdl-list] Interfaces in Interfaces
Brought to you by:
jandecaluwe
From: Ben R. <be...@re...> - 2015-05-05 16:35:56
|
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 >> > > |