module: stop_sim_at_end_of_audio_file
description: 
timing_sensitivity: posedge clk
parameters:  int enable
inputs:  bool audio_valid, bool clk
outputs:  
classes:  
static_variables:  int audio_valid_prev
init:  
audio_valid_prev = 0;

end:  
code:  

if (audio_valid == 0 && audio_valid_prev == 1 && enable != 0)
    stop_current_alter_run = 1;

audio_valid_prev = audio_valid;
