M
M. Norton
Guest
Hello,
I'm somewhat new to Xilinx as I haven't used them for 3 or 4 years.
The company I was working for prior to this one was using Actel
anti-fuse type of FPGAs. Anyhow, something I'm doing is synthesizing
as a gated clock, when I would really rather prefer it to be a mux
followed by a flop. In the Actel devices using a Synopsys synthesizer,
the code below always instantiated as a mux followed a gate, rather
than as a latch or gated clock sort of thing. Explicitly stating the
cases for the D input (and one of which being the current output)
created a mux and the if/then/elsif/end created a D-flop with a reset.
Anyhow, I'm not getting that now with the Xilinx and I expect a
different code structure is preferred for this sort of thing. If
someone who is familiar with Xilinx code could take a look and see if
there's something really outrageous going on, I'd sure appreciate it.
In a nutshell, I've got a byte buffer that is a series of ASCII
characters and I'm decoding a command. I'd just like to turn something
on, and turn it off, and otherwise, leave it alone.
signal clk : std_logic;
signal data_ascii_q : std_logic_vector(47 downto 0);
signal new_cmd : std_logic;
signal signal_d : std_logic;
signal signal_q : std_logic;
....
process (clk, signal_q, data_ascii_q, new_cmd)
begin
if (new_cmd = '1' and
data_ascii(7 downto 0) = X"0D" and -- CR delimiter
data_ascii(16 downto 8) = X"57") then -- Char "W" is write
case data_ascii(47 downto 32) is -- Decode the address
part
when X"3031" => -- Address is "01"
case data_ascii(31 downto 16) is
when X"3031" => -- Data "01"
signal_d <= '1'; -- Turn it on
when X"3030" => -- Data "00"
signal_d <= '0'; -- Turn it off
when others =>
signal_d <= signal_q -- Retain state on bad
data
end case;
when others =>
null;
end case;
else
signal_d <= signal_q; -- if there's nothing going on, hold last
state
end if;
if (por_l = '0') then
signal_q <= '0';
elsif (clk'event and clk='1') then
signal_q <= signal_d;
end if;
end process;
The exact warning I'm getting is:
WARNINGesignRules:372 - Netcheck: Gated clock. Clock net UMAIN__n0093
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.
Thanks for any help or insight that's out there in the community. I
sure aprpeciate it.
Best regards,
Mark Norton
I'm somewhat new to Xilinx as I haven't used them for 3 or 4 years.
The company I was working for prior to this one was using Actel
anti-fuse type of FPGAs. Anyhow, something I'm doing is synthesizing
as a gated clock, when I would really rather prefer it to be a mux
followed by a flop. In the Actel devices using a Synopsys synthesizer,
the code below always instantiated as a mux followed a gate, rather
than as a latch or gated clock sort of thing. Explicitly stating the
cases for the D input (and one of which being the current output)
created a mux and the if/then/elsif/end created a D-flop with a reset.
Anyhow, I'm not getting that now with the Xilinx and I expect a
different code structure is preferred for this sort of thing. If
someone who is familiar with Xilinx code could take a look and see if
there's something really outrageous going on, I'd sure appreciate it.
In a nutshell, I've got a byte buffer that is a series of ASCII
characters and I'm decoding a command. I'd just like to turn something
on, and turn it off, and otherwise, leave it alone.
signal clk : std_logic;
signal data_ascii_q : std_logic_vector(47 downto 0);
signal new_cmd : std_logic;
signal signal_d : std_logic;
signal signal_q : std_logic;
....
process (clk, signal_q, data_ascii_q, new_cmd)
begin
if (new_cmd = '1' and
data_ascii(7 downto 0) = X"0D" and -- CR delimiter
data_ascii(16 downto 8) = X"57") then -- Char "W" is write
case data_ascii(47 downto 32) is -- Decode the address
part
when X"3031" => -- Address is "01"
case data_ascii(31 downto 16) is
when X"3031" => -- Data "01"
signal_d <= '1'; -- Turn it on
when X"3030" => -- Data "00"
signal_d <= '0'; -- Turn it off
when others =>
signal_d <= signal_q -- Retain state on bad
data
end case;
when others =>
null;
end case;
else
signal_d <= signal_q; -- if there's nothing going on, hold last
state
end if;
if (por_l = '0') then
signal_q <= '0';
elsif (clk'event and clk='1') then
signal_q <= signal_d;
end if;
end process;
The exact warning I'm getting is:
WARNINGesignRules:372 - Netcheck: Gated clock. Clock net UMAIN__n0093
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.
Thanks for any help or insight that's out there in the community. I
sure aprpeciate it.
Best regards,
Mark Norton