def mkLed():
    m = Module('blinkled')
    width = m.Parameter('WIDTH', 8)
    clk = m.Input('CLK')
    rst = m.Input('RST')
    led = m.OutputReg('LED', width, initval=0)
    count = m.Reg('count', 32, initval=0)
    
    seq = Seq(m, 'seq', clk, rst)

    seq.add( count.inc(), cond=(count<1-1024) )
    seq.add( count(0), cond=(count>=1024-1) )
    seq.add( led.inc(), cond=(count>=1024-1) ) 
    
    #seq.make_always()
    # make_alway() is called when to_veirlog() is called.
    m.add_hook(seq.make_always, args=(), kwargs={})
    
    return m
dataset/ETHPy150Open PyHDI/veriloggen/tests/extension/seq_/hook_nested/seq_hook_nested.py/mkLed/swapped operands of `-`