当前位置:网站首页>SystemC:SC_ Thread and SC_ METHOD
SystemC:SC_ Thread and SC_ METHOD
2022-06-12 13:55:00 【123axj】
SC_THREAD / SC_METHOD All are spec Mentioned in processes,SC_CTHREAD Rarely used , Not much discussed here .
SC_THREAD / SC_METHOD Itself is a SystemC Defined macro , In the source code, we can find the corresponding actual execution statement , In fact, it is to add the corresponding function in parentheses to SystemC kernel In the scheduling list in .SC_THREAD / SC_METHOD Must be in a module Or before_end_of_elaboration / end_of_elaboration Use in . If you want to Simulation Phase dynamically creates a thread or method, You need to use sc_pawn.
A process may call function sc_spawn to create a spawned process instance, in which case the new process instance shall be added to the set of runnable processes (unless function sc_spawn_options::dont_initialize is called) and subsequently executed in this very same evaluation phase.
sc_process_handle sc_get_current_process_handle() You can get the handle of the last registered function closest to it , And then you can do it in Simulation Stage disable / enable This processes.
SC_METHOD There has to be a sensitive List of sensitive events ;SC_THREAD Generally, it does not follow the sensitive list , Of course, you can also add .
SC_METHOD The call logic of the associated function is , When a sensitive event is triggered (notify) When , The function is called completely once , A function cannot have any wait Function call .
SC_THREAD The call logic for is ,Simulation The stage is called once , And in the whole Simulation The phase will only be called once , So in general SC_THREAD Will use while(1) To avoid function exit .SC_THREAD It is generally required that there must be explicit or implicit wait call , Otherwise SystemC Procedure stagnation , That is to say SystemC Simulation time does not advance , Has been while(1) In the implementation of , This is also the most common mistake for novices , And this kind of mistake is debug The process is very easy to ignore .
SC_THREAD Sensitive lists of are only encountered in functions wait() or wait(int) It works , At this point, you need to wait for the sensitive list to be triggered , Equivalent to using... In a function wait( Sensitive list Events ).
边栏推荐
猜你喜欢

Alicloud development board vscode development environment setup

Implementing singleton mode of database under QT multithreading

通过loganalyzer展示数据库中的日志

Go zero micro Service Practice Series (II. Service splitting)

Data type conversion and conditional control statements

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

MySQL 查询 limit 1000,10 和 limit 10 速度一样快吗? 深度分页如何破解
Introduction to color coding format

【mysql进阶】索引分类及索引优化方案(五)

Qt5 plug-in production
随机推荐
Codeforces 1637 A. sorting parts - simple thinking
Codeforces 1638 D. Big Brush —— BFS
Bridging and net
Void pointer (void*) usage
Introduction to database system (Fifth Edition) notes Chapter 1 Introduction
Return value of WaitForSingleObject
阿里云开发板HaaS510解析串口JSON数据并发送属性
AVFoundation
Implementing singleton mode of database under QT multithreading
GPUImage链式纹理的简单实现
What is the default gateway
CSDN博客积分规则
Alibaba cloud development board haas510 sends the serial port data to the Internet of things platform
Summary of virtual box usage problems
一种快速创建测试窗口的方法
D1 Nezha Development Board understands the basic startup and loading process
如何使用android studio制作一个阿里云物联网APP
[semidrive source code analysis] [x9 chip startup process] 25 - Introduction to mailbox inter core communication mechanism (code analysis) rpmsg-ipcc RTOS & QNX
单总线温度传感器18B20数据上云(阿里云)
Data type conversion and conditional control statements