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

What are the implications of using Integer instead STD_LOG

Status
Not open for further replies.

khaila

Full Member level 2
Joined
Jan 13, 2007
Messages
121
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
2,105
in Counter RTL; it is preferable to use INTEGER'type instead of STD_LOGIC_VECTOR. why???
 

avimit

Banned
Joined
Nov 16, 2005
Messages
413
Helped
91
Reputation
182
Reaction score
23
Trophy points
1,298
Location
Fleet, UK
Activity points
0
Re: What are the implications of using Integer instead STD_L

No, I dont think so. Its always better to use 'std_logic_vector' type in counters, because
1. If you forget to put a 'range' on counter, you will have unwanted extra sized counter.
2. an integer is initialized to 0, where as a std_logic_vector is initialized to Xs. So if you forget to put a reset logic in your counter variable and it is of 'integer' type, it will show a very good green 0 value in the waveform in RTL sims. However when you do a netlist sim, you will see all Xs. So I wont recommend the use of integer in counters.
This is also one of the resons why you won't use 'boolean' type instead of 'std_logic' type. Again 'boolean' type does not have a X value.
Kr,
Avi
http://www.vlsiip.com
 

khaila

Full Member level 2
Joined
Jan 13, 2007
Messages
121
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
2,105
Re: What are the implications of using Integer instead STD_L

avimit said:
No, I dont think so. Its always better to use 'std_logic_vector' type in counters, because
1. If you forget to put a 'range' on counter, you will have unwanted extra sized counter.
2. an integer is initialized to 0, where as a std_logic_vector is initialized to Xs. So if you forget to put a reset logic in your counter variable and it is of 'integer' type, it will show a very good green 0 value in the waveform in RTL sims. However when you do a netlist sim, you will see all Xs. So I wont recommend the use of integer in counters.
This is also one of the resons why you won't use 'boolean' type instead of 'std_logic' type. Again 'boolean' type does not have a X value.
Kr,
Avi
http://www.vlsiip.com

The reasons that you mentioned upon are sensible.
But I am sure that Integer using is preferable than STD_LOGIC_VEC.
I think the reason is because Integer'type let's to use/deal with MOD'function.

Don't think so???
 

avimit

Banned
Joined
Nov 16, 2005
Messages
413
Helped
91
Reputation
182
Reaction score
23
Trophy points
1,298
Location
Fleet, UK
Activity points
0
Re: What are the implications of using Integer instead STD_L

1. Mod function is not synthesizeable(unless its a mod of N, where N = 2^n).
2. You can eaisly determine 'mod' in a std_logic_vector type where above condition is satisfied, just by dropping 'n' bits out of an 'std_logic_vector'
3. In worst case if you have to use a mod, then just use conv_integer, but I wonder why would anybody do that?

Any other strong reason to support your claim?

Kr,
Avi
http://www.vlsiip.com
 

khaila

Full Member level 2
Joined
Jan 13, 2007
Messages
121
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
2,105
Re: What are the implications of using Integer instead STD_L

avimit said:
1. Mod function is not synthesizeable(unless its a mod of N, where N = 2^n).
2. You can eaisly determine 'mod' in a std_logic_vector type where above condition is satisfied, just by dropping 'n' bits out of an 'std_logic_vector'
3. In worst case if you have to use a mod, then just use conv_integer, but I wonder why would anybody do that?

Any other strong reason to support your claim?

Kr,
Avi
http://www.vlsiip.com

I only trying to think about a reason!!!

Thanks anyway.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top