2
votes

in reference to this post How to write to two output ports from inside architecture in VHDL? I made a VHDL module using the same concept as decribed in one of its answers. His code:

entity HIER is
port (
    IN1 : in bit;
    OUT1, OUT2 : out bit);
end hier;

architecture HIER_IMPL of HIER is 
   signal temp : bit;
   component BUF1 is 
      port (a : in bit; o : out bit);
   end component;
begin
   BUF2 : BUF1 port map (a => IN1, o => temp);
   OUT1 <= temp;
   OUT2 <= temp;

end HIER_IMPL;

His generated RTL(using xilinx 9.1i) enter image description here

I made a D flip flop using the same concept of signal to drive output ports my code:

entity dfff is
    Port ( D : in  STD_LOGIC;
           clk : in  STD_LOGIC;
           Q : out  STD_LOGIC;
           Qbar : out  STD_LOGIC);
end dfff;

architecture Behavioral of dfff is
component nand_2 is
port(A:in std_logic;
        B:in std_logic;
        C:out std_logic);
end component;
component not_1 is
port(A:in std_logic;
                B:out std_logic);
                end component;
signal Z : std_logic_vector(4 downto 0);
begin
n1 : not_1 port map (D,z(0));
n2 : nand_2 port map(D,clk,z(1));
n3 : nand_2 port map(z(0),clk,z(2));
n4 : nand_2 port map(z(1),z(3),z(4));
n5 : nand_2 port map(z(2),z(4),z(3));
Q<=z(4);
Qbar<=z(3);
end Behavioral;

my generated RTL(using xilinx 9.1i): enter image description here

Now MY question is that why My output ports Q and Qbar not visible in the RTL while his OUT1 and OUT2 are? I am a beginner in this field.

2
Xilinx 9.1i (assuming ISE) sounds like a pretty old version; you may want to update to newest before trying to debug any issue. - Morten Zilmer
Last time I tested that 'feature', I needed a *PAD primitive so no open end exists. - Paebbels

2 Answers

2
votes

Works fine in ISE14.4. I remember old versions of RTL Viewer being practically unusable.

enter image description here

1
votes

When I first started writing VHDL I also tried writing a FF in discrete gates, AFAIR it didn't go too well. You should be writing to your platform (in this case probably some Xilinx chip), knowing what it is and does. This will also help you when you get on in your training, FPGAs and CPLDs are not great arrays of AND and OR gates, they are great arrays of lookup tables, so the chance of an implementation of a FF in an FPGA turning out well is slim to none.

Regarding your actual question, I'd first make sure I actually have my outputs set to go somewhere. The synthesizer tries very hard not to include superfluous circuitry, so if your result doesn't end in anything, it might get optimized away (even though that should surely also optimize away the circuitry that you did get).

Also as mentioned, try updating your tools, 14.7 is a far stretch newer than 9.1 and that is even from October 2013.