0

Please note, this is a study question.

I have to describe a simple d-latch in vhdl, and then synthesize it. The problem is that it is a "unary" d-latch, and its single input is mapped directly to its outputs (Q and nQ). You can imagine it as a classical async d-latch, where clk signal is always high. This is useless element in logic, and xilinx synthesizer in most cases gives an empty technology schema. But the reason to keep this element is, for example, creating hardware "watermarks", which present on the schema, but don't affect its logic.
I came up with the following code:

entity dLatch is
  port(
    d: in std_logic;
    q: out std_logic);
end dLatch;

architecture dLatch_beh of dLatch is  
  signal o: std_logic;
begin
  latch: process(d)
  begin
    if d = '1' then
      o <= '1';
    elsif d = '0' then
      o <= '0';
    end if;
  end process;

  q <= o;
end;

This code produce the following technology schema

link

But when I try to add nQ out port, I gain duplication of latch

entity dLatch is
  port(
    d: in std_logic;
    q, nq: out std_logic);
end dLatch;

architecture dLatch_beh of dLatch is  
  signal o: std_logic;
begin
  latch: process(d)
  begin
    if d = '1' then
      o <= '1';
    elsif d = '0' then
      o <= '0';
    end if;
  end process;

  q <= o;
  nq <= not o;
end;

Technology schema: link

I don't understand, why I am getting two completely equal latches here. I expected only one additional 'not' gate. So my question is how to avoid the duplication of latches, or maybe some other way to solve this problem. I use Xilinx ISE Web Pack 14.6 for synthesis.

UPD The solution is to set synthesizer's flag -register_duplication to false.

4

2 回答 2

0

解决方案是将合成器的标志 -register_duplication 设置为 false。

于 2013-11-07T22:41:14.083 回答
0

你根本没有得到任何闩锁。您正在查看 Technology 视图,因此它向您展示了它映射到的 Xilinx 组件。您应该首先查看 RTL 视图。

其次,闩锁很糟糕,因为您的教授可能已经让您意识到了。他甚至在描述中说视图将是空白的,因为这些工具不会为您生成闩锁。它们不存在于织物中。

于 2013-11-07T13:23:29.543 回答