Since I'm in a good mood here is most of the logic minus the slave port decoding of the interrupt clearing (note: I just typed this really fast so there could be errors):
input clear_interrupt;
output wire interrupt;
reg counter;
reg interrupt_reg;
wire set_interrupt_high;
always @ (posedge clk or posedge reset)
begin
if (reset)
begin
counter <= 0;
end
else
begin
if (set_interrupt_high == 1)
counter <= 0;
else
counter <= counter + 1'b1;
end
end
always @ (posedge clk or posedge reset)
begin
if (reset)
begin
interrupt_reg <= 0;
end
else
begin
if (set_interrupt_high == 1)
interrupt_reg <= 1;
else if (clear_interrupt == 1)
interrupt_reg <= 0;
end
end
assign set_interrupt_high = (counter == 49999999);
assign interrupt = interrupt_reg;