Re: [myhdl-list] Modules interface information
Brought to you by:
jandecaluwe
From: Oscar D. <osc...@gm...> - 2011-05-05 14:34:11
|
2011/5/5 Günter Dannoritzer <dan...@we...>: > Am 05.05.2011 15:45, schrieb Oscar Diaz: > > ... > > BTW, I did not follow in that example what I was telling you earlier > about inferring the bit width from the input signal. Suppose that I want to implement the adder in a structural way with 1-bit adders: def add1bit(a, b, carry_in, x, carry_out): ... def adder(a, b, x): assert len(a) = len(b) carry = [Signal(0) for i in range(len(a))] add_1bit_list = [ add1bit( a(i), b(i), carry(i), x(i), carry(i+1) ) for i in range(len(a)) ] ... I don't need an explicit width parameter to know how many instances of add1bit is needed, and I enforce the restriction of 'a' and 'b' to have the same width. Again, I think I should pick another better example :P > > Cheers, Guenter > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > -- Oscar Díaz Huella de clave = 904B 306C C3C2 7487 650B BFAC EDA2 B702 90E9 9964 gpg --keyserver subkeys.pgp.net --recv-keys 90E99964 Recomiendo usar OpenDocument Format para uso e intercambio de documentos http://www.spreadopendocument.org/ |