Re: [sv-bc] Treatment of parameters in interfaces.

From: Kaiming Ho <kaiming.ho@iis.fraunhofer.de>
Date: Thu Jul 15 2010 - 09:13:45 PDT

Hi Brad:
    Your example is exactly what I meant. The 2009 LRM speaks of
it as an 'interface based typedef', in section 6.18.

    Various posts on sv-bc a long time back suggested that if the
restriction is so easily bypassed using this backdoor, why not
just remove the restriction.

regards,
kaiming

Brad Pierce schrieb:
> Kaiming,
>
> What's a code example of
>
> "Workarounds to this problem involving the 'typedef backdoor' only partially resolve the problems the examples show. They are inconvenient and sometimes not practical. Most importantly, synthesis tools don't support it, and its hard to argue that such a construct is synthesiable."
>
> Something like this?
>
> interface IFC;
> parameter secret = 88;
> wire in, out;
> modport mp(input in, output out);
> typedef struct {logic [secret-1:0] dummy;} secret_T;
> endinterface
>
> module test(IFC.mp ifc, output integer backdoor);
> typedef ifc.secret_T secret_T;
> localparam secret = $bits(secret_T);
> assign backdoor = secret;
> endmodule
>
> module top;
> IFC ifc();
> integer backdoor;
> test test(ifc.mp, backdoor);
> initial begin
> $display(backdoor);
> end
> endmodule
>
>
> -- Brad

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Jul 15 09:14:09 2010

This archive was generated by hypermail 2.1.8 : Thu Jul 15 2010 - 09:16:53 PDT