indu15
Junior Member level 3
- Joined
- Nov 23, 2005
- Messages
- 31
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,560
I have to divide the clock by 3 with 50% duty cycle (see below for my code). The code is synthesized successfully but when running implement design (in Xilinx ISE) I am getting following warning. I think I cannot ignore these warnings. I am a newbie to VHDL. Can anyone please tell me what changes do I need to make in my code to avoid these warning?
WARNINGhysDesignRules:372 - Gated clock. Clock net clk_div_OBUF is sourced by
a combinatorial pin. This is not good design practice. Use the CE pin to
control the loading of data into the flip-flop.
WARNING:Route:455 - CLK Net:clk_div_OBUF may have excessive skew because
code:
process (clk, rst)
begin
if (rst = '0') then
pos_cnt <= (others=>'0');
elsif (rising_edge(clk)) then
if (pos_cnt = "10") then
pos_cnt <= (others => '0');
else
pos_cnt <= pos_cnt + '1';
end if;
end if;
end process;
process (clk, rst)
begin
if (rst = '0') then
neg_cnt <= (others=>'0');
elsif (falling_edge(clk)) then
if (neg_cnt = "10") then
neg_cnt <= (others => '0');
else
neg_cnt <= neg_cnt + '1';
end if;
end if;
end process;
clk_div <= '1' when ((pos_cnt /= "10") and (neg_cnt /= "10")) else -- /= is not equal operator
'0';
WARNINGhysDesignRules:372 - Gated clock. Clock net clk_div_OBUF is sourced by
a combinatorial pin. This is not good design practice. Use the CE pin to
control the loading of data into the flip-flop.
WARNING:Route:455 - CLK Net:clk_div_OBUF may have excessive skew because
code:
process (clk, rst)
begin
if (rst = '0') then
pos_cnt <= (others=>'0');
elsif (rising_edge(clk)) then
if (pos_cnt = "10") then
pos_cnt <= (others => '0');
else
pos_cnt <= pos_cnt + '1';
end if;
end if;
end process;
process (clk, rst)
begin
if (rst = '0') then
neg_cnt <= (others=>'0');
elsif (falling_edge(clk)) then
if (neg_cnt = "10") then
neg_cnt <= (others => '0');
else
neg_cnt <= neg_cnt + '1';
end if;
end if;
end process;
clk_div <= '1' when ((pos_cnt /= "10") and (neg_cnt /= "10")) else -- /= is not equal operator
'0';