fastmodel: Change the Signal proxies to use Signal*Port<bool>.
Change-Id: Ia1aa32d5ea50ff4cc47d1d72a9c25dabd6c30de9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66674 Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
This commit is contained in:
@@ -87,7 +87,7 @@ class SignalReceiver : public amba_pv::signal_slave_base<bool>
|
||||
class SignalReceiverInt : public SignalReceiver
|
||||
{
|
||||
public:
|
||||
using IntPin = IntSourcePin<SignalReceiverInt>;
|
||||
using IntPin = SignalSourcePort<bool>;
|
||||
|
||||
explicit SignalReceiverInt(const std::string &name)
|
||||
: SignalReceiver(name)
|
||||
@@ -95,7 +95,7 @@ class SignalReceiverInt : public SignalReceiver
|
||||
onChange([this](bool status) {
|
||||
for (auto &signal : signalOut) {
|
||||
if (signal && signal->isConnected())
|
||||
status ? signal->raise() : signal->lower();
|
||||
signal->set(status);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -108,7 +108,7 @@ class SignalReceiverInt : public SignalReceiver
|
||||
}
|
||||
if (!signalOut[idx]) {
|
||||
signalOut[idx] = std::make_unique<IntPin>(
|
||||
csprintf("%s.signalOut[%d]", get_name(), idx), idx, this);
|
||||
csprintf("%s.signalOut[%d]", get_name(), idx), idx);
|
||||
}
|
||||
return *signalOut[idx];
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <amba_pv.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include "dev/intpin.hh"
|
||||
#include "sim/signal.hh"
|
||||
|
||||
namespace gem5
|
||||
{
|
||||
@@ -42,14 +42,13 @@ GEM5_DEPRECATED_NAMESPACE(FastModel, fastmodel);
|
||||
namespace fastmodel
|
||||
{
|
||||
|
||||
class SignalSender : public IntSinkPinBase
|
||||
class SignalSender : public SignalSinkPort<bool>
|
||||
{
|
||||
public:
|
||||
amba_pv::signal_master_port<bool> signal_out;
|
||||
|
||||
SignalSender(const std::string &_name, PortID _id) :
|
||||
IntSinkPinBase(_name, _id, 0),
|
||||
signal_out((_name + ".sig").c_str())
|
||||
SignalSinkPort(_name, _id), signal_out((_name + ".sig").c_str())
|
||||
{
|
||||
onChange([this](const bool &new_val) {
|
||||
signal_out.set_state(id, new_val);
|
||||
|
||||
Reference in New Issue
Block a user