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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [camera_link/] [src/] [channel_link.v] - Blame information for rev 27

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 qaztronic
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// Copyright (C) 2013 Authors and OPENCORES.ORG                 ////
4
////                                                              ////
5
//// This source file may be used and distributed without         ////
6
//// restriction provided that this copyright statement is not    ////
7
//// removed from the file and that any derivative work contains  ////
8
//// the original copyright notice and the associated disclaimer. ////
9
////                                                              ////
10
//// This source file is free software; you can redistribute it   ////
11
//// and/or modify it under the terms of the GNU Lesser General   ////
12
//// Public License as published by the Free Software Foundation; ////
13
//// either version 2.1 of the License, or (at your option) any   ////
14
//// later version.                                               ////
15
////                                                              ////
16
//// This source is distributed in the hope that it will be       ////
17
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
18
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
19
//// PURPOSE.  See the GNU Lesser General Public License for more ////
20
//// details.                                                     ////
21
////                                                              ////
22
//// You should have received a copy of the GNU Lesser General    ////
23
//// Public License along with this source; if not, download it   ////
24
//// from http://www.opencores.org/lgpl.shtml                     ////
25
////                                                              ////
26
//////////////////////////////////////////////////////////////////////
27
 
28
 
29
module channel_link
30
(
31
    input               clk_in,
32
    input       [3:0]   data_in,
33
    output  reg [27:0]  data_out,
34
 
35
    input               reset
36
);
37
 
38
  // --------------------------------------------------------------------
39
  //
40
 
41
  wire [3:0]  clk_7x_index;
42
  wire        clkout_7x;
43
 
44
  camera_link_clk i_camera_link_clk
45
  (
46
    .clk_in(clk_in),
47
 
48
    .clk_7x_index(clk_7x_index),
49
    .clk_out_7x(clkout_7x),
50
    .clock_good(),
51
 
52
    .reset(reset)
53
  );
54
 
55
 
56
  // --------------------------------------------------------------------
57
  //
58
  reg payload [6:0] [3:0];
59
 
60
  always @(negedge clkout_7x)
61
    begin
62
      payload[clk_7x_index][0] <= data_in[0];
63
      payload[clk_7x_index][1] <= data_in[1];
64
      payload[clk_7x_index][2] <= data_in[2];
65
      payload[clk_7x_index][3] <= data_in[3];
66
    end
67
 
68
 
69
  // --------------------------------------------------------------------
70
  //
71
  always @(posedge clkout_7x)
72
    if( clk_7x_index == 6 )
73
      begin
74
        data_out[0]   <= payload[6][0];
75
        data_out[1]   <= payload[5][0];
76
        data_out[2]   <= payload[4][0];
77
        data_out[3]   <= payload[3][0];
78
        data_out[4]   <= payload[2][0];
79
        data_out[6]   <= payload[1][0];
80
        data_out[7]   <= payload[0][0];
81
 
82
        data_out[8]   <= payload[6][1];
83
        data_out[9]   <= payload[5][1];
84
        data_out[12]  <= payload[4][1];
85
        data_out[13]  <= payload[3][1];
86
        data_out[14]  <= payload[2][1];
87
        data_out[15]  <= payload[1][1];
88
        data_out[18]  <= payload[0][1];
89
 
90
        data_out[19]  <= payload[6][2];
91
        data_out[20]  <= payload[5][2];
92
        data_out[21]  <= payload[4][2];
93
        data_out[22]  <= payload[3][2];
94
        data_out[24]  <= payload[2][2];
95
        data_out[25]  <= payload[1][2];
96
        data_out[26]  <= payload[0][2];
97
 
98
        data_out[27]  <= payload[6][3];
99
        data_out[5]   <= payload[5][3];
100
        data_out[10]  <= payload[4][3];
101
        data_out[11]  <= payload[3][3];
102
        data_out[16]  <= payload[2][3];
103
        data_out[17]  <= payload[1][3];
104
        data_out[23]  <= payload[0][3];
105
      end
106
 
107
 
108
endmodule
109
 
110
 
111
 

powered by: WebSVN 2.1.0

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