Line 1... |
Line 1... |
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Filename: laststage_tb.cpp
|
// Filename: laststage_tb.cpp
|
//
|
//
|
// Project: A Doubletime Pipelined FFT
|
// Project: A General Purpose Pipelined FFT Implementation
|
//
|
//
|
// Purpose: A test-bench for the laststage.v subfile of the general purpose
|
// Purpose: A test-bench for the laststage.v subfile of the general purpose
|
// 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 laststage.v
|
// test laststage.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"
|
#include "Vlaststage.h"
|
#include "Vlaststage.h"
|
|
#include "fftsize.h"
|
#include "twoc.h"
|
#include "twoc.h"
|
|
|
#define IWIDTH 16
|
#define IWIDTH 16
|
#define OWIDTH (IWIDTH+1)
|
#define OWIDTH (IWIDTH+1)
|
#define SHIFT 0
|
#define SHIFT 0
|
Line 94... |
Line 95... |
void tick(void) {
|
void tick(void) {
|
m_tickcount++;
|
m_tickcount++;
|
|
|
m_last->i_clk = 0;
|
m_last->i_clk = 0;
|
m_last->eval();
|
m_last->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_last->i_clk = 1;
|
m_last->i_clk = 1;
|
m_last->eval();
|
m_last->eval();
|
if (m_trace) m_trace->dump((uint64_t)(10ul * m_tickcount));
|
if (m_trace) m_trace->dump((vluint64_t)(10ul * m_tickcount));
|
m_last->i_clk = 0;
|
m_last->i_clk = 0;
|
m_last->eval();
|
m_last->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();
|
}
|
}
|
m_last->i_reset = 0;
|
m_last->i_reset = 0;
|
m_last->i_sync = 0;
|
m_last->i_sync = 0;
|
}
|
}
|
Line 285... |
Line 286... |
|
|
int main(int argc, char **argv, char **envp) {
|
int main(int argc, char **argv, char **envp) {
|
Verilated::commandArgs(argc, argv);
|
Verilated::commandArgs(argc, argv);
|
LASTSTAGE_TB *tb = new LASTSTAGE_TB;
|
LASTSTAGE_TB *tb = new LASTSTAGE_TB;
|
|
|
tb->opentrace("laststage.vcd");
|
// tb->opentrace("laststage.vcd");
|
tb->reset();
|
tb->reset();
|
|
|
tb->sync();
|
tb->sync();
|
|
|
tb->test( 1, 0,0,0);
|
tb->test( 1, 0,0,0);
|