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

Subversion Repositories srdydrdy_lib

[/] [srdydrdy_lib/] [trunk/] [examples/] [bridge/] [rtl/] [distributor.v] - Blame information for rev 8

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

Line No. Rev Author Line
1 8 ghutchis
module distributor
2
  #(parameter width=8)
3
  (input         clk,
4
   input         reset,
5
 
6
   input         ptx_srdy,
7
   output        ptx_drdy,
8
   input [`PFW_SZ-1:0] ptx_data,
9
 
10
   output        p_srdy,
11
   input         p_drdy,
12
   output [1:0]  p_code,
13
   output [7:0]  p_data
14
   );
15
 
16
  wire [width-1:0]       ic_data;                // From body of template_body_1i1o.v
17
  wire                  ic_drdy;                // From sdout of sd_output.v
18
  wire                  ic_srdy;                // From body of template_body_1i1o.v
19
  wire [width-1:0]       ip_data;                // From sdin of sd_input.v
20
  wire                  ip_drdy;                // From body of template_body_1i1o.v
21
  wire                  ip_srdy;                // From sdin of sd_input.v
22
  // End of automatics
23
 
24
  sd_input #(width) sdin
25
    (/*AUTOINST*/
26
     // Outputs
27
     .c_drdy                            (c_drdy),
28
     .ip_srdy                           (ip_srdy),
29
     .ip_data                           (ip_data[width-1:0]),
30
     // Inputs
31
     .clk                               (clk),
32
     .reset                             (reset),
33
     .c_srdy                            (c_srdy),
34
     .c_data                            (c_data[width-1:0]),
35
     .ip_drdy                           (ip_drdy));
36
 
37
  template_body_1i1o #(width) body
38
    (/*AUTOINST*/
39
     // Outputs
40
     .ic_data                           (ic_data[width-1:0]),
41
     .ic_srdy                           (ic_srdy),
42
     .ip_drdy                           (ip_drdy),
43
     // Inputs
44
     .clk                               (clk),
45
     .reset                             (reset),
46
     .ic_drdy                           (ic_drdy),
47
     .ip_data                           (ip_data[width-1:0]),
48
     .ip_srdy                           (ip_srdy));
49
 
50
  sd_output #(width) sdout
51
    (/*AUTOINST*/
52
     // Outputs
53
     .ic_drdy                           (ic_drdy),
54
     .p_srdy                            (p_srdy),
55
     .p_data                            (p_data[width-1:0]),
56
     // Inputs
57
     .clk                               (clk),
58
     .reset                             (reset),
59
     .ic_srdy                           (ic_srdy),
60
     .ic_data                           (ic_data[width-1:0]),
61
     .p_drdy                            (p_drdy));
62
 
63
endmodule // template_1i1o
64
 
65
module template_body_1i1o
66
  #(parameter width=8)
67
  (input                  clk,
68
   input                  reset,
69
   output reg [width-1:0] ic_data,
70
   output reg             ic_srdy,
71
   output reg             ip_drdy,
72
   input                  ic_drdy,
73
   input [width-1:0]       ip_data,
74
   input                  ip_srdy
75
   );
76
 
77
   always @*
78
     begin
79
       ic_data = ip_data;
80
       if (ip_srdy & ip_drdy)
81
         begin
82
           ic_srdy = 1;
83
           ip_drdy = 1;
84
         end
85
       else
86
         begin
87
           ic_srdy = 0;
88
           ip_drdy = 0;
89
         end
90
     end
91
 
92
endmodule // template_body_1i1o
93
 
94
// Local Variables:
95
// verilog-library-directories:("." "../../../rtl/verilog/closure" "../../../rtl/verilog/memory" "../../../rtl/verilog/forks")
96
// End:  

powered by: WebSVN 2.1.0

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