vivado xsim 终端 模拟

只模拟的话直接终端运行会快很多

计数器举例

c 复制代码
mkdir src

counter.v

c 复制代码
module counter(
  input wire clk,
  input wire rst_n,
  output reg[31:0] cnt 
);
always @(posedge clk or negedge rst_n)
  if(!rst_n)
    cnt <= 31'h0;
  else
    cnt <= cnt+1;

endmodule  

tb.v

c 复制代码
module tb;
wire[31:0] out;
reg clk;
reg rst_n;

initial begin
  #10 clk <= 1'b0;
  #10 rst_n = 1'b0;
  #10 rst_n = 1'b1;
  #5000 $finish;
end

always #1 clk = ~clk;

counter c1(clk,rst_n,out);

endmodule  

编译 创建模拟snapshot

c 复制代码
mkdir sim
cd sim
xvlog ../src/counter.v ../src/tb.v
xelab -debug typical -top tb -snapshot tb

创建脚本

xsim_cfg.tcl

c 复制代码
 log_wave -recursive *
 run all
 exit  
c 复制代码
xsim tb --tclbatch xsim_cfg.tcl

打开gui

c 复制代码
xsim --gui tb.wdb
相关推荐
风_峰2 天前
Ubuntu Linux SD卡分区操作
嵌入式硬件·ubuntu·fpga开发
FPGA_Linuxer2 天前
FPGA 40 DAC线缆和光模块带光纤实现40G UDP差异
网络协议·fpga开发·udp
风_峰2 天前
Petalinux相关配置——ZYNQ通过eMMC启动
嵌入式硬件·ubuntu·fpga开发
风_峰2 天前
【ZYNQ开发篇】Petalinux和电脑端的静态ip地址配置
网络·嵌入式硬件·tcp/ip·ubuntu·fpga开发
碎碎思3 天前
一块板子,玩转 HDMI、USB、FPGA ——聊聊开源项目 HDMI2USB-Numato-Opsis
fpga开发
ooo-p3 天前
FPGA学习篇——Verilog学习Led灯的实现
学习·fpga开发
嵌入式-老费3 天前
Zynq开发实践(FPGA之选择开发板)
fpga开发
风_峰3 天前
PuTTY软件访问ZYNQ板卡的Linux系统
linux·服务器·嵌入式硬件·fpga开发
电子凉冰3 天前
FPGA入门-状态机
fpga开发
Aczone283 天前
硬件(十)IMX6ULL 中断与时钟配置
arm开发·单片机·嵌入式硬件·fpga开发