⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pli02.v

📁 你自己漫漫理解吧
💻 V
字号:
// PLI example for initializing memory

module test;
  reg [3:0] mem4[0:15];
  integer   ndx;

  initial
    begin
      // Method 1, passing each memory element at a time
      for (ndx = 0; ndx < 16; ndx = ndx + 1)
        $pli02(ndx, mem4[ndx]);

      // Display contents
      for (ndx = 0; ndx < 16; ndx = ndx + 1)
        $display("%d %d", ndx, mem4[ndx]);

      // Reset memory to Unknown.
      for (ndx = 0; ndx < 16; ndx = ndx + 1)
          mem4[ndx] = 4'bx;

      // Method 2, fill the entire memory at once
      $pli02a();

      // Display contents
      for (ndx = 0; ndx < 16; ndx = ndx + 1)
        $display("%d %b", ndx, mem4[ndx]);

      $finish;
    end
endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -