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

Subversion Repositories qaz_libs

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

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

Line No. Rev Author Line
1 2 qaztronic
//
2
//
3
//
4
 
5
 
6
module channel_link
7
(
8
    input               clk_in,
9
    input       [3:0]   data_in,
10
    output  reg [27:0]  data_out,
11
 
12
    input               reset
13
);
14
 
15
  // --------------------------------------------------------------------
16
  //
17
 
18
  wire [3:0]  clk_7x_index;
19
  wire        clkout_7x;
20
 
21
  camera_link_clk i_camera_link_clk
22
  (
23
    .clk_in(clk_in),
24
 
25
    .clk_7x_index(clk_7x_index),
26
    .clk_out_7x(clkout_7x),
27
    .clock_good(),
28
 
29
    .reset(reset)
30
  );
31
 
32
 
33
  // --------------------------------------------------------------------
34
  //
35
  reg payload [6:0] [3:0];
36
 
37
  always @(negedge clkout_7x)
38
    begin
39
      payload[clk_7x_index][0] <= data_in[0];
40
      payload[clk_7x_index][1] <= data_in[1];
41
      payload[clk_7x_index][2] <= data_in[2];
42
      payload[clk_7x_index][3] <= data_in[3];
43
    end
44
 
45
 
46
  // --------------------------------------------------------------------
47
  //
48
  always @(posedge clkout_7x)
49
    if( clk_7x_index == 6 )
50
      begin
51
        data_out[0]   <= payload[6][0];
52
        data_out[1]   <= payload[5][0];
53
        data_out[2]   <= payload[4][0];
54
        data_out[3]   <= payload[3][0];
55
        data_out[4]   <= payload[2][0];
56
        data_out[6]   <= payload[1][0];
57
        data_out[7]   <= payload[0][0];
58
 
59
        data_out[8]   <= payload[6][1];
60
        data_out[9]   <= payload[5][1];
61
        data_out[12]  <= payload[4][1];
62
        data_out[13]  <= payload[3][1];
63
        data_out[14]  <= payload[2][1];
64
        data_out[15]  <= payload[1][1];
65
        data_out[18]  <= payload[0][1];
66
 
67
        data_out[19]  <= payload[6][2];
68
        data_out[20]  <= payload[5][2];
69
        data_out[21]  <= payload[4][2];
70
        data_out[22]  <= payload[3][2];
71
        data_out[24]  <= payload[2][2];
72
        data_out[25]  <= payload[1][2];
73
        data_out[26]  <= payload[0][2];
74
 
75
        data_out[27]  <= payload[6][3];
76
        data_out[5]   <= payload[5][3];
77
        data_out[10]  <= payload[4][3];
78
        data_out[11]  <= payload[3][3];
79
        data_out[16]  <= payload[2][3];
80
        data_out[17]  <= payload[1][3];
81
        data_out[23]  <= payload[0][3];
82
      end
83
 
84
 
85
endmodule
86
 
87
 
88
 

powered by: WebSVN 2.1.0

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