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

Subversion Repositories srdydrdy_lib

[/] [srdydrdy_lib/] [trunk/] [env/] [verilog/] [bpdrop/] [bench_bpdrop.v] - Blame information for rev 29

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

Line No. Rev Author Line
1 27 ghutchis
`timescale 1ns/1ns
2
 
3
module bench_bpdrop;
4
 
5
  reg clk, reset;
6
 
7
  initial
8
    begin
9
      clk = 0;
10
      forever clk = #5 ~clk;
11
    end
12
 
13
  wire a_srdy, a_drdy;
14
  wire [7:0] a_data;
15
  wire       b_srdy, b_drdy;
16
 
17
  wire       fr_start, fr_end;
18
  assign fr_start = a_data[1:0] == 0;
19
  assign fr_end   = a_data[1:0] == 3;
20
 
21
  sd_seq_gen #(.width(8)) sgen
22
    (
23
     // Outputs
24
     .p_srdy                            (a_srdy),
25
     .p_data                            (a_data[7:0]),
26
     // Inputs
27
     .clk                               (clk),
28
     .reset                             (reset),
29
     .p_drdy                            (a_drdy));
30
 
31
  sd_bpdrop #(.cnt_sz(4)) bpdrop
32
    (
33
     // Outputs
34
     .nc_drdy                           (a_drdy),
35
     .np_srdy                           (b_srdy),
36
     // Inputs
37
     .clk                               (clk),
38
     .reset                             (reset),
39
     .g_max_count                       (4'd5),
40
     .c_srdy                            (a_srdy),
41
     .c_fr_start                        (fr_start),
42
     .c_fr_end                          (fr_end),
43
     .p_drdy                            (b_drdy));
44
 
45
  sd_seq_check #(.width(8)) scheck
46
    (
47
     // Outputs
48
     .c_drdy                            (b_drdy),
49
     // Inputs
50
     .clk                               (clk),
51
     .reset                             (reset),
52
     .c_srdy                            (b_srdy),
53
     .c_data                            (a_data[7:0]));
54
 
55
  initial
56
    begin
57
`ifdef VCS
58
      $vcdpluson;
59
`else
60
      $dumpfile("bench_bpdrop.vcd");
61
      $dumpvars;
62
`endif
63
      reset = 1;
64
      repeat (10) @(negedge clk);
65
      reset = 0;
66
 
67
      // initial flow control to drop
68
      scheck.drdy_pat = 8'h1;
69
      sgen.send(64);
70
 
71
      // still drop
72
      scheck.drdy_pat = 8'h7;
73
      sgen.send(64);
74
 
75
      // pass
76
      scheck.drdy_pat = 8'h88;
77
      sgen.send(64);
78
 
79
      #1000;
80
      $finish;
81
    end
82
 
83
 
84
endmodule // bench_bpdrop
85
// Local Variables:
86
// verilog-library-directories:("." "../../../rtl/verilog/utility/" "../common")
87
// End:

powered by: WebSVN 2.1.0

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