[sv-bc] functional if statement

From: Kapil Kaushik <kkapil_at_.....>
Date: Tue Dec 09 2008 - 03:04:38 PST
Hi,

 

I have the following piece of rtl:

 

always @(posedge ck54 or negedge p_rst_x) begin

    if (~p_rst_x) 

      dout <= 3'd0;     

    else 

      dout <= func( enable, din);

      // if (enable)      // Works fine

        // dout = din;   // Works fine

      end

      

      function    func; 

  input     enable;     

  input din;

  reg temp; 

 

    begin

      if (enable) 

        temp = din;

      func = temp;            // Latch inferred

 

    end

  endfunction

 

Given the above description, can I replace the command "dout <=
func(enable,din)" by "dout <= enable ? din : 1'bx"?

Kindly suggest.

 

Thanks,

Kapil


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Dec 9 03:05:42 2008

This archive was generated by hypermail 2.1.8 : Tue Dec 09 2008 - 03:09:11 PST