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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [coaxpress/] [cx_decoder.v] - Blame information for rev 31

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
7
  cx_decoder
8
  #(
9
    parameter LOG_LEVEL      = 3
10
  )
11
  (
12
    input data_in
13
  );
14
 
15
  // --------------------------------------------------------------------
16
  //
17
  wire  [9:0] data_out;
18
  wire        clock;
19
  wire        strobe;
20
 
21
  cx_bit_align
22
    i_cx_bit_align
23
    (
24
      .data_in(data_in),
25
      .data_out(data_out),
26
      .clock(clock),
27
      .strobe(strobe),
28
      .data_sent_lsb( 1'b1 ),
29
      .reset( 1'b0 )
30
    );
31
 
32
 
33
  // --------------------------------------------------------------------
34
  //
35
  reg         dispin = 0;
36
  wire  [8:0] dataout;
37
  reg   [7:0] dataout_r;
38
  reg         k_code;
39
  wire        dispout;
40
  wire        code_err;
41
  reg         code_err_r;
42
  wire        disp_err;
43
  reg         disp_err_r;
44
 
45
  decode_8b10b
46
    i_decode_8b10b
47
    (
48
      .datain(data_out),
49
      .dispin(dispin),
50
      .dataout(dataout),
51
      .dispout(dispout),
52
      .code_err(code_err),
53
      .disp_err(disp_err)
54
    ) ;
55
 
56
 
57
  // --------------------------------------------------------------------
58
  //
59
  always @( negedge strobe )
60
    begin
61
      dispin              <= dispout;
62
      {k_code, dataout_r} <= dataout;
63
      code_err_r          <= code_err;
64
      disp_err_r          <= disp_err;
65
    end
66
 
67
 
68
  // --------------------------------------------------------------------
69
  //
70
  wire [4:0]  code_5b_6b  = dataout_r[4:0];
71
  wire [2:0]  code_3b_4b  = dataout_r[7:5];
72
 
73
  wire [7:0]  data_8b     = k_code ? 8'hxx : dataout_r;
74
 
75
  always @( negedge strobe )
76
    if( LOG_LEVEL >= 4 & k_code )
77
      $display( "#|# %15.t | cx_decoder: K code - K.%d.%d", $time, code_5b_6b, code_3b_4b );
78
 
79
  always @( negedge strobe )
80
    if( LOG_LEVEL >= 4 & ~k_code )
81
      $display( "#|# %15.t | cx_decoder: D code - D.%d.%d", $time, code_5b_6b, code_3b_4b );
82
 
83
 
84
endmodule
85
 
86
 
87
 

powered by: WebSVN 2.1.0

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