Re: [myhdl-list] Driving constants
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2011-09-06 13:39:16
|
On 09/06/2011 02:27 PM, Sébastien Bourdeauducq wrote: > On 09/06/2011 02:26 PM, Jan Decaluwe wrote: >> On 09/05/2011 10:48 AM, Sébastien Bourdeauducq wrote: >>> On 09/05/2011 10:01 AM, Jan Decaluwe wrote: >>>> What would probably work is if such a method returns >>>> an empty list, explicitly indicating that it has no >>>> generators to contribute. >>> >>> Then how will MyHDL get the constant values to use, if all it gets from >>> the method is an empty list? >> >> From the initial value of the signals. > > And how do I set it? > > The signals are created by the __init__ method of the parent class. I > could of course add parameters to this __init__ method to define the > initial value of the signals, but it's quite messy and inelegant. No, just use overloading, it works for constructors also. I infer that some signals may have constant values that are different depending on the subclass. (I find that strange, because I would assume that the default initial value in a protocol is always the same. But I don't know your application of course.) In such a case, I would definitely want to set it right to the correct value at construction time. -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com |