Skip to content

Commit

Permalink
Sig Gen responds with result on first handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiranth Siddappa committed Apr 13, 2019
1 parent e1ab566 commit 484c0be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sig_gen.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ module {{ sig_gen_name }} #(parameter phase_bits = 32,
end

always @(posedge clk) begin
if (m_axis_data_tready & freq_step_set) begin
if (m_axis_data_tready & m_axis_freq_step_tvalid) begin
phase <= phase + freq_step;
phase_4 <= phase_4 + freq_step;
end
else if (m_axis_data_tready & freq_step_set) begin
phase <= phase + freq_step_buff;
phase_4 <= phase_4 + freq_step_buff;
end
Expand All @@ -48,7 +52,7 @@ module {{ sig_gen_name }} #(parameter phase_bits = 32,
end

always @(posedge clk) begin
if (freq_step_set) begin
if (freq_step_set | m_axis_freq_step_tvalid) begin
sine <= lut[phase[phase_bits - 1:phase_bits - n_bits - 1]];
cosine <= lut[phase_4[phase_bits - 1:phase_bits - n_bits - 1]];
s_axis_data_tvalid <= 1'b1;
Expand Down

0 comments on commit 484c0be

Please sign in to comment.