当前位置:网站首页>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 1637 D. yet another minimization problem - Mathematics, DP
- Codeforces 1638 A. reverse - simple thinking
- When the byte jumps, the Chinese 996 is output in the United States
- Interview question 17.14 Minimum number of K (almost double hundreds)
- Codeforces 1637 B. mex and array - reading, violence
- Alibaba Cloud Development Board haas510 submission Device Properties
- 编译安装基于fastcgi模式的多虚拟主机的wordpress和discuz的LAMP架构
- Display logs in the database through loganalyzer
- 2021-05-28
- 【mysql进阶】索引分类及索引优化方案(五)
猜你喜欢

【SemiDrive源码分析】【X9芯片启动流程】25 - MailBox 核间通信机制介绍(代码分析篇)之 RPMSG-IPCC RTOS & QNX篇
![[video lesson] a full set of tutorials on the design and production of Android studio Internet of things app -- all mastered during the National Day](/img/8d/3bfb5d2798797be3e0b10e25c978d3.png)
[video lesson] a full set of tutorials on the design and production of Android studio Internet of things app -- all mastered during the National Day

阿里云开发板HaaS510响应UART串口指令

什么是自动出价?它的优势是什么?

事件的传递和响应以及使用实例

Alibaba Cloud Development Board haas510 submission Device Properties

公司运营中更注重转化的出价策略,如何实现? —Google sem

Démontage et modification de la machine publicitaire - décompression amateur
![[wustctf2020] selfie score query -1](/img/dc/47626011333a0e853be87e492d8528.png)
[wustctf2020] selfie score query -1

Dismantle and modify the advertising machine - Amateur decompression
随机推荐
Time processing in C language (conversion between string and timestamp)
Leetcode questions brushing February /1020 Number of enclaves
播放器屏幕方向方案
Knowledge of wireless card driver
Introduction to database system (Fifth Edition) notes Chapter 1 Introduction
SystemC common errors
阿裏雲開發板HaaS510報送設備屬性
Codeforces 1638 D. Big Brush —— BFS
Web3.0, the era of "stimulating creativity"
AVFoundation
Codeforces 1637 A. sorting parts - simple thinking
What is the default gateway
拆改廣告機---業餘解壓
one × Convolution kernel of 1
Qt5 plug-in production
Tinyxml Usage Summary
CUDA error: CUBLAS_ STATUS_ NOT_ INITIALIZED when calling `cublasCreate(handle)`
将字符串转为16进制字符串并显示出来
After reading the question, you will point to offer 16 Integer power of numeric value
Alibaba cloud development board haas510 connects to the Internet of things platform -- Haas essay solicitation