T
thomasc
Guest
Hi,
I got two error messages while compiling the code below. It says:
# ** Error: D:/My_Projects/......./SaXSb.v(35): near '=': expecting:
IDENT
# ** Error: D:/My_Projects/......./SaXSb.v(37): near '=': expecting:
IDENT
'exp_elem' and 'alpha_elemd' are other modules in the same project and
they have passed testbenches. Anyone see a problem in the code below?
Please let me know. Thanks much in advance!.
=============================================
module SaXSb (Sx_val, Sx_exp, Sa, Sb);
input [7:0] Sa, Sb;
output [7:0] Sx_val, Sx_exp;
reg [7:0] Sx_val, Sx_exp;
reg [7:0] Sa_temp, Sb_temp;
parameter mask = 8'h0F;
zero_check (Sa, Sb, Sx_val, Sx_exp);
task zero_check (input [7:0] a, b, inout reg [7:0] x_val, x_exp);
begin
if ((a==0)||(b==0)) begin
Sx_val = 8'h00;
Sx_exp = 8'h10;//if a==0 and b==0, Sx_val and
disable SaXSb; // Sx-exp values should not be
// modified by the codes below
end //if
end //begin
endtask
exp_elem E1 (.exp_val(Sa_temp), .index(Sa));
exp_elem E2 (.exp_val(Sb_temp), .index(Sb));
wraparound_check (Sa_temp);
task wraparound_check (inout [7:0] a_temp);
begin
if (a_temp >= 15) a_temp = a_temp+1;
end
endtask
Sa_temp = Sa_temp & mask; // mask out unnecessary 4 MSB's
alpha_elem A1 (.alpha_val(Sb_temp), .index(Sa_temp));
Sx_val = Sb_temp;
Sx_exp = Sa_temp;
endmodule
I got two error messages while compiling the code below. It says:
# ** Error: D:/My_Projects/......./SaXSb.v(35): near '=': expecting:
IDENT
# ** Error: D:/My_Projects/......./SaXSb.v(37): near '=': expecting:
IDENT
'exp_elem' and 'alpha_elemd' are other modules in the same project and
they have passed testbenches. Anyone see a problem in the code below?
Please let me know. Thanks much in advance!.
=============================================
module SaXSb (Sx_val, Sx_exp, Sa, Sb);
input [7:0] Sa, Sb;
output [7:0] Sx_val, Sx_exp;
reg [7:0] Sx_val, Sx_exp;
reg [7:0] Sa_temp, Sb_temp;
parameter mask = 8'h0F;
zero_check (Sa, Sb, Sx_val, Sx_exp);
task zero_check (input [7:0] a, b, inout reg [7:0] x_val, x_exp);
begin
if ((a==0)||(b==0)) begin
Sx_val = 8'h00;
Sx_exp = 8'h10;//if a==0 and b==0, Sx_val and
disable SaXSb; // Sx-exp values should not be
// modified by the codes below
end //if
end //begin
endtask
exp_elem E1 (.exp_val(Sa_temp), .index(Sa));
exp_elem E2 (.exp_val(Sb_temp), .index(Sb));
wraparound_check (Sa_temp);
task wraparound_check (inout [7:0] a_temp);
begin
if (a_temp >= 15) a_temp = a_temp+1;
end
endtask
Sa_temp = Sa_temp & mask; // mask out unnecessary 4 MSB's
alpha_elem A1 (.alpha_val(Sb_temp), .index(Sa_temp));
Sx_val = Sb_temp;
Sx_exp = Sa_temp;
endmodule