代码:
<textarea cols="87" rows="15" name="code" class="c-sharp">reg[31:0] wait_count; reg[31:0] max_wait_count; //times/1us always @(posedge clk1) max_wait_count <= {sendTickH, sendTickL}; reg clk1us; parameter US_COUNT_OF_25M = 12500; reg[15:0] clk1us_count; always @(posedge clk25 or negedge gblnrst) begin if(!gblnrst) begin clk1us_count <= 16'd0; clk1us <= 1'b0; end else begin if(clk1us_count < US_COUNT_OF_25M) clk1us_count <= clk1us_count + 16'd1; else begin clk1us_count <= 16'd0; clk1us <= ~clk1us; end end end always @(posedge clk1us) begin if(fiber_state2 < FIBER_CALC) beg