alkaios
Newbie level 5
hello
I want to ask: does shift arithmetic always creates latches in vhdl?
Is there any way to prevent this from happening?
Should I or should I not care about these latches?
Here's my code:
In the second process, i do the sra in the signal xreduce.
I used the shreg_extract constraint, because i thought it would help.
Is my code correct?
here are the warnings that XST produces:
Thanks in advance
I want to ask: does shift arithmetic always creates latches in vhdl?
Is there any way to prevent this from happening?
Should I or should I not care about these latches?
Here's my code:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use ieee.std_logic_unsigned.all; use IEEE.NUMERIC_STD.ALL; entity xReadCounter is Port ( clk: in STD_LOGIC; rxEnable: in STD_LOGIC_VECTOR (1 downto 0); reducEn : in std_logic; xrcheck : out std_logic; rqoutx: inout STD_LOGIC_VECTOR(12 downto 0)); end xReadCounter; architecture Behavioral of xReadCounter is signal xreduce : std_logic_vector (12 downto 0) := "0000000001000"; attribute shreg_extract: string; attribute shreg_extract of xreduce: signal is "yes"; begin -----x read counter--------- process(clk) begin if (clk'event and clk = '1') then if rxEnable = "00" then rqoutx <= "0000000001000"; elsif rxEnable = "01" then rqoutx <= rqoutx - xreduce; elsif rxEnable = "10" then rqoutx <= rqoutx + 1; else rqoutx <= rqoutx; end if; end if; end process; process (clk) begin if (clk'event and clk = '1') then if reducEn = '1' then xreduce <= '0' & xreduce(12 downto 1); else xreduce <= xreduce; end if; end if; end process; xrcheck <= '1' when xreduce = "0000000000001" else '0'; end Behavioral;
In the second process, i do the sra in the signal xreduce.
I used the shreg_extract constraint, because i thought it would help.
Is my code correct?
here are the warnings that XST produces:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ========================================================================= * Advanced HDL Synthesis * ========================================================================= WARNING:Xst:1426 - The value init of the FF/Latch xreduce_3 hinder the constant cleaning in the block xReadCounter. You should achieve better results by setting this init to 0. WARNING:Xst:1293 - FF/Latch <xreduce_12> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_11> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_10> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_9> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_8> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_7> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_6> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_5> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_4> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. ............................................................................................................................. ========================================================================= * Low Level Synthesis * ========================================================================= WARNING:Xst:1426 - The value init of the FF/Latch xreduce_3 hinder the constant cleaning in the block xReadCounter. You should achieve better results by setting this init to 0. WARNING:Xst:1293 - FF/Latch <xreduce_12> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_11> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_10> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_9> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_8> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_7> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_6> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_5> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <xreduce_4> has a constant value of 0 in block <xReadCounter>. This FF/Latch will be trimmed during the optimization process. ....................................................................................................................
Thanks in advance
Last edited: