|  | 
 
| 
我在vcs 2024.09 SP1 上仿真一个简单的示例,发现其无法编译,卡死在此界面,长时间无反应,求各位大佬帮忙:
×
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册  注:之前的License无MVDBGEN的Feature,然后我手动加入,日志并未出现异常,但编译无法进行。
 
 
 测试代码由AI生成:
 执行的命令:
 
 
    
        复制代码
 vcs -full64 -sverilog design.v tb.v -upf design.upf -o simv -l compile.log
 
 
 design.v
 
 
 
    tb.v
        复制代码
 module PD_DUT (
  input  wire data_in,
  output wire data_out
);
  assign data_out = data_in;
endmodule
module top (
  input  wire clk,
  input  wire top_in,
  output wire top_out,
  
  input  wire pwr_en,
  input  wire iso_en
);
  
  PD_DUT u_dut (
    .data_in  (top_in),
    .data_out (top_out)
  );
endmodule
 
 
 
    design.upf
        复制代码
 module tb;
  reg clk;
  reg top_in;
  reg pwr_en;
  reg iso_en;
  wire top_out;
  // 实例化顶层设计
  top uut (
    .clk(clk),
    .top_in(top_in),
    .top_out(top_out),
    .pwr_en(pwr_en),
    .iso_en(iso_en)
  );
  // 时钟生成
  initial begin
    clk = 0;
    forever #5 clk = ~clk;
  end
  // 测试激励
  initial begin
    $display("T=%0t: ---- Simulation Start ----", $time);
    
    // 1. 初始状态:上电,不隔离
    pwr_en = 1'b1; // Power on
    iso_en = 1'b0; // Isolation disabled
    top_in = 1'b0;
    #20;
    $display("T=%0t: Power is ON, Isolation is OFF. DUT should be working.", $time);
    top_in = 1'b1; // 检查DUT是否工作,top_out应该跟随变为1
    #20;
    top_in = 1'b0;
    #20;
    // 2. 准备断电:先使能隔离
    $display("T=%0t: ---- Starting Power Down Sequence ----", $time);
    iso_en = 1'b1; // Enable isolation
    #20;
    $display("T=%0t: Isolation is ON. Output should be clamped to 0 now.", $time);
    top_in = 1'b1; // 此时top_out应保持为0,不受top_in影响
    #20;
    // 3. 执行断电
    pwr_en = 1'b0; // Cut the power
    $display("T=%0t: Power is OFF. DUT is non-functional.", $time);
    #50;
    // 4. 准备上电:先给电
    $display("T=%0t: ---- Starting Power Up Sequence ----", $time);
    pwr_en = 1'b1; // Restore power
    #20;
    $display("T=%0t: Power is restored.", $time);
    top_in = 1'b0;
    #20;
    // 5. 解除隔离,恢复正常工作
    iso_en = 1'b0; // Disable isolation
    $display("T=%0t: Isolation is OFF. DUT should be working again.", $time);
    top_in = 1'b1; // 检查DUT是否恢复工作,top_out应该跟随变为1
    #20;
    
    $display("T=%0t: ---- Simulation End ----", $time);
    $finish;
  end
  // (可选) 用于在终端打印信号变化,方便调试
  initial begin
    $monitor("T=%0t: clk=%b, top_in=%b, pwr_en=%b, iso_en=%b, top_out=%b", 
             $time, clk, top_in, pwr_en, iso_en, top_out);
  end
endmodule
 
 
 
    
        复制代码
 # design.upf
# 声明UPF版本
set_upf_version "2.0"
# 1. 创建一个名为 PD_A 的电源域 (Power Domain)
#    -scope 指定了这个域包含的RTL实例范围
create_power_domain PD_A
set_scope /top/u_dut
map_power_domain PD_A -elements {.}
set_scope /top
# 2. 定义 PD_A 域的供电网络
#    - VDD 是全局主电源 (Always-On)
#    - VDD_A 是 PD_A 域的虚拟电源,它将被开关控制
#    - VSS 是全局地
create_supply_net VDD
create_supply_net VSS -domain PD_A -reuse
create_supply_net VDD_A -domain PD_A
# 将PD_A域的主电源连接到虚拟电源VDD_A
set_domain_supply_net PD_A -primary_power_net VDD_A -primary_ground_net VSS
# 3. 创建一个电源开关 (Power Switch)
#    这个开关将根据 pwr_en 信号来决定是否将 VDD 连接到 VDD_A
create_power_switch pwr_sw
    -domain PD_A \
    -input_supply_port  {in VDD} \
    -output_supply_port {out VDD_A} \
    -control_port {en /top/pwr_en} \
    -ack_port {ack_ignored .} \
    -on_state {on_ack in} \
    -off_state {off_ack}
# 4. 创建隔离规则 (Isolation Rule)
#    当 PD_A 域断电时,其输出信号需要被隔离
set_isolation iso_rule
    -domain PD_A \
    -isolation_power_net VDD \
    -isolation_ground_net VSS \
    -applies_to outputs \
    -clamp_value 0 \
    -isolation_signal /top/iso_en
# 5. 将隔离规则与电源状态关联起来
add_isolation_control iso_rule -location self -isolation_sense high
 
 
 
 | 
 |