[PEAK] trellis question

P.J. Eby pje at telecommunity.com
Sat Jul 16 21:17:15 EDT 2011


At 11:33 PM 7/16/2011 +0200, nicky van foreest wrote:
>I wonder how trellis finds out that Sum.tot needs h.a for all the h's
>in the list. How does it know, for instance, that h.a in the list
>comprension sum( h.a for h in self.h) corresponds to a Cell? (Is
>actually h.a stored/corresponds to a Cell?)

Yes.  A trellis.attr declaration means the attribute is stored in a 
Cell instance, and reading the attribute reads the Cell, causing the 
dependency to be noticed while the 'tot' rule is being 
executed.  When the 'tot' rule is finished, Trellis looks at the read 
history and sees the list of cells to be used as the new dependency 
list for the 'tot' Cell. 



More information about the PEAK mailing list