Alexium
Full Member level 2
Greetings.
I have suddenly found myself writing such a code:
So, I have this signal, RXNewPacket, that should be implemented as a flip-flop. And it looks like I'm doing two asignments to it when some_condition is false. On the one hand, by the rules of VHDL, only the last asignment will take effect (and this is what I need). But somehow it doesn't look right to me, and I tried to avoid this coding technique in the past.
Will this code work correctly with any abstract synthesizer, and are there any reasons to avoid this?
Thanks.
I have suddenly found myself writing such a code:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 RXLoop: process (clk, rst) begin if clk'event and clk = '1' then RXNewPacket <= '0'; if RXDone = '1' then if some_condition then --some code else RXNewPacket <= '1'; end if; end if; end if; end process;
So, I have this signal, RXNewPacket, that should be implemented as a flip-flop. And it looks like I'm doing two asignments to it when some_condition is false. On the one hand, by the rules of VHDL, only the last asignment will take effect (and this is what I need). But somehow it doesn't look right to me, and I tried to avoid this coding technique in the past.
Will this code work correctly with any abstract synthesizer, and are there any reasons to avoid this?
Thanks.