systemc: Merge notify and notifyWork and ignore disabled for resets.
Always notify a process if a reset signal changed, even if it's disabled. Also, because notify was what checked disabled and only notifyWork was virtual, this change merges the two so both can be overridden without any extra virtual functions. Change-Id: I1e3563fa587aab65a5e95cd8a382ed48e093de3b Reviewed-on: https://gem5-review.googlesource.com/c/13188 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
@@ -58,7 +58,8 @@ Sensitivity::notify(Event *e)
|
||||
{
|
||||
if (process->disabled())
|
||||
return false;
|
||||
return notifyWork(e);
|
||||
satisfy();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -213,8 +214,11 @@ DynamicSensitivityEventOrList::DynamicSensitivityEventOrList(
|
||||
{}
|
||||
|
||||
bool
|
||||
DynamicSensitivityEventOrList::notifyWork(Event *e)
|
||||
DynamicSensitivityEventOrList::notify(Event *e)
|
||||
{
|
||||
if (process->disabled())
|
||||
return false;
|
||||
|
||||
events.erase(e->sc_event());
|
||||
|
||||
// All the other events need this deleted from their lists since this
|
||||
@@ -232,8 +236,11 @@ DynamicSensitivityEventAndList::DynamicSensitivityEventAndList(
|
||||
{}
|
||||
|
||||
bool
|
||||
DynamicSensitivityEventAndList::notifyWork(Event *e)
|
||||
DynamicSensitivityEventAndList::notify(Event *e)
|
||||
{
|
||||
if (process->disabled())
|
||||
return false;
|
||||
|
||||
events.erase(e->sc_event());
|
||||
|
||||
// This sensitivity is satisfied if all events have triggered.
|
||||
@@ -294,7 +301,7 @@ ResetSensitivitySignal::ResetSensitivitySignal(
|
||||
}
|
||||
|
||||
bool
|
||||
ResetSensitivitySignal::notifyWork(Event *e)
|
||||
ResetSensitivitySignal::notify(Event *e)
|
||||
{
|
||||
process->signalReset(_signal->read() == val(), sync());
|
||||
return true;
|
||||
|
||||
@@ -72,18 +72,11 @@ class Sensitivity
|
||||
virtual void addToEvent(const ::sc_core::sc_event *e) = 0;
|
||||
virtual void delFromEvent(const ::sc_core::sc_event *e) = 0;
|
||||
|
||||
virtual bool
|
||||
notifyWork(Event *e)
|
||||
{
|
||||
satisfy();
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void clear() = 0;
|
||||
|
||||
void satisfy();
|
||||
bool notify(Event *e);
|
||||
virtual bool notify(Event *e);
|
||||
|
||||
enum Category
|
||||
{
|
||||
@@ -307,7 +300,7 @@ class DynamicSensitivityEventOrList :
|
||||
DynamicSensitivityEventOrList(
|
||||
Process *p, const sc_core::sc_event_or_list *eol);
|
||||
|
||||
bool notifyWork(Event *e) override;
|
||||
bool notify(Event *e) override;
|
||||
};
|
||||
|
||||
//XXX This sensitivity can't be reused. To reset it, it has to be deleted and
|
||||
@@ -323,7 +316,7 @@ class DynamicSensitivityEventAndList :
|
||||
DynamicSensitivityEventAndList(
|
||||
Process *p, const sc_core::sc_event_and_list *eal);
|
||||
|
||||
bool notifyWork(Event *e) override;
|
||||
bool notify(Event *e) override;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -355,7 +348,7 @@ class ResetSensitivitySignal :
|
||||
Process *p, const sc_core::sc_signal_in_if<bool> *signal,
|
||||
bool _val, bool _sync);
|
||||
|
||||
bool notifyWork(Event *e) override;
|
||||
bool notify(Event *e) override;
|
||||
};
|
||||
|
||||
class ResetSensitivityPort : public ResetSensitivitySignal
|
||||
|
||||
Reference in New Issue
Block a user