@@ -30,19 +30,23 @@ module sinegen1 (
30
30
input [1 :0 ] i_scale
31
31
);
32
32
33
- reg [4 :0 ] read_ptr_r;
33
+ reg [5 :0 ] read_ptr_r;
34
34
reg [15 :0 ] ctr_r;
35
35
reg ctr_msb_last_r;
36
36
wire [3 :0 ] scale_w;
37
37
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
39
39
// 90% amplitude and an offset of 0x8000
40
40
/* 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
46
50
};
47
51
/* verilator lint_on LITENDIAN */
48
52
@@ -53,7 +57,7 @@ module sinegen1 (
53
57
always @(posedge i_clk or negedge i_rst_n) begin
54
58
if (i_rst_n === 1'b0 ) begin
55
59
// reset all registers
56
- read_ptr_r <= 5 'b0 ;
60
+ read_ptr_r <= 6 'b0 ;
57
61
ctr_r <= 16'b0 ;
58
62
ctr_msb_last_r <= 1'b0 ;
59
63
end else begin
0 commit comments