Pattern method for an addaccu
def Pattern(self):
# initialisation
pat = PatWrite(self._name+'.pat',self)
# declaration of ports
pat.declar(self.ck, 'B')
pat.declar(self.load, 'B')
pat.declar(self.input, 'X')
pat.declar(self.output, 'X')
pat.declar(self.vdd, 'B')
pat.declar(self.vss, 'B')
# use of pat.declar_interface(self) has the same effect
# description beginning
pat.pattern_begin()
# affect vdd and vss values
pat.affect_int(self.vdd,1)
pat.affect_int(self.vss,0)
# first pattern : load an initial value
pat.affect_int(self.input,5)
pat.affect_int(self.load,1)
pat.affect_int(self.ck,0)
# add the pattern in the pattern file
pat.addpat()
# compute next event
pat.affect_int(self.ck,1)
pat.addpat()
# compute 22 cycle of accumulation
pat.affect_int(self.load,0)
for i in range(1,22):
pat.affect_int(self.ck,0)
pat.addpat()
pat.affect_int(self.ck,1)
pat.affect_int(self.output,i+5)
pat.addpat()
# end of the description
pat.pattern_end()