二、upf+vcsnlp+verdi实例
后文中使用的dut代码和testbench代码,使用的工具版本和参考文献在文末。
dut的三个文件,dut很简单没有复杂的逻辑结构:
ints.v:
- module inst (input reg_i,input ido_en,input pwr_en,output reg_o);
-
- wire reg_o1 = ~reg_i;
-
- Buf buf_u(.in(reg_o1),.pwr_en(pwr_en).out(reg_o));
-
- endmodule
-
- module Buf(input in,input pwr_en,output out);
- assign out = in;
- endmodule
pmu.v:
- module pmu(input clk,input rstn,input [1:0] iso_en_in,output [1:0] iso_en_out,input [1:0] pwr_en_in,output [1:0] pwr_en_out);
- reg [1:0] iso_en_out;
- reg [1:0] pwr_en_out;
- always@(posedge clk or negedge rstn) begin
- if(!rstn) begin
- iso_en_out <= 2'h0;
- pwr_en_out <= 2'h3;
- end
- else begin
- iso_en_out <= iso_en_in;
- pwr_en_out <= pwr_en_in;
- end
- end
-
- endmodule