I tried several things, but I keep getting this error in EDA playground. How do I fix it? I'm trying to implement a system to add, subtract, etc., and get flags for ADDS and SUBS. I tried creating a reg variable and then assigning the flags to that, but that didn't work. The code runs when I don't use any flags in my case statements. Here is my code and the error below:
module alu(A,B, ALU_Sel,ALU_Out,Carry,Zero,Overflow,Negative,ALU_Result);
input wire[63:0] A,B; // ALU 64-bit Inputs
input wire [3:0] ALU_Sel;// ALU Selection
reg C;
reg Z;
reg O;
reg N;
output reg [63:0] ALU_Out; // ALU 8-bit Output
output reg Carry; // Carry Out Flag
output reg Zero;
output reg Overflow;
output reg Negative;
output reg [63:0] ALU_Result;
assign ALU_Out = ALU_Result; // ALU out
assign Carry=C;
assign Zero = Z;
assign Overflow = O;
asssign Negative = N;
always @(*)
begin
Carry=0;
Zero=0;
Overflow=0;
Negative=0;
case(ALU_Sel[3:0])
4'b0000: //AND -h0
ALU_Result = A & B;
C=1;
4'b0010: //ADD -h2
ALU_Result = A + B;
4'b0011: //ADDS -h3
ALU_Result = A + B;
//CREATE FLAGS HERE
//reg Carry = 1;
4'b1100: //EOR -h12
ALU_Result =A^B;
4'b0110: //SUB -h6
ALU_Result = A-B;
4'b0111: //SUBS -h7
ALU_Result = A-B;
//CREATE FLAGS HERE
4'b1001: //LSL -h9
ALU_Result = A << B;
4'b0001: //OR -h1
ALU_Result = A | B;
endcase
end
endmodule
ERROR VCP2000 "Syntax error. Unexpected token: =." "design.sv" 20 21
ERROR VCP2000 "Syntax error. Unexpected token: =." "design.sv" 31 13
ERROR VCP2000 "Syntax error. Unexpected token: 4'b0011[_BINARY_BASE]." "design.sv" 36 18
ERROR VCP2000 "Syntax error. Unexpected token: 4'b1100[_BINARY_BASE]." "design.sv" 41 18
ERROR VCP2000 "Syntax error. Unexpected token: 4'b0110[_BINARY_BASE]." "design.sv" 44 18
ERROR VCP2000 "Syntax error. Unexpected token: 4'b0111[_BINARY_BASE]." "design.sv" 47 18
ERROR VCP2000 "Syntax error. Unexpected token: 4'b1001[_BINARY_BASE]." "design.sv" 51 18
ERROR VCP2000 "Syntax error. Unexpected token: 4'b0001[_BINARY_BASE]." "design.sv" 54 18