当前位置:网站首页>SystemVerilog simulation speed increase
SystemVerilog simulation speed increase
2022-06-27 01:25:00 【Alfred. HOO】
Dynamic simulation verification usually involves waiting for simulation results , Especially when debugging a test case . A lot of times , Engineers naturally think that the speed of simulation depends largely on the performance of the server running the simulation task , as well as EDA Capabilities of simulation tools . But in fact , Efficient verification environment and code quality are also the key factors that affect the simulation speed .
On the other hand , Increasing the speed of simulation , For chip engineers, it is “ Better to ask for yourself than for others ”. Improving server machine performance means greater capital investment , Higher performance simulation tools will not be achieved in a while . And explore more efficient validation methodologies , Building more efficient code is something you can do right now .
The main content of this article is from Cliff Cummings stay 2019 year DVCon Articles published at the conference :Yikes! Why is My SystemVerilog Still So Slooooow. This article mainly discusses SystemVerilog The simulation speed is the same as Coding The relationship between styles , There are detailed experimental objectives in the article 、 Methods and data results are presented . This article will extract and analyze those coding styles that have a great impact on the simulation speed .
1. Use vector operations instead of single bit operation
The emulator is doing complete vector computation faster than a single bit Calculate high . According to the data of references , Under a certain simulation tool , The maximum acceleration can reach 3 More than times .
Here is a routine , Present different code implementation styles .
2. Avoid instantiating objects in loops
This technique relates to memory allocation and recycling . Inefficient memory management can lead to severe cache miss、 Stack management overhead and garbage collection overhead , Although these are all done by the operating system .
When we need a new data structure , Body structure can be used struct You don't have to class, Instantiation of classes and garbage collection are both overhead . When creating an object , Don't just come up here new, Consider whether you can reuse previously created objects .
The following routine , The application of this technique in the three mainstream simulation tools can bring simulation speed benefits , The maximum speed is increased by more than half .
3. Conditional judgment string processing
During the simulation process, printing information or reading and writing files will lead to very slow simulation speed , After all, call the computer IO It's not efficient . stay UVM There are sound report Management mechanism , Can be set according to verbosity Level to determine whether it is necessary to print information .
In addition to information printing , The format processing of strings is also very expensive . If I borrow report To determine whether it is necessary to perform string format processing , It can effectively improve the simulation speed .
The following routine , Code with conditional judgment can bring simulation speed benefits on the three mainstream simulation tools , And the income is very large , Reached 33 times ~100 times .
4. Reduce unnecessary port sampling or driving
This is another technique to reduce unnecessary operations . Know that UVM in , operation TLM analysis port It costs a lot , Because the driver behavior of the port , All the data associated with the port will be executed through the callback mechanism consumer Port action for . Understand the implementation mechanism , Actually, I have to see UVM Source code , There is no need to expand and resolve .
Besides , Some analysis port Whether to connect to other component Is dependent on the current authentication environment , If according to analysis port To determine whether to drive the port , It can reduce some unnecessary operations .
The following routine , stay monitor Of run_phase According to its analysis port Status to sample ports and broadcast to other components , It can bring a part of the benefit of simulation speed .
5. Replace inefficient random constraints with callback functions
SystemVerilog There are many ways to randomize variables and add random constraints , For details, please refer to the other two articles in the official account 《 Hidden mystery SV randomization 》《 All kinds of SystemVerilog Random constraint 》. When designing random constraints , In addition to ensuring that constraints do not conflict ( That is, the constraint has a solution ) outside , It is also necessary to avoid invalid constraint solutions .
Actually ,SV Already available pre_randomize() / post_randomize() Two callback functions that will be executed before and after the random value is solved . Using these two functions flexibly can avoid some very inefficient constraint behaviors .
The following routine , Use post_randomize Sort the random sequence , You can avoid using loops in constraints to restrict each sequence element , Thus, the simulation speed is increased by tens of times .
边栏推荐
- Memcached foundation 6
- Object access mechanism and others
- Continuous delivery blue ocean application
- Break through the performance bottleneck of image recognition through rust language computing acceleration technology
- Basic introduction to C program structure Preview
- 美团:踩雷好几年,才总结出的数据治理避坑攻略
- ArcGIS 镶嵌数据集切片丢失问题处理
- memcached基础
- Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
- Flink practical problems (VII): no watermark (watermarks are only available eventtime is used)
猜你喜欢

Law of Large Numbers

理想L9产品力分析:售价45.98万,采用四缸发动机,续航1315公里

Gaussian and Summary Stats

Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
![Find the minimum value in the rotation sort array ii[classical Abstract dichotomy + how to break the game left, middle and right are equal]](/img/75/05d5765588dfde971167fbc72e2aa8.png)
Find the minimum value in the rotation sort array ii[classical Abstract dichotomy + how to break the game left, middle and right are equal]

Tsinghua & Zhiyuan | cogview2: faster and better text image generation model

buuctf-pwn write-ups (6)

TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘

在连接数据库的时候遇到了点问题,请问怎么解决呀?

30《MySQL 教程》MySQL 存储引擎概述
随机推荐
Law of Large Numbers
Amazon ElastiCache 飞速搭建缓存服务集群,这才叫快
Encapsulation of unified result set
Keepalived 实现 Redis AutoFailover (RedisHA)15
Account management, database building and four engines + cases of MySQL
NLP:Transformer在NLP自然语言领域的简介(预训练技术)、NLP模型发展(ELmo/GPT/BERT/MT-DNN/XLNet/RoBERTa/ALBERT)、经典案例之详细攻略
Play OLED, u8g2 animation, increasing numbers, random triangles, etc
ArcGIS 镶嵌数据集切片丢失问题处理
福元医药上市在即:募资净额将达到16亿元,胡柏藩为实际控制人
Generate flow chart with code, and how to use markdown
Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km
在连接数据库的时候遇到了点问题,请问怎么解决呀?
ESP32-添加多目录的自定义组件
Operating instructions and Q & A of cec-i China learning machine
Keepalived 实现 Redis AutoFailover (RedisHA)11
buuctf-pwn write-ups (6)
Daily question brushing record (V)
memcached基础6
Custom MVC (imported into jar package) + difference from three-tier architecture + reflection + interview questions
How to convert an old keyboard into a USB keyboard and program it yourself?