{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Capture Buffer" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%pylab inline\n", "from caf_verilog.capture_buffer import CaptureBuffer\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "np.random.seed(27)\n", "cb = CaptureBuffer(100, name='tb_inst')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cb.gen_tb()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from caf_verilog.io_helper import read_complex_output\n", "cb_output = read_complex_output(cb.test_output_filename)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "assert len(cb_output) == len(cb.buffer_quant)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for buff_quant, cb_val in zip(cb.buffer_quant, cb_output):\n", " assert buff_quant.real == cb_val.real\n", " assert buff_quant.imag == cb_val.imag" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }