Skip to content

Commit 2bcf482

Browse files
committed
Test with larger LUT (utilzation was at around 50%)
1 parent c2dd34a commit 2bcf482

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/sinegen1.v

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,23 @@ module sinegen1 (
3030
input [1:0] i_scale
3131
);
3232

33-
reg [4:0] read_ptr_r;
33+
reg [5:0] read_ptr_r;
3434
reg [15:0] ctr_r;
3535
reg ctr_msb_last_r;
3636
wire [3:0] scale_w;
3737

38-
// this bitpattern is a 16b UINT sine with a period of 32 samples with
38+
// this bitpattern is a 16b UINT sine with a period of 64 samples with
3939
// 90% amplitude and an offset of 0x8000
4040
/* verilator lint_off LITENDIAN */
41-
localparam [0:(32*16)-1] sin_const = {
42-
16'h8000,16'h9679,16'hAC16,16'hC000,16'hD175,16'hDFC9,16'hEA6E,16'hF0FD,
43-
16'hF333,16'hF0FD,16'hEA6E,16'hDFC9,16'hD175,16'hC000,16'hAC16,16'h9679,
44-
16'h8000,16'h6987,16'h53EA,16'h4000,16'h2E8B,16'h2037,16'h1592,16'h0F03,
45-
16'h0CCD,16'h0F03,16'h1592,16'h2037,16'h2E8B,16'h4000,16'h53EA,16'h6987
41+
localparam [0:(64*16)-1] sin_const = {
42+
16'h8000,16'h8B4B,16'h9679,16'hA171,16'hAC16,16'hB64E,16'hC000,16'hC915,
43+
16'hD175,16'hD90D,16'hDFC9,16'hE599,16'hEA6E,16'hEE3D,16'hF0FD,16'hF2A5,
44+
16'hF333,16'hF2A5,16'hF0FD,16'hEE3D,16'hEA6E,16'hE599,16'hDFC9,16'hD90D,
45+
16'hD175,16'hC915,16'hC000,16'hB64E,16'hAC16,16'hA171,16'h9679,16'h8B4B,
46+
16'h8000,16'h74B5,16'h6987,16'h5E8F,16'h53EA,16'h49B2,16'h4000,16'h36EB,
47+
16'h2E8B,16'h26F3,16'h2037,16'h1A67,16'h1592,16'h11C3,16'h0F03,16'h0D5B,
48+
16'h0CCD,16'h0D5B,16'h0F03,16'h11C3,16'h1592,16'h1A67,16'h2037,16'h26F3,
49+
16'h2E8B,16'h36EB,16'h4000,16'h49B2,16'h53EA,16'h5E8F,16'h6987,16'h74B5
4650
};
4751
/* verilator lint_on LITENDIAN */
4852

@@ -53,7 +57,7 @@ module sinegen1 (
5357
always @(posedge i_clk or negedge i_rst_n) begin
5458
if (i_rst_n === 1'b0) begin
5559
// reset all registers
56-
read_ptr_r <= 5'b0;
60+
read_ptr_r <= 6'b0;
5761
ctr_r <= 16'b0;
5862
ctr_msb_last_r <= 1'b0;
5963
end else begin

0 commit comments

Comments
 (0)