Skip to content

Commit

Permalink
Eliminate multiple edge sensitive triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarDevAchar authored Aug 20, 2024
1 parent a6c46a4 commit 178ecda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/audio_engine.v
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module audio_engine(
wire [6:0] seq_hp;

reg [17:0] counter;
always @(posedge clk or negedge rst_n) begin
always @(posedge clk) begin
if (~rst_n)
counter <= 18'd0;
else
Expand All @@ -107,7 +107,7 @@ module audio_engine(
assign synth_clk = counter[10];
assign seq_clk = counter[17];

always @(posedge seq_clk or negedge rst_n) begin
always @(posedge seq_clk) begin
if (~rst_n) begin
seq_ctr <= 5'd0;
seq_time <= 7'd0;
Expand Down
4 changes: 2 additions & 2 deletions src/freq_synth.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ module freq_synth(

reg audio_reg;
reg [6:0] hp_ctr;
always @ (posedge synth_clk or negedge rst_n) begin
always @ (posedge synth_clk) begin
if (~active | ~rst_n) begin
audio_reg <= 1'd0;
hp_ctr <= 7'd1;
end else begin
if (hp_ctr == hp) begin
hp_ctr <= 1'd1;
hp_ctr <= 7'd1;
audio_reg <= ~audio_reg;
end else
hp_ctr <= hp_ctr + 1'd1;
Expand Down

0 comments on commit 178ecda

Please sign in to comment.