Re: Is the "Gaisler method" of writing "structured VHDL" popular?
Nevertheless I dislike the "records for everything" - style, since it makes generic components really hard to specify.
It isn't likely that you'll have a module with the same FSM states or same outputs. The record should be fairly close to unique -- it doesn't need to go into a package.
dpaul said:
MicroZed Chronicles – Finite State Machines Tips :
https://adiuvoengineering.com/
I find the above very rational.
At the same time, they instantly show why the method is also tricky. "output is a function of the current state only". Now there is a case where you are in "LED_ON" with the led off. For this application, that is probably fine. But this isn't addressed in the article. In a way, it echos the author's lament about inconsistent interfaces with signals arriving at unexpected times. In the 2-process version, this oversight would require some effort to reproduce.
The article also complains about sensitivity lists and latches. These are actually addressed using the Gaisler method from the original post. I'm also suspicious of the advice to have single bit inputs/output. That said, I will often use variables to name common subexpressions in order to reduce verbosity in the core of the FSM.
The basic idea is to make it easier to write complex algorithmic code in VHDL. Is this method known/used by anyone on this forum before?
In theory, Gaisler's method removes many of the downsides of the 2-process style -- sensitivity list is auto-updated and next_x/x are both auto-added when put into the record. A downside is that the signals get somewhat of an extra layer of typing. You have to remember that the outputs were part of the FSM, which isn't something you normally need to know. Another downside is that it makes it seem like a good idea to write more complex logic within FSMs.
--edit: It has been a while since I last read the Gaisler article. I think some of my comments were more about a version that uses the records only for the FSMs.
- - - Updated - - -
Actually you've repeatedly proven your elitist attitude on using 2-process sequential logic, and in this case spilling into the realm of rude, unwarranted, and demeaning.
I've found your coding style to be a far less maintainable.
Perhaps there has been some misunderstanding. I am not suggesting using separate processes for everything. Actually, I really dislike that style. I am also not suggesting using two-process logic for everything, just FSMs.
- - - Updated - - -
Actually you've repeatedly proven your elitist attitude on using 2-process sequential logic, and in this case spilling into the realm of rude, unwarranted, and demeaning.
I've found your coding style to be a far less maintainable.
Perhaps there has been some misunderstanding. I am not suggesting using separate processes for everything. Actually, I really dislike that style. I am also not suggesting using two-process logic for everything, just FSMs.