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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [bench/] [verilog/] [bench.sv] - Blame information for rev 7

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
// Verilog test bench
46
module bench (
47
              input clk,
48 7 vladimirar
              input rstn
49 2 vladimirar
              );
50
 
51 7 vladimirar
   logic            rx_tready;
52
   logic            tx_tlast;
53
   logic            tx_tvalid;
54 2 vladimirar
   logic [15:0]     in = (count == 1) ? 1:0;
55
   logic [15:0]     out;
56
   reg [31:0]       count;
57
 
58 7 vladimirar
   always_ff @(posedge clk or posedge rstn)
59
     if (!rstn)
60 2 vladimirar
       count <= 0;
61
     else
62
       count <= count + 1;
63
 
64
   // unit under test(UUT)
65 7 vladimirar
   lpffir_axis lpffir_axis (
66
                            .aclk_i(clk),
67
                            .aresetn_i(rstn),
68
                            .rx_tlast_i(0),
69
                            .rx_tvalid_i(1),
70
                            .rx_tready_o(rx_tready),
71
                            .rx_tdate_i(in),
72
                            .tx_tlast_o(tx_tlast),
73
                            .tx_tvalid_o(tx_tvalid),
74
                            .tx_tready_i(1),
75
                            .tx_tdate_o(out)
76
                            );
77 2 vladimirar
 
78
   // Test case log
79
   initial begin
80
      $display("Test Case #1:");
81
      $display("Check impulse response of low-pass filter.");
82
      $display("RTL simulation results:");
83
      $display("Input Output");
84
      $display("----- ------");
85
   end
86
 
87 7 vladimirar
   always_ff @(posedge clk or posedge rstn)
88
     if(rstn)
89 2 vladimirar
       $display("  %0d     %0d", in, out);
90
 
91
endmodule

powered by: WebSVN 2.1.0

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