【发布时间】:2020-01-17 08:24:28
【问题描述】:
一个协议可以在不同的物理层上实现,例如
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
有没有一种方法可以通过接口参数化 System Verilog 类?以下似乎无法编译,因为 System Verilog 不将接口视为类型。
class sender#(type I);
virtual I if;
function void send(int n);
if.send(n);
endfunction
endclass
【问题讨论】:
-
奇怪的是,接口不是类型,而是虚拟接口。
标签: verilog system-verilog verification hdl