Closed ibkvictor closed 1 year ago
I think, the else branch in the clocked if
statement is the problem:
STATE_MEMORY_1 : process( Clock )
begin
if rising_edge(Clock) then
Switch_input_prev <= Switch_input;
else
Switch_input_prev <= '0';
end if ;
end process ; -- STATE_MEMORY
If you remove it, the design should be synthesize.
What's the intention for this else branch? If you want a reset, you have to use an initial value for Switch_input_prev
(supported in most SRAM based FPGA-architectures):
signal Switch_input_prev : std_logic := '0';
Or you have to use an explicit reset.
STATE_MEMORY_1 : process( Clock )
begin
if rising_edge(Clock) then
if (reset) then
Switch_input_prev <= '0';
else
Switch_input_prev <= Switch_input;
end if;
end if;
end process ; -- STATE_MEMORY
Thanks for the reply.
Without the else branch the code does not synthesize, it returns:
counter.vhd:27:5:error: latch infered for net "switch_input_prev" (use --latches)
STATE_MEMORY_1 : process( Clock )
^
ERROR: vhdl import failed.
I imagine that I could include a reset, but it affects the logic as now, I would have a reset port which the device does not have. The First state memory just ensure there is previous signal to compare with on a fast clock for determining switch bouncing. Thanks once again. Is there any other thing I could do?
In my understanding, the inferred latch problem is situation of the compiler interpreting incomplete sequential logic to be wrongly written combinational logic. Completing the sequential logic with a reset
solved the problem for me. Thanks to @tmeissner for prompt responses.
Logic for counter in a digital debouncing circuit. However,
yosys -m ghdl -p 'ghdl --std=08 counter.vhd -e counter'
givesERROR: vhdl import failed.
clocked logic requires clocked logic on else part
. I am running yosys-ghdl-plugin with a pulledhdlc/ghdl:yosys
container from today. Could there be a reason why I cannot synthesise the design. Thanks in advance.