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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [basal/] [src/] [gear_box/] [unbuffered_gear_box.v] - Blame information for rev 49

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

Line No. Rev Author Line
1 34 qaztronic
// --------------------------------------------------------------------
2
//
3
// --------------------------------------------------------------------
4
 
5
 
6
module
7
  unbuffered_gear_box(
8
    input       [12:0]  adc_bus,
9
    output              adc_rd_en,
10
 
11
    output reg  [7:0]   out,
12
 
13
    input               gb_en,
14
    input               clk_250,
15
    input               sys_reset
16
  );
17
 
18
 
19
  // --------------------------------------------------------------------
20
  //
21
  wire        adc_bus_bank_select;
22
  wire [3:0]  gear_select;
23
  wire        ugb_enable = gb_en;
24
 
25
  unbuffered_gear_box_fsm
26
    i_unbuffered_gear_box_fsm
27
    (
28
      .ugb_enable(ugb_enable),
29
 
30
      .adc_bus_bank_select(adc_bus_bank_select),
31
      .adc_rd_en(adc_rd_en),
32
      .gear_select(gear_select),
33
 
34
      .ugb_clock(clk_250),
35
      .ugb_reset(sys_reset)
36
    );
37
 
38
 
39
  // --------------------------------------------------------------------
40
  //
41
  reg   [12:0] adc_bus_b0_r;
42
  reg   [12:0] adc_bus_b1_r;
43
 
44
  always @( posedge clk_250 )
45
    if( ~adc_bus_bank_select )
46
        adc_bus_b0_r <= adc_bus;
47
 
48
  always @( posedge clk_250 )
49
    if( adc_bus_bank_select )
50
        adc_bus_b1_r <= adc_bus;
51
 
52
 
53
  // --------------------------------------------------------------------
54
  //  bypass mux
55
  wire  [12:0] adc_bus_b0_w = adc_bus_bank_select ? adc_bus_b0_r : adc_bus;
56
  wire  [12:0] adc_bus_b1_w = adc_bus_bank_select ? adc_bus : adc_bus_b1_r;
57
  wire  [25:0] adc_bus_mux = {adc_bus_b1_w, adc_bus_b0_w};
58
 
59
 
60
  // --------------------------------------------------------------------
61
  //  out mux
62
  always @( * )
63
    case( gear_select )
64
      4'h0:     out = adc_bus_mux[7:0];
65
      4'h1:     out = adc_bus_mux[15:8];
66
      4'h2:     out = adc_bus_mux[23:16];
67
      4'h3:     out = {adc_bus_mux[5:0],adc_bus_mux[25:24]};
68
      4'h4:     out = adc_bus_mux[13:6];
69
      4'h5:     out = adc_bus_mux[21:14];
70
      4'h6:     out = {adc_bus_mux[3:0],adc_bus_mux[25:22]};
71
      4'h7:     out = adc_bus_mux[11:4];
72
      4'h8:     out = adc_bus_mux[19:12];
73
      4'h9:     out = {adc_bus_mux[1:0],adc_bus_mux[25:20]};
74
      4'ha:     out = adc_bus_mux[9:2];
75
      4'hb:     out = adc_bus_mux[17:10];
76
      4'hc:     out = adc_bus_mux[25:18];
77
      default:  out = adc_bus_mux[7:0];
78
    endcase
79
 
80
 
81
endmodule

powered by: WebSVN 2.1.0

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