Philosophical placement of counter in vhdl

Status
Not open for further replies.

apalopohapa

Newbie level 1
Joined
Oct 18, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,289
Hi. In vhdl, if a fsm needed to stay in a specific state for a specific number of clock cycles (for example, 1000), and you wanted to keep track of them using a counter, would you instantiate it within the fsm's architecture or somewhere else (e.g. the datapath) ? I ask because it doesn't feel right to put it along with the datapath stuff because the 'passing data' never interacts with the counter, but putting it along with the fsm code seems weird too. It almost seems that you need datapath, fsm, and a third conceptual placeholder for 'fsm peripherals'. What do you think?
 

For code readability, I prefer to place the counter operation in the FSM code. Don't see, what should be "weird" in this respect.

Generally, any meaningful synchronous counter construct can be expected to be minimized by the VHDL compiler to a similar hardware structure. Thus, it's mostly a matter of taste where to place the counter.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…