Capture BufferΒΆ

[1]:
%pylab inline
from caf_verilog.capture_buffer import CaptureBuffer
import numpy as np
%pylab is deprecated, use %matplotlib inline and import the required libraries.
Populating the interactive namespace from numpy and matplotlib
[2]:
np.random.seed(27)
cb = CaptureBuffer(100, name='tb_inst')
[3]:
cb.gen_tb()
[4]:
from caf_verilog.io_helper import read_complex_output
cb_output = read_complex_output(cb.test_output_filename)
[5]:
assert len(cb_output) == len(cb.buffer_quant)
[6]:
for buff_quant, cb_val in zip(cb.buffer_quant, cb_output):
    assert buff_quant.real == cb_val.real
    assert buff_quant.imag == cb_val.imag