A protocol may be implemented over different physical layers, e.g.
interface async_if;
logic tx;
task send(int n);
tx <= 0; // stop bit
#10;
// etc.
endtask
endinterface
interface clkd_if;
logic data;
logic clk;
task send(int n);
foreach(n[ii]) begin
data <= n[ii];
clk <= 1;
#10 clk <= 0;
#10 ;
end endtask
endinterface
Is there a way of parameterising a System Verilog class with an interface? The following doesn't seem to compile, because System Verilog doesn't regard interfaces as types.
class sender#(type I);
virtual I if;
function void send(int n);
if.send(n);
endfunction
endclass