From Python to silicon

This is an old revision of the document!

    def stimulus():
        The following is a basic testbench to stimulate the CIC filter
        and create some plots.
        ysave = [0.0] * Nfft
        favg  = np.zeros(Nfft)
        xfavg = np.zeros(Nfft)
        xs    = np.zeros(Nfft)
        yield clk.posedge = True
        yield delay(10) = False
        yield delay(10)
        for ii in range(Nloops):
            for jj in range(Nfft):
                xs[jj] = float(x)/L
                if dvo:
                    if y == 0:
                        #Prevent any log(0) errors, startup zeros
                        ysave[jj] = 10.0**-10
                        ysave[jj] = float(y._val)/L  # Undo fix-point
                yield clk.negedge
            favg = favg + abs(fft(ysave, Nfft)) / Nfft
            xfavg = xfavg + abs(fft(xs))/Nfft
        favg = favg / Nloops
        xfavg = xfavg / Nloops
projects/gcictestbench.1217484287.txt.gz · Last modified: 2008/07/31 06:04 by cfelton
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki