FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-03-2005, 11:14 AM
thomasc
Guest
 
Posts: n/a
Default 'expecting IDENT' near an identifier?

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


Reply With Quote
  #2 (permalink)  
Old 03-03-2005, 01:46 PM
Jim Wu
Guest
 
Posts: n/a
Default Re: 'expecting IDENT' near an identifier?


"thomasc" <[email protected]> wrote in message
news:[email protected] lkaboutprogramming.com...
> 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!.


Grab a reference book or LRM and take a look at the section on "assignment".

HTH,
Jim
[email protected] (remove capital letters)
http://www.geocities.com/jimwu88/chips


>
> =============================================
>
> 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
>
>



Reply With Quote
  #3 (permalink)  
Old 03-03-2005, 09:43 PM
MysticSage
Guest
 
Posts: n/a
Default Re: 'expecting IDENT' near an identifier?

Yep... look at LRM... anyway

any assignment outside "procedural block", should have "assign" in
front as in

assign x = y;

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDENT error andy Verilog 2 02-25-2004 10:00 AM


All times are GMT +1. The time now is 04:20 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved