OpenCores
URL https://opencores.org/ocsvn/lpffir/lpffir/trunk

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [bench/] [systemc/] [main.cpp] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 vladimirar
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Low Pass Filter FIR IP Core                                 ////
4
////                                                              ////
5
////  This file is part of the LPFFIR project                     ////
6
////  https://opencores.org/projects/lpffir                       ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Implementation of LPFFIR IP core according to               ////
10
////  LPFFIR IP core specification document.                      ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////  -                                                           ////
14
////                                                              ////
15
////  Author:                                                     ////
16
////  - Vladimir Armstrong, vladimirarmstrong@opencores.org       ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2019 Authors and OPENCORES.ORG                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
 
45
// SystemC Test Bench
46
#include "systemc.h"
47
#include "verilated_vcd_sc.h"
48
#include "Vbench.h"
49
 
50
#define TRACE
51
 
52
int sc_main(int argc, char * argv[])
53
{
54
 
55
#ifdef TRACE
56
  // Verilator trace file
57
  Verilated::traceEverOn(true);
58
  VerilatedVcdSc* tfp = new VerilatedVcdSc;
59
#endif
60
 
61
  sc_time T(10,SC_NS);
62
  sc_time Tsim = T * 15 ;
63
  sc_clock clk("clk",T);
64
  sc_signal<bool> rst("rst");
65
  Vbench uut("top");
66
  uut.clk (clk);
67
  uut.rst(rst);
68
 
69
#ifdef TRACE
70
  // Verilator trace file, depth
71
  uut.trace(tfp, 10);
72
  tfp->open("simu.vcd");
73
#endif
74
 
75
  rst = 1;
76
  sc_start(10*T);
77
  rst = 0;
78
  sc_start(Tsim);
79
 
80
#ifdef TRACE
81
  tfp->close();
82
#endif
83
  return 0;
84
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.