Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/15/07 19:28
Read: times


 
#130830 - mode out on RHS
Responding to: ???'s previous message
Suresh R said:
i said:

i would also like to know how the current state of the 'out' signal could be assigned to the status register when status read signal is encountered.

jez said:

The fact that the port of the 'out' signal is in out mode is what you want for it to be readable by the status register.

then can i do like this.,

if(status_read)
status_reg[7]<=out


Signals declared as entity out types in VHDL cannot be used on the RHS of an assignment. (This restriction was relaxed in the latest versions of VHDL, but I don't know which tools support this.)

So the usual solution is to use a dummy signal that's the source and target for any assignments that need the signal driven OUT. The only use of the actual OUT signal is an assignment to it from the dummy. For example:
entity foo is
    port (
    clk : in std_logic;
    d   : in std_logic;
    q   : out std_logic;
    q_l : out std_logic);
end entity foo;

architecture bar of foo is
    signal q_i : std_logic;  -- "dummy" internal q
begin
    q   <= q_i;      -- use dummy because 
    q_l <= not q_i;  -- we can't do q_l <= not q

    flop : process (clk) is
    begin
        q_i <= d;
    end process flop;
end architecture bar;

And don't use BUFFER ... it's a minefield best avoided.

-a


List of 28 messages in thread
TopicAuthorDate
data flow modeling in Verilog            01/01/70 00:00      
   How to post code            01/01/70 00:00      
   proper code...            01/01/70 00:00      
      Break up your code into smaller pieces            01/01/70 00:00      
         Thanks            01/01/70 00:00      
         what does that have to do with verilog? :)            01/01/70 00:00      
      Verilog bites like C            01/01/70 00:00      
         yes sorry. i made a mistake there.            01/01/70 00:00      
      ugh            01/01/70 00:00      
         details            01/01/70 00:00      
            dont use a bidirectional bus            01/01/70 00:00      
               regarding using seperate buses..            01/01/70 00:00      
                  out signal to status register            01/01/70 00:00      
                     hints            01/01/70 00:00      
                        Absolutely.            01/01/70 00:00      
                        Since \'diomux\' is a register....            01/01/70 00:00      
                           re: Since 'diomux' is a register ...            01/01/70 00:00      
                              regarding write and read operations...            01/01/70 00:00      
                                 re: regarding write and read ops            01/01/70 00:00      
                                    thank you..            01/01/70 00:00      
   Yukky verilog            01/01/70 00:00      
      Yes i did            01/01/70 00:00      
   all you do is...            01/01/70 00:00      
       can i do like this.,            01/01/70 00:00      
         if it's in BUFFER mode ...            01/01/70 00:00      
            buffer mode ports from the vhdl faq            01/01/70 00:00      
         mode out on RHS            01/01/70 00:00      
            very good Solutions!            01/01/70 00:00      

Back to Subject List