当前位置:网站首页>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 .
边栏推荐
- BS-GX-016基于SSM实现教材管理系统
- 持续交付-Blue Ocean 应用
- Keepalived 实现 Redis AutoFailover (RedisHA)12
- Visual introduction to Matplotlib and plotnine
- UVM中uvm_config_db非直线的设置与获取
- 世界很大,有人把二维码纹在脖子上
- 3-wire SPI screen driving mode
- 可视化介绍 Matplotlib 和 Plotnine
- Esp32 add multi directory custom component
- How to convert an old keyboard into a USB keyboard and program it yourself?
猜你喜欢

Gaussian and Summary Stats

ESP32实验-自建web服务器配网02

getReader() has already been called for this request

JSON parsing, esp32 easy access to time, temperature and weather

每日刷题记录 (五)

buuctf-pwn write-ups (6)

Flink practical problems (VII): no watermark (watermarks are only available eventtime is used)

Pointer compression for JVM

Statistical Hypothesis Testing

使用NetworkX对社交网络进行系统的分析:Facebook网络分析案例
随机推荐
buuctf-pwn write-ups (6)
Visual introduction to Matplotlib and plotnine
Keepalived 实现 Redis AutoFailover (RedisHA)17
Buuctf PWN write UPS (6)
Solve the problem that stc8g1k08 program cannot run and port configuration
在连接数据库的时候遇到了点问题,请问怎么解决呀?
Esp32-solo development tutorial to solve config_ FREERTOS_ UNICORE problem
buuctf-pwn write-ups (6)
美团:踩雷好几年,才总结出的数据治理避坑攻略
Encapsulation of unified result set
博日科技招股书失效,中金公司已停止对其辅导,放弃港交所上市?
Basic introduction to C program structure Preview
3-wire SPI screen driving mode
Keepalived 实现 Redis AutoFailover (RedisHA)16
浏览器缓存
cookie,sessionstorage,localstorage区别
Kept to implement redis autofailover (redisha) 16
架构实战营模块五作业
清华&智源 | CogView2:更快更好的文本图像生成模型
30《MySQL 教程》MySQL 存储引擎概述