URL
https://opencores.org/ocsvn/xulalx25soc/xulalx25soc/trunk
Subversion Repositories xulalx25soc
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 62 to Rev 63
- ↔ Reverse comparison
Rev 62 → Rev 63
/xulalx25soc/trunk/rtl/wbpwmaudio.v
82,8 → 82,8
i_wb_cyc, i_wb_stb, i_wb_we, i_wb_addr, i_wb_data, |
o_wb_ack, o_wb_stall, o_wb_data, |
o_pwm, o_int); |
parameter DEFAULT_RELOAD = 16'd1814, // about 44.1 kHz @ 80MHz |
//DEFAULT_RELOAD = 16'd2268,//about 44.1 kHz @ 100MHz |
parameter DEFAULT_RELOAD = 17'd1814, // about 44.1 kHz @ 80MHz |
//DEFAULT_RELOAD = 17'd2268,//about 44.1 kHz @ 100MHz |
VARIABLE_RATE=0, |
TIMING_BITS=17; |
input i_clk; |
114,10 → 114,14
assign w_reload_value = DEFAULT_RELOAD; |
end endgenerate |
|
reg ztimer; |
reg [(TIMING_BITS-1):0] timer; |
initial timer = DEFAULT_RELOAD; |
initial ztimer= 1'b0; |
always @(posedge i_clk) |
if (timer == 0) |
ztimer <= (timer == { {(TIMING_BITS-1){1'b0}}, 1'b1 }); |
always @(posedge i_clk) |
if (ztimer) |
timer <= w_reload_value; |
else |
timer <= timer - {{(TIMING_BITS-1){1'b0}},1'b1}; |
124,7 → 128,7
|
reg [15:0] sample_out; |
always @(posedge i_clk) |
if (timer == 0) |
if (ztimer) |
sample_out <= next_sample; |
|
|
140,7 → 144,7
// internally to binary offset |
next_sample <= { ~i_wb_data[15], i_wb_data[14:0] }; |
next_valid <= 1'b1; |
end else if (timer == 0) |
end else if (ztimer) |
next_valid <= 1'b0; |
|
initial o_int = 1'b0; |