Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed (Author was flagged for spam)

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
[HELP] Dumb newbie question: When - if ever - is it okay to use a port/signal inside a process when that port/signal is not on the sensitivity list?
Author Summary
ModernRonin is in help
Post Body

I am an idiot newbie who is working his way through Pong Chu's "FPGA Prototyping by VHDL Example". I've read the first 6 chapters, and have decided I know enough to be dangerous and have written what I think is an upcounter:

http://pastebin.com/RC9NY9NJ

You can see from the code that I use the en port(?) from the entity declaration as part of an "and" construct, to decide if the counter should be incremented. It's line 22 of the pastebin file: elsif( rising_edge(clk) and en ) then upctr_reg <= upctr_next;

My question is: Is this a bad idea?

Intuitively, I expect the VHDL synthesizer to simply create an AND gate with en as one of the inputs. The output of said AND gate then getting wired to the clk input to all the FFs that store the bits of the register. Which all seems fine to me.

Since nothing will happen until the clock edge anyway (by design), I don't see the point in running the process when en changes. That's why I don't want to put it on the sensitivity list. Something in my brain is saying: "en is a level-sensitive input, not an edge-sensitive one. Nothing changes when en goes high (or low), things only change at the clock edge."

Is my understanding of all this correct?

(Probably a lot of people are saying to themselves: "Why didn't he just try it?" Two reasons: One, I'm still waiting for the #@$#@%$&* Xilinx ISE download to finish. Two, even if it does work I'd still like to know if this is considered "bad style" or something like that.)

Author
Account Strength
0%
Account Age
17 years
Verified Email
Yes
Verified Flair
No
Total Karma
80,053
Link Karma
5,035
Comment Karma
74,430
Profile updated: 8 months ago
Posts updated: 9 months ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago