File size: 774 Bytes
0ba037b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Bit Address Generator
// Computes: effective_bit_address = base_bit_address + bit_offset
// Implementation: 64-bit Kogge-Stone parallel-prefix adder

module bit_address_generator (
  input logic clk,
  input logic rst_n,

  // Operands
  input logic [63:0] base_addr,
  input logic [63:0] bit_offset,

  // Control
  input logic enable,

  // Output
  output logic [63:0] eff_bit_addr,
  output logic carry_out
);

  import bit_accelerator_pkg::*;

  // Stage 1: Ripple-carry adder (simplified for synthesis)
  // For timing closure, use built-in + operator which synthesizes to optimized adder
  logic [64:0] sum;

  assign sum = {1'b0, base_addr} + {1'b0, bit_offset};
  assign eff_bit_addr = sum[63:0];
  assign carry_out = sum[64];

endmodule : bit_address_generator