科学文献
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
• proc_handle.disable() disables process
– does not run again till process is enabled – {new effective sensitivity} = NULL – does not remember effective sensitivity triggering while disabled
• Each method takes optional argument that specifies if the action also applies to descendant processes • Two convenience functions on top of core API for SC_THREAD process
Outline
• •
Motivation Process Control Constructs
– List of Constructs – Semanti来自百度文库s – Application Examples
•
Conclusions and Future Work
2
February 21, 2007
Motivation
– reset_signal_is() and async_reset_signal_is() – allows SC_CTHREAD to be deprecated
4
February 21, 2007
Suspending and Resuming a Process
• proc_handle.suspend() suspends process
0 Clock 10 20 30
• proc_handle.resume() lifts any previous suspensions
– notifies resume_event – has no effect if process was not suspended
Proc Execution
10
if (lo_pwr_mode) { … wait(); … } else { // regular power … wait(); … throw_it } } // try catch (lo_pwr_excp x) { lo_pwr_mode = true; } // catch } // while (1) } // main_loop
6
Proc Execution
• proc_handle.enable() lifts any previous disables
Proc Execution
Time
suspend resume
disable enable
February 21, 2007
Killing and Resetting a Process (Asynchronous)
Time
• If effective sensitivity triggered while process was suspended, resume() will execute process
5
suspend resume
February 21, 2007
Disabling and Enabling a Process
INVENTIVE
Language Extensions to SystemC: Process Control Constructs
Bishnupriya Bhattacharya, John Rose, Stuart Swan
Cadence Design Systems NASCUG, Feb 21, 2007
– Identify the minimal set of extensions necessary for scheduler modeling in SystemC – Develop scheduler models using these extensions
• • • •
11
February 21, 2007
8
February 21, 2007
Throwing a C++ Exception in a Process
template <typename T> sc_process_handle:: throw_it(const T& excp) • immediate/asynchronous effect • throws user-defined exception excp in target process stack • target process catches the exception and waits or returns • control returns to the initiator process
•
Process control constructs required in a variety of applications
– Testbench – RTOS modeling – Abstract (high-level) modeling of hardware systems
•
Well known deficiency in SystemC
Questions ?
12
February 21, 2007
Application Example: TestBench
Test
standard requests asynchronous events
Traffic Generator
DUT
•
Traffic Generator takes requests from Test and processes those
– does not run again until process is resumed – {new effective sensitivity} = {old effective sensitivity} && resume_event – remembers effective sensitivity triggering while suspended
February 21, 2007
Conclusions and Future Work
• Developed a fundamental, general purpose, and minimal set of process control extensions to SystemC language Applicable to a wide range of modeling needs Implemented in Cadence Incisive™ Simulator Submitted to OSCI LWG for standardization Future Work
7
February 21, 2007
Resetting a Thread Process (Synchronous)
• Timing is distinct from asynchronous reset
– no immediate effect
• proc_handle.sync_reset(sc_on) sets process to be in reset_state such that every time its effective sensitivity triggers, process is reset • proc_handle.sync_reset(sc_off) sets process state back to normal
reset void run() { // init state ….. wait(); // steady state { ….. wait(); …. } } // run kill
• proc_handle.reset() resets a process
– same effect as kill – in addition resets sensitivity to time 0 state => static sensitivity – a thread process is re-run from the beginning until it waits or returns – control returns to the initiator process
• proc_handle.kill() terminates a process
– immediate, asynchronous effect – an exception (sc_kill_exception) is thrown in the target process that unwinds its stack and exits its function – control returns to the initiator process
SC_MODULE(graphics_coprocessor) { ….. class lo_pwr_excp { }; sc_process_handle loop_handle; SC_CTOR(graphics_coprocessor) { SC_THREAD(lo_pwr_monitor); SC_THREAD(main_loop); loop_handle = sc_get_current_process_handle(); } }; void lo_pwr_monitor() { while (1) { wait(lo_pwr_event); loop_handle.throw_it(lo_pwr_excp); } // while (1) } // lo_pwr_monitor
– Partially addressed in SystemC 3.0 spec
3
February 21, 2007
Process Control Constructs
• New member methods in sc_process_handle class
– suspend() and resume() – – – – – disable() and enable() kill() reset() – asynchronous reset sync_reset()– synchronous reset throw_it()
– Needs to handle asynchronous events like bus reset
9
February 21, 2007
Application Example: Abstract HW Modeling
• Graphics co-processor inside laptop void main_loop() { • Needs to immediately handle laptop // graphics co-processor going from AC power to battery while (1) { power try {
Clock
0
10
20
30
– has no effect if process was not disabled – restores {old effective sensitivity}
• If effective sensitivity triggered while process was disabled, enable() will NOT execute process
• SystemC today
– Kernel scheduler schedules processes to run – Application can • specify events that a process is sensitive to • notify events – No direct control of one process from another
– does not run again till process is enabled – {new effective sensitivity} = NULL – does not remember effective sensitivity triggering while disabled
• Each method takes optional argument that specifies if the action also applies to descendant processes • Two convenience functions on top of core API for SC_THREAD process
Outline
• •
Motivation Process Control Constructs
– List of Constructs – Semanti来自百度文库s – Application Examples
•
Conclusions and Future Work
2
February 21, 2007
Motivation
– reset_signal_is() and async_reset_signal_is() – allows SC_CTHREAD to be deprecated
4
February 21, 2007
Suspending and Resuming a Process
• proc_handle.suspend() suspends process
0 Clock 10 20 30
• proc_handle.resume() lifts any previous suspensions
– notifies resume_event – has no effect if process was not suspended
Proc Execution
10
if (lo_pwr_mode) { … wait(); … } else { // regular power … wait(); … throw_it } } // try catch (lo_pwr_excp x) { lo_pwr_mode = true; } // catch } // while (1) } // main_loop
6
Proc Execution
• proc_handle.enable() lifts any previous disables
Proc Execution
Time
suspend resume
disable enable
February 21, 2007
Killing and Resetting a Process (Asynchronous)
Time
• If effective sensitivity triggered while process was suspended, resume() will execute process
5
suspend resume
February 21, 2007
Disabling and Enabling a Process
INVENTIVE
Language Extensions to SystemC: Process Control Constructs
Bishnupriya Bhattacharya, John Rose, Stuart Swan
Cadence Design Systems NASCUG, Feb 21, 2007
– Identify the minimal set of extensions necessary for scheduler modeling in SystemC – Develop scheduler models using these extensions
• • • •
11
February 21, 2007
8
February 21, 2007
Throwing a C++ Exception in a Process
template <typename T> sc_process_handle:: throw_it(const T& excp) • immediate/asynchronous effect • throws user-defined exception excp in target process stack • target process catches the exception and waits or returns • control returns to the initiator process
•
Process control constructs required in a variety of applications
– Testbench – RTOS modeling – Abstract (high-level) modeling of hardware systems
•
Well known deficiency in SystemC
Questions ?
12
February 21, 2007
Application Example: TestBench
Test
standard requests asynchronous events
Traffic Generator
DUT
•
Traffic Generator takes requests from Test and processes those
– does not run again until process is resumed – {new effective sensitivity} = {old effective sensitivity} && resume_event – remembers effective sensitivity triggering while suspended
February 21, 2007
Conclusions and Future Work
• Developed a fundamental, general purpose, and minimal set of process control extensions to SystemC language Applicable to a wide range of modeling needs Implemented in Cadence Incisive™ Simulator Submitted to OSCI LWG for standardization Future Work
7
February 21, 2007
Resetting a Thread Process (Synchronous)
• Timing is distinct from asynchronous reset
– no immediate effect
• proc_handle.sync_reset(sc_on) sets process to be in reset_state such that every time its effective sensitivity triggers, process is reset • proc_handle.sync_reset(sc_off) sets process state back to normal
reset void run() { // init state ….. wait(); // steady state { ….. wait(); …. } } // run kill
• proc_handle.reset() resets a process
– same effect as kill – in addition resets sensitivity to time 0 state => static sensitivity – a thread process is re-run from the beginning until it waits or returns – control returns to the initiator process
• proc_handle.kill() terminates a process
– immediate, asynchronous effect – an exception (sc_kill_exception) is thrown in the target process that unwinds its stack and exits its function – control returns to the initiator process
SC_MODULE(graphics_coprocessor) { ….. class lo_pwr_excp { }; sc_process_handle loop_handle; SC_CTOR(graphics_coprocessor) { SC_THREAD(lo_pwr_monitor); SC_THREAD(main_loop); loop_handle = sc_get_current_process_handle(); } }; void lo_pwr_monitor() { while (1) { wait(lo_pwr_event); loop_handle.throw_it(lo_pwr_excp); } // while (1) } // lo_pwr_monitor
– Partially addressed in SystemC 3.0 spec
3
February 21, 2007
Process Control Constructs
• New member methods in sc_process_handle class
– suspend() and resume() – – – – – disable() and enable() kill() reset() – asynchronous reset sync_reset()– synchronous reset throw_it()
– Needs to handle asynchronous events like bus reset
9
February 21, 2007
Application Example: Abstract HW Modeling
• Graphics co-processor inside laptop void main_loop() { • Needs to immediately handle laptop // graphics co-processor going from AC power to battery while (1) { power try {
Clock
0
10
20
30
– has no effect if process was not disabled – restores {old effective sensitivity}
• If effective sensitivity triggered while process was disabled, enable() will NOT execute process
• SystemC today
– Kernel scheduler schedules processes to run – Application can • specify events that a process is sensitive to • notify events – No direct control of one process from another