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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [lpffir_uvm/] [generated_tb/] [dut/] [lpffir_core.sv] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 vladimirar
module lpffir_core (
2
                    input               clk_i,
3
                    input               rstn_i,
4
                    input               en_i,
5
                    input [15:0]        x_i,
6
                    output logic [15:0] y_o
7
                    );
8
 
9
   reg [15:0]                           x1;
10
   reg [15:0]                           x2;
11
   reg [15:0]                           x3;
12
   reg [15:0]                           x4;
13
   reg [15:0]                           x5;
14
 
15
   logic [15:0]                         h0;
16
   logic [15:0]                         h1;
17
   logic [15:0]                         h2;
18
   logic [15:0]                         h01;
19
 
20
   logic                                co0;
21
   logic                                co1;
22
   logic                                co2;
23
   logic                                co3;
24
   logic                                co4;
25
 
26
   // Linear-phase FIR structure
27
  rca rca_inst0 (.a(x_i),.b(x5),.ci(1'b0),.co(co0),.s(h0));
28
  rca rca_inst1 (.a(x1),.b(x4),.ci(1'b0),.co(co1),.s(h1));
29
  rca rca_inst2 (.a(x2),.b(x3),.ci(1'b0),.co(co2),.s(h2));
30
  rca rca_inst3 (.a(h0),.b(h1),.ci(1'b0),.co(co3),.s(h01));
31
  rca rca_inst4 (.a(h01),.b(h2),.ci(1'b0),.co(co4),.s(y_o));
32
 
33
   always_ff @(posedge clk_i or posedge rstn_i)
34
     if(!rstn_i)
35
       begin
36
          x1 <= 0;
37
          x2 <= 0;
38
          x3 <= 0;
39
          x4 <= 0;
40
          x5 <= 0;
41
       end
42
     else if (en_i)
43
       begin
44
          x1 <= x_i;
45
          x2 <= x1;
46
          x3 <= x2;
47
          x4 <= x3;
48
          x5 <= x4;
49
       end
50
 
51
endmodule

powered by: WebSVN 2.1.0

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