Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Should the use of variables be avoided for synthesis?

Status
Not open for further replies.

arbalez

Member level 5
Joined
Jan 22, 2005
Messages
82
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
734
how initialize variable in synthesizable verilog

is it true that we have to avoid the use of variables if we want our code able to be RTLed? thus able to be synthesized?
 

silencer3

Advanced Member level 4
Joined
Jun 3, 2003
Messages
112
Helped
17
Reputation
34
Reaction score
11
Trophy points
1,298
Activity points
1,057
variables and synthesis

Variables do get synthesized. It depends on coding.

The main difference for variables comes, when u do simulation. But i feel that for synthesis, it is ok to use variables. pls do check ur RTL after synthesis for correct RTL.
 

Thomson

Full Member level 3
Joined
Oct 15, 2004
Messages
181
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
2,400
Re: variables and synthesis

Different Logic languages may have different synthesizable guidelines, please read these guidelines based on your logic language.

Here just list the two prominent logic languages VHDL and Verilog:
<1> for VHDL, variables are mainly used to infer combinatirial logics; however if you really expect, the sequential logics can be also be generated, which is not recommended.
<2> for VErilog, there are no variables concepts. only Wire or Reg can be used. Of course, you can take reg as variables when used in processes.

The best is to refer to the synthesizalbe guidelines if you have both for VHDL and Verilog.

Thomson
 

semiconductorman

Full Member level 3
Joined
Dec 18, 2004
Messages
156
Helped
23
Reputation
46
Reaction score
4
Trophy points
1,298
Activity points
1,769
Re: variables and synthesis

No that is usally not the case with most of the synthesis tools available today . The question of synthesisable or not depends on how you define / design in hdl . I am assuming that u probably are talking about vhdl here. as long as you are trying to define combo logic with variables you are prety safe. happy 'RTL'ing :)
 

arbalez

Member level 5
Joined
Jan 22, 2005
Messages
82
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
734
Re: variables and synthesis

semiconductorman said:
No that is usally not the case with most of the synthesis tools available today . The question of synthesisable or not depends on how you define / design in hdl . I am assuming that u probably are talking about vhdl here. as long as you are trying to define combo logic with variables you are prety safe. happy 'RTL'ing :)
yup. i'm using vhdl. the fact is i can synthesize my code. but got many warning messages related to the variables. most of the variable registers are stucked to GND or VCC. whenever i assigned any variables := 0, then it will stuck to GND. i've checked my synthesis' tool (quartus II) help page, but they mentioned it's whether i leave it or change it.

i think this problem makes my post-synthesis simulations fails.

should i avoid the variables initialization? or is there any other method? what is combo logic? how to define combo logic?
 

arbalez

Member level 5
Joined
Jan 22, 2005
Messages
82
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
734
Re: variables and synthesis

arbalez said:
semiconductorman said:
No that is usally not the case with most of the synthesis tools available today . The question of synthesisable or not depends on how you define / design in hdl . I am assuming that u probably are talking about vhdl here. as long as you are trying to define combo logic with variables you are prety safe. happy 'RTL'ing :)
yup. i'm using vhdl. the fact is i can synthesize my code. but got many warning messages related to the variables. most of the variable registers are stucked to GND or VCC. whenever i assigned any variables := 0, then it will stuck to GND. i'vize my code. but got many warning messages related to the e checked my synthesis' tool (qu(at)rtus II) help page, but they mentioned it's whether i leave it or change it.

i think this problem makes my post-synthesis simulations fails.

should i avoid the variables initialization? or is there any other method? what is combo logic? how to define combo logic?
finally, i realized my mistake after doing some reading. i just knew that variables and signals cannot be initialized for synthesis. i must use reset mechanism to initialize variables or signals as the code below,

Code:
if (reset = '1') then
   variablename := 0;
else
   ...
end if;
not by directly declare

Code:
begin
   variablename : integer := 0;
process (...)
...
end process;
now the synthesis process was completed without warnings of stuck-at GND, VCC or whatever. the mysteries solved. thanks all! :)
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top