Por lo tanto, actualmente estoy enfrentando un problema en el que romper; ¿Las declaraciones no están permitidas en verilog? ¿Hay alguna alternativa a esto? He intentado deshabilitar block_to_disable, pero eso no resolvió nada. ¿Es posible que haya una solución fácil o Verilog no pueda hacer esto? Solo pregunto porque Verilog es una derivación de C. Gracias por su tiempo y ayuda.
module prj2(input [2:0] usr, input button, output reg [6:0] stage);
//input button
reg currentState = 0;
reg tracker = 0;
reg stage_0 = 0;
reg stage_1 = 1;
reg stage_2 = 2;
reg stage_3 = 3;
reg stage_4 = 4;
reg winner = 5;
/*stage is read in binary
stage 0 = 1
stage 1 = 2
stage 2 = 4
stage 3 = 8
stage 4 = 16
stage win[5] = 32 NO STAGE WIN
*/
/*r/p/s is read in binary
0: rock = 1
1: scissors = 2
2: paper = 4
*/
always @ (button) //start of the action section
begin
case(currentState)//draw and loss are the same
/*=======================================================================================*/
0://using scissors
if(usr == 1)
begin //beat scissors so use rock
tracker <= stage_1;
currentState <= stage_1; //moved to state 1
stage <= 2; //stage_1
//disable block_to_disable;
end
else begin//don't move
tracker <= stage_0;
currentState <= stage_0; //stay in same state
stage <= 1; //stage_0
//disable block_to_disable;
end
/*=======================================================================================*/
1://using rock
if(usr == 4) begin//beat rock so use paper
tracker <= stage_2;
currentState <= stage_2; //moved to state 2
stage <= 4; //stage_2
//disable block_to_disable;
end
else begin //move back to state 1
tracker <= stage_0;
currentState <= stage_0; //go back to previous state
stage <= 1; //stage_0
//disable block_to_disable;
end
//break;
/*=======================================================================================*/
endcase //end case
end //end begin that comes after always()
endmodule //end the actual module