In reply to hvalec:
You are making assignments to a_reg and data_reg in successive NBA regions because you are using different posedge events. Remember that each event region may create events in other regions and will keep looping back to earlier regions until they are empty of events.
Your first forever loop waits for @(posedge clk) in the Active region and schedules assignments to a_reg in an NBA region. After the Active region is empty, we advance to the NBA region where the update to a_reg happens. That schedules the @(posedge a_reg) to resume in the Active region, as well as scheduling the continuous assign statements to revaluate.
Once the NBA region is empty, we go back to the Active region and evaluate the assign statements, update their values and if there is a posedge of a_reg, resume that process. That schedules assignments to data_reg in the NBA region. After the Active region is empty, we advance to another NBA region where the update to data_reg happens. That schedules the continuous assign statements to revaluate for the second time in another Active region. It is between these two evaluations where the glitch happens.
To avoid glitchy behavior, I suggestion only using @(posedge/negedge clk) and no other edges of any other signals. Instead of
@(posedge a_reg)
use
@(posedge clk iff a_reg)