当前位置:网站首页>SystemC simulation scheduling mechanism
SystemC simulation scheduling mechanism
2022-06-12 13:55:00 【123axj】
By default , We directly use the CMake Compilation parameter compilation .so file , So we are running a SystemC When it comes to programming , Even if there are many in the code SC_THREAD / SC_METHOD Registration function for , You will also find that the program only occupies one physical CPU core.
If we compile enable 了 SC_USE_PTHREADS This macro , There will be different phenomena : every last SC_THREAD / SC_METHOD Will create a CPU Threads ; But this situation has a great impact on our simulation speed , When in our code SC_THREAD / SC_METHOD Especially when , It will seriously slow down our simulation speed , because SystemC kernel Scheduling of these threads The cost of CPU Time It's far beyond The parallel effect of multithreading . So in general , We all will disable SC_USE_PTHREADS This macro . The following is for SystemC The explanation of the scheduling mechanism also defaults that this macro is not opened .
Synopsys The company's VDK (Virtualizer Development Kit,Virtualizer Development Kit (VDK) ) The software integrates a method that can realize real parallel multi CPU Solutions for physical thread execution , This scheme is applicable to DSP 、AI There are many data processing functions such as chips 、 There are many cores SystemC module Quite friendly , Can greatly improve module Simulation speed of .
Elaboration and Simulation Phases are executed serially .
Simulation Stage , In a certain SystemC Simulation time point ,SystemC kernel Will call each one in turn SC_THREAD correlation function , Will look at each SC_METHOD Whether the sensitive event of is triggered .
In calling a SC_THREAD When associating functions , It is equivalent to that the procedural control is temporarily controlled by SystemC kernel Transfer to this function , The function will always execute , Until you encounter explicit or implicit wait call , This function is suspended , Then the control of the program turns back to SystemC kernel;SystemC kernel Then start calling the next SC_THREAD correlation function .SC_THREAD The starting point of the correlation function needs to be recorded , next SystemC Simulation moment ,SystemC kernel When you call this function again , Execute from the last hanging point . If wait The event was triggered , or wait Of ( SystemC Simulation ) Time has come to , You can jump out of wait, So let's keep going , Until I met wait Suspended again .
SC_METHOD By SystemC kernel The scheduling process is relatively simple : Look at this. SC_METHOD Whether the corresponding sensitive event is triggered , Triggered , Execute the correlation function completely once , Otherwise, we will not deal with it . because SC_METHOD Cannot have... In the correlation function of wait, therefore SystemC Simulation time does not advance .
SystemC kernel Dispatch SC_THREAD The specific process of the correlation function is complex , For details, please refer to spec Medium 4.2 Simulation chapter , Specific for evaluation 、update、delta notification 、timed notification phase. Here are spec Some key statements in .
From the set of runnable processes, select a process instance, remove it from the set, and only then trigger or resume its execution. Run the process instance immediately and without interruption up to the point where it either returns or, in the case of a thread or clocked thread process, calls the function wait or calls the member function suspend of a process handle associated with the process instance itself.
Since process instances execute without interruption, only a single process instance can be running at any one time, and no other process instance can execute until the currently executing process instance has yielded control to the kernel. A process shall not pre-empt or interrupt the execution of another process. This is known as co-routine semantics or co-operative multitasking.
Repeat this step(evaluation phase) until the set of runnable processes is empty; then go on to the update phase.
If, at the end of the delta notification phase, the set of runnable processes is non-empty, go back to the evaluation phase.
From can run processes Select a process instance in the collection , Remove it from the collection , Then trigger or resume its execution . Run the process instance now , And without interruption , Until the instance returns or ( In the case of threads or threaded processes with clocks ) Call the function of the process handle associated with the process instance itself wait Or member functions suspend until .
Because process instances execute without interruption , Therefore, only one process instance can be run at any time , And before the currently executing process instance hands control to the kernel , Other process instances cannot be executed . One process cannot preempt or interrupt the execution of another process . This is called collaborative routine semantics or cooperative multitasking .
SystemC Execution process , Need to prevent because Problems caused by scheduling sequence .
Because the order in which processes are run within the evaluation phase is not under the control of the application, access to shared storage should be explicitly synchronized to avoid non-deterministic behavior.
边栏推荐
- Codeforces 1634 F. Fibonacci additions - Fibonacci sequence addition, ideas
- CSDN blog points rule
- Now you must know the pointer
- Talk about the top 10 classic MySQL errors
- List of common ACM knowledge points (to be continued)
- Install RPM package offline using yum
- 动态搜索广告智能查找匹配关键字
- Code debugging - print log output to file
- SystemC uses SC_ report_ Handler processing log printing
- one × Convolution kernel of 1
猜你喜欢

Xcode debugging OpenGLES

NotePad 常用设置

Alibaba cloud development board haas510 responds to UART serial port instructions

Create a small root heap and judge the node relationship (also.C\u str() substr(),atoi(),string. Use of find())

Go language functions as parameters of functions

Alibaba cloud development board haas510 connects to the Internet of things platform -- Haas essay solicitation

xcode 调试openGLES
![[wustctf2020] selfie score query -1](/img/90/e4c2882357e0a1c6a80f778887e3f5.png)
[wustctf2020] selfie score query -1

数据类型转换和条件控制语句

阿裏雲開發板HaaS510報送設備屬性
随机推荐
Qualcomm platform development series (Protocol) QMI brief introduction and usage
Understanding recursion
Acwing: topology sequence
如果要打造品牌知名度,可以选择什么出价策略?
one × Convolution kernel of 1
阿里云开发板HaaS510解析串口JSON数据并发送属性
Introduction to database system (Fifth Edition) notes Chapter 1 Introduction
Lua common built-in functions
浅谈中国程序员为什么要跳槽?
Qt5 plug-in production
基于Profibus-DP协议的PLC智能从站设计
Rk3399 platform development series explanation (kernel debugging chapter) 2.50 use of systrace
肝了一个月的原创小袁个人博客项目开源啦(博客基本功能都有,还包含后台管理)
Go language functions as parameters of functions
AVFoundation
"Non" reliability of TCP
Greed issues - Egypt scores
Recursion of subviews of view
Single bus temperature sensor 18B20 data on cloud (Alibaba cloud)
Codeforces 1638 A. reverse - simple thinking