+ rxstate <= (rxcurlength == 0) ? 2'b00 : 2'b10;
+ odata <= rxcurlength[7:0];
+ rxcoreaddr <= 0;
+ end
+ 2'b10: begin
+ odata <= rxcoredata;
+ if (rxcoreaddr == (rxcurlength - 1)) begin
+ rxstate <= 2'b11;
+ rxclear <= 1;
+ end else
+ rxcoreaddr <= rxcoreaddr + 1;
+ end
+ endcase
+ end else if (rxstate == 2'b11 || rxclear) begin
+ rxstate <= 2'b00;
+ rxclear <= 0;
+ end else if (wr && addr == `ADDR_ETH) begin
+ case(txstate)
+ 2'b00: begin
+ txlength[10:8] <= data[2:0];
+ txstate <= 2'b01;
+ end
+ 2'b01: begin
+ txlength[7:0] <= data[7:0];
+ txstate <= 2'b10;
+ txwraddr <= 0;