Line 1... |
Line 1... |
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Filename: hwbfly_tb.cpp
|
// Filename: hwbfly_tb.cpp
|
//
|
//
|
// Project: A Doubletime Pipelined FFT
|
// Project: A General Purpose Pipelined FFT Implementation
|
//
|
//
|
// Purpose: A test-bench for the hardware butterfly subfile of the generic
|
// Purpose: A test-bench for the hardware butterfly subfile of the generic
|
// pipelined FFT. This file may be run autonomously. If so,
|
// pipelined FFT. This file may be run autonomously. If so,
|
// the last line output will either read "SUCCESS" on success, or some
|
// the last line output will either read "SUCCESS" on success, or some
|
// other failure message otherwise.
|
// other failure message otherwise.
|
Line 13... |
Line 13... |
// test hwbfly.v
|
// test hwbfly.v
|
//
|
//
|
// Creator: Dan Gisselquist, Ph.D.
|
// Creator: Dan Gisselquist, Ph.D.
|
// Gisselquist Technology, LLC
|
// Gisselquist Technology, LLC
|
//
|
//
|
///////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Copyright (C) 2015,2018 Gisselquist Technology, LLC
|
// Copyright (C) 2015,2018 Gisselquist Technology, LLC
|
//
|
//
|
// This program is free software (firmware): you can redistribute it and/or
|
// This program is free software (firmware): you can redistribute it and/or
|
// modify it under the terms of the GNU General Public License as published
|
// modify it under the terms of the GNU General Public License as published
|
Line 28... |
Line 28... |
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// for more details.
|
// for more details.
|
//
|
//
|
// You should have received a copy of the GNU General Public License along
|
// You should have received a copy of the GNU General Public License along
|
// with this program. (It's in the $(ROOT)/doc directory, run make with no
|
// with this program. (It's in the $(ROOT)/doc directory. Run make with no
|
// target there if the PDF file isn't present.) If not, see
|
// target there if the PDF file isn't present.) If not, see
|
// <http://www.gnu.org/licenses/> for a copy.
|
// <http://www.gnu.org/licenses/> for a copy.
|
//
|
//
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
// http://www.gnu.org/licenses/gpl.html
|
// http://www.gnu.org/licenses/gpl.html
|
//
|
//
|
//
|
//
|
///////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdint.h>
|
#include <stdint.h>
|
|
|
#include "verilated.h"
|
#include "verilated.h"
|
#include "verilated_vcd_c.h"
|
#include "verilated_vcd_c.h"
|
Line 101... |
Line 101... |
m_tickcount++;
|
m_tickcount++;
|
|
|
m_lastaux = m_bfly->o_aux;
|
m_lastaux = m_bfly->o_aux;
|
m_bfly->i_clk = 0;
|
m_bfly->i_clk = 0;
|
m_bfly->eval();
|
m_bfly->eval();
|
if (m_trace) m_trace->dump((uint64_t)(10ul*m_tickcount-2));
|
if (m_trace) m_trace->dump((vluint64_t)(10ul*m_tickcount-2));
|
m_bfly->i_clk = 1;
|
m_bfly->i_clk = 1;
|
m_bfly->eval();
|
m_bfly->eval();
|
if (m_trace) m_trace->dump((uint64_t)(10ul*m_tickcount));
|
if (m_trace) m_trace->dump((vluint64_t)(10ul*m_tickcount));
|
m_bfly->i_clk = 0;
|
m_bfly->i_clk = 0;
|
m_bfly->eval();
|
m_bfly->eval();
|
if (m_trace) {
|
if (m_trace) {
|
m_trace->dump((uint64_t)(10ul*m_tickcount+5));
|
m_trace->dump((vluint64_t)(10ul*m_tickcount+5));
|
m_trace->flush();
|
m_trace->flush();
|
}
|
}
|
|
|
if ((!m_syncd)&&(m_bfly->o_aux))
|
if ((!m_syncd)&&(m_bfly->o_aux))
|
m_offset = m_addr;
|
m_offset = m_addr;
|
Line 322... |
Line 322... |
int32_t smr, smi, dfr, dfi;
|
int32_t smr, smi, dfr, dfi;
|
int rnd = 0;
|
int rnd = 0;
|
|
|
const int TESTSZ = 256;
|
const int TESTSZ = 256;
|
|
|
bfly->opentrace("hwbfly.vcd");
|
// bfly->opentrace("hwbfly.vcd");
|
|
|
bfly->reset();
|
bfly->reset();
|
|
|
bfly->test(9,0,0x4000000000l,0x7fff0000,0x7fff0000, 1);
|
bfly->test(9,0,0x4000000000l,0x7fff0000,0x7fff0000, 1);
|
bfly->test(9,1,0x4000000000l,0x7fff0000,0x80010000, 0);
|
bfly->test(9,1,0x4000000000l,0x7fff0000,0x80010000, 0);
|