//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Low Pass Filter FIR IP Core ////
|
//// Low Pass Filter FIR IP Core ////
|
//// ////
|
//// ////
|
//// This file is part of the LPFFIR project ////
|
//// This file is part of the LPFFIR project ////
|
//// https://opencores.org/projects/lpffir ////
|
//// https://opencores.org/projects/lpffir ////
|
//// ////
|
//// ////
|
//// Description ////
|
//// Description ////
|
//// Implementation of LPFFIR IP core according to ////
|
//// Implementation of LPFFIR IP core according to ////
|
//// LPFFIR IP core specification document. ////
|
//// LPFFIR IP core specification document. ////
|
//// ////
|
//// ////
|
//// To Do: ////
|
//// To Do: ////
|
//// - ////
|
//// - ////
|
//// ////
|
//// ////
|
//// Author: ////
|
//// Author: ////
|
//// - Vladimir Armstrong, vladimirarmstrong@opencores.org ////
|
//// - Vladimir Armstrong, vladimirarmstrong@opencores.org ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2019 Authors and OPENCORES.ORG ////
|
//// Copyright (C) 2019 Authors and OPENCORES.ORG ////
|
//// ////
|
//// ////
|
//// This source file may be used and distributed without ////
|
//// This source file may be used and distributed without ////
|
//// restriction provided that this copyright statement is not ////
|
//// restriction provided that this copyright statement is not ////
|
//// removed from the file and that any derivative work contains ////
|
//// removed from the file and that any derivative work contains ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// ////
|
//// ////
|
//// This source file is free software; you can redistribute it ////
|
//// This source file is free software; you can redistribute it ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// later version. ////
|
//// later version. ////
|
//// ////
|
//// ////
|
//// This source is distributed in the hope that it will be ////
|
//// This source is distributed in the hope that it will be ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// details. ////
|
//// details. ////
|
//// ////
|
//// ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// Public License along with this source; if not, download it ////
|
//// Public License along with this source; if not, download it ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
|
|
// SystemC Test Bench
|
// SystemC Test Bench
|
#include "systemc.h"
|
#include "systemc.h"
|
#include "verilated_vcd_sc.h"
|
#include "verilated_vcd_sc.h"
|
#include "Vbench.h"
|
#include "Vbench.h"
|
|
|
#define TRACE
|
#define TRACE
|
|
|
int sc_main(int argc, char * argv[])
|
int sc_main(int argc, char * argv[])
|
{
|
{
|
|
|
#ifdef TRACE
|
#ifdef TRACE
|
// Verilator trace file
|
// Verilator trace file
|
Verilated::traceEverOn(true);
|
Verilated::traceEverOn(true);
|
VerilatedVcdSc* tfp = new VerilatedVcdSc;
|
VerilatedVcdSc* tfp = new VerilatedVcdSc;
|
#endif
|
#endif
|
|
|
sc_time T(10,SC_NS);
|
sc_time T(10,SC_NS);
|
sc_time Tsim = T * 15 ;
|
sc_time Tsim = T * 15 ;
|
sc_clock clk("clk",T);
|
sc_clock clk("clk",T);
|
sc_signal<bool> rst("rst");
|
sc_signal<bool> rstn("rstn");
|
Vbench uut("top");
|
Vbench uut("top");
|
uut.clk (clk);
|
uut.clk (clk);
|
uut.rst(rst);
|
uut.rstn(rstn);
|
|
|
#ifdef TRACE
|
#ifdef TRACE
|
// Verilator trace file, depth
|
// Verilator trace file, depth
|
uut.trace(tfp, 10);
|
uut.trace(tfp, 10);
|
tfp->open("simu.vcd");
|
tfp->open("simu.vcd");
|
#endif
|
#endif
|
|
|
rst = 1;
|
rstn = 0;
|
sc_start(10*T);
|
sc_start(10*T);
|
rst = 0;
|
rstn = 1;
|
sc_start(Tsim);
|
sc_start(Tsim);
|
|
|
#ifdef TRACE
|
#ifdef TRACE
|
tfp->close();
|
tfp->close();
|
#endif
|
#endif
|
return 0;
|
return 0;
|
}
|
}
|
|
|