process.cc (13006:f4e4f859d114) | process.cc (13063:c9905ead0041) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 25 unchanged lines hidden (view full) --- 34#include "systemc/core/scheduler.hh" 35#include "systemc/ext/core/sc_process_handle.hh" 36#include "systemc/ext/utils/sc_report_handler.hh" 37 38namespace sc_gem5 39{ 40 41SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) : | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 25 unchanged lines hidden (view full) --- 34#include "systemc/core/scheduler.hh" 35#include "systemc/ext/core/sc_process_handle.hh" 36#include "systemc/ext/utils/sc_report_handler.hh" 37 38namespace sc_gem5 39{ 40 41SensitivityTimeout::SensitivityTimeout(Process *p, ::sc_core::sc_time t) : |
42 Sensitivity(p), timeoutEvent(this), time(t) | 42 Sensitivity(p), timeoutEvent([this]() { this->timeout(); }) |
43{ | 43{ |
44 Tick when = scheduler.getCurTick() + time.value(); 45 scheduler.schedule(&timeoutEvent, when); | 44 scheduler.schedule(&timeoutEvent, t); |
46} 47 48SensitivityTimeout::~SensitivityTimeout() 49{ 50 if (timeoutEvent.scheduled()) 51 scheduler.deschedule(&timeoutEvent); 52} 53 54void 55SensitivityTimeout::timeout() 56{ | 45} 46 47SensitivityTimeout::~SensitivityTimeout() 48{ 49 if (timeoutEvent.scheduled()) 50 scheduler.deschedule(&timeoutEvent); 51} 52 53void 54SensitivityTimeout::timeout() 55{ |
57 scheduler.eventHappened(); | |
58 notify(); 59} 60 61SensitivityEvent::SensitivityEvent( 62 Process *p, const ::sc_core::sc_event *e) : Sensitivity(p), event(e) 63{ 64 Event::getFromScEvent(event)->addSensitivity(this); 65} --- 332 unchanged lines hidden --- | 56 notify(); 57} 58 59SensitivityEvent::SensitivityEvent( 60 Process *p, const ::sc_core::sc_event *e) : Sensitivity(p), event(e) 61{ 62 Event::getFromScEvent(event)->addSensitivity(this); 63} --- 332 unchanged lines hidden --- |