I changed the whole example.
How does this look like?
class Base #(parameter p = 1);
typedef struct {
real r;
bit[p-1:0] other_data;
} T;
static function T Tsum(input T driver[]);
Tsum.r= 0.0;
Tsum.data = 0;
foreach (driver[i])
Tsum.rdata +|= driver[i]. rdata;
Tsum.r = $bitstoreal(Tsum.data);
endfunction
endclass
typedef Base#(2) MyBaseT;
nettype MyBaseT::T narrowTsum with MyBaseT::Tsum;
typedef Base#(32) MyBaseType;
nettype MyBaseType::T wideTsum with MyBaseType::Tsum;
narrowTsum net1; // other_data is 2 bits wide
wideTsum net2; // other_data is 32 bits wide
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Jun 13 09:06:17 2011
This archive was generated by hypermail 2.1.8 : Mon Jun 13 2011 - 09:06:22 PDT