ubuntu搭建verilator仿真环境

您所在的位置:网站首页 vcd设置 ubuntu搭建verilator仿真环境

ubuntu搭建verilator仿真环境

2024-07-09 21:32:29| 来源: 网络整理| 查看: 265

文章目录 安装流程简单C++测试用例真实电路模块自动化Makefile脚本

Ubuntu(22.04.2 LTS)中,使用verilator开源verilog仿真工具,进行RTL功能仿真。现构建版本为5.008的verilator仿真环境。

安装流程

安装依赖

sudo apt-get install git perl python3 make autoconf g++ flex bison ccache sudo apt-get install libgoogle-perftools-dev numactl perl-doc sudo apt-get install libfl2 sudo apt-get install libfl-dev sudo apt-get install zlibc zlib1g zlib1g-dev

获取源码

git clone https://github.com/verilator/verilator

选择合适的版本(5.008)

unsetenv VERILATOR_ROOT unset VERILATOR_ROOT cd verilator git pull git tag git checkout v5.008

编译

autoconf ./configure make sudo make install 简单C++测试用例

创建测试文件夹test_our

mkdir test_our cd test_our

创建Verilog/SystemVerilog文件our.v,内容如下

cat >our.v eval(); } delete top; delete contextp; return 0; } EOF

使用verilator仿真

verilator --cc --exe --build -Wall sim_main.cpp our.v --cc:获取C++输出。--exe:创建可执行文件。--build:verilator自动进行make。Wall:更严格的warning检查。 运行仿真 obj_dir/Vour

真实电路模块

现在测试真实电路模块,并记录仿真过程。 创建Verilog/SystemVerilog文件top.v,内容如下

module top( input a, input b, output f ); assign f = a ^ b; endmodule

将Verilog/SystemVerilog文件转换(Verilate)成C++

# --cc表示将文件转换成C++ verilator -cc top.v

转换后会生成文件夹obj_dir,包含转换后所有的文件 在这里插入图片描述

创建C++ testbench文件tb_top.cpp,内容如下

#include #include #include #include "verilated.h" #include "verilated_vcd_c.h" #include "Vtop.h" #define MAX_SIM_TIME 20 vluint64_t sim_time = 0; int main(int argc, char** argv) { Vtop *dut = new Vtop; Verilated::traceEverOn(true); VerilatedVcdC* m_trace = new VerilatedVcdC; dut->trace(m_trace, 5); m_trace->open("waveform.vcd"); while (sim_time


【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭