P
Per Christian Corneliusse
Guest
I've been working as a VHDL designer for about one year now, and I also have some experience with Verilog. One aspect of VHDL that I don't like is that there is no way to mix concurrent and synchronous assignments in the same process. I you want to create a Mealy-type state machine, you have to create one synchronous process and one concurrent process. This takes up a lot of additional space in the code since the concurrent process has to replicate the process-case-when structure. And worse, this will (especially for large state machines) place synchronous and concurrent assignments for each state on very different places in the code, making it hard to read and maintain.
Creating additional _next-signals that are written to in the concurrent process and back to the corresponding synchronous signals in the synchronous process (e.g., state <= state_next) can be a more elegant solution, especially if most of the outputs of the state machine are concurrent. But I imagine a language with a separate concurrent assignment operator would be a lot more elegant, see a hypothetical example below:
process (clk_i'rising) -- Defines clock for synchronous assignments
begin
case state is
when s_idle =>
if req_i = '1' then
fifo_read %= '1'; -- Concurrent assignment
state <= s_read_data; -- Synchronous assignment
end if;
(...)
end case;
end process;
However, I haven't really thought this completely through and the fact that Verilog has the same problem leads me to believe that there's some good reason for not doing this that I haven't thought of. Any insights?
Creating additional _next-signals that are written to in the concurrent process and back to the corresponding synchronous signals in the synchronous process (e.g., state <= state_next) can be a more elegant solution, especially if most of the outputs of the state machine are concurrent. But I imagine a language with a separate concurrent assignment operator would be a lot more elegant, see a hypothetical example below:
process (clk_i'rising) -- Defines clock for synchronous assignments
begin
case state is
when s_idle =>
if req_i = '1' then
fifo_read %= '1'; -- Concurrent assignment
state <= s_read_data; -- Synchronous assignment
end if;
(...)
end case;
end process;
However, I haven't really thought this completely through and the fact that Verilog has the same problem leads me to believe that there's some good reason for not doing this that I haven't thought of. Any insights?