[sv-bc] Function in generate block

From: Rakesh Gulati <rakesh_at_.....>
Date: Tue May 24 2005 - 22:46:15 PDT
module test(clk,reset,a,b,c,x,y,z);

parameter SIZE = 4;
input     clk;
input     reset;
input     [SIZE-1:0] a;
input     [SIZE-1:0] b;
input     [SIZE-1:0] c;
output    [SIZE-1:0] x;
output    [SIZE-1:0] y;
output    [SIZE-1:0] z;
reg       [SIZE-1:0] x;
reg       [SIZE-1:0] y;
reg       [SIZE-1:0] z
generate
begin
  function [SIZE-1:0] output_assign;
    input [SIZE-1:0] in;
    output_assign = !in;
  endfunction
end
endgenerate

always@(a or b or c)
begin
  x = output_assign(a);
  y = output_assign(b);
  z = output_assign(c);
end

endmodule


Function output_assign defined inside the generate block, but used 
outside in procedural block.  Is this a  semantic error at the place of 
function call in SV as the function is in unnamed block name space ? In 
my opinion in V2k this is a pass case.

Rakesh
Received on Tue May 24 22:43:18 2005

This archive was generated by hypermail 2.1.8 : Tue May 24 2005 - 22:43:36 PDT