mirror of
https://github.com/YosysHQ/yosys
synced 2025-12-17 09:48:34 +00:00
rtlil: replace SigSig actions with new type SyncAction
This commit is contained in:
parent
5594b817cd
commit
31fde78a09
19 changed files with 305 additions and 252 deletions
|
|
@ -117,6 +117,7 @@ namespace RTLIL
|
|||
struct CaseRule;
|
||||
struct SwitchRule;
|
||||
struct MemWriteAction;
|
||||
struct SyncAction;
|
||||
struct SyncRule;
|
||||
struct Process;
|
||||
struct Binding;
|
||||
|
|
@ -1269,6 +1270,13 @@ struct RTLIL::AttrObject
|
|||
std::string get_src_attribute() const {
|
||||
return get_string_attribute(ID::src);
|
||||
}
|
||||
void transfer_attribute(const AttrObject* from, const IdString& attr) {
|
||||
if (from->has_attribute(attr))
|
||||
attributes[attr] = from->attributes.at(attr);
|
||||
}
|
||||
void transfer_src_attribute(const AttrObject* from) {
|
||||
transfer_attribute(from, ID::src);
|
||||
}
|
||||
|
||||
void set_hdlname_attribute(const vector<string> &hierarchy);
|
||||
vector<string> get_hdlname_attribute() const;
|
||||
|
|
@ -2532,7 +2540,7 @@ public:
|
|||
struct RTLIL::CaseRule : public RTLIL::AttrObject
|
||||
{
|
||||
std::vector<RTLIL::SigSpec> compare;
|
||||
std::vector<RTLIL::SigSig> actions;
|
||||
std::vector<RTLIL::SyncAction> actions;
|
||||
std::vector<RTLIL::SwitchRule*> switches;
|
||||
|
||||
~CaseRule();
|
||||
|
|
@ -2567,11 +2575,17 @@ struct RTLIL::MemWriteAction : RTLIL::AttrObject
|
|||
RTLIL::Const priority_mask;
|
||||
};
|
||||
|
||||
struct RTLIL::SyncAction
|
||||
{
|
||||
RTLIL::SigSpec lhs;
|
||||
RTLIL::SigSpec rhs;
|
||||
};
|
||||
|
||||
struct RTLIL::SyncRule
|
||||
{
|
||||
RTLIL::SyncType type;
|
||||
RTLIL::SigSpec signal;
|
||||
std::vector<RTLIL::SigSig> actions;
|
||||
std::vector<RTLIL::SyncAction> actions;
|
||||
std::vector<RTLIL::MemWriteAction> mem_write_actions;
|
||||
|
||||
template<typename T> void rewrite_sigspecs(T &functor);
|
||||
|
|
@ -2703,8 +2717,8 @@ void RTLIL::CaseRule::rewrite_sigspecs(T &functor) {
|
|||
for (auto &it : compare)
|
||||
functor(it);
|
||||
for (auto &it : actions) {
|
||||
functor(it.first);
|
||||
functor(it.second);
|
||||
functor(it.lhs);
|
||||
functor(it.rhs);
|
||||
}
|
||||
for (auto it : switches)
|
||||
it->rewrite_sigspecs(functor);
|
||||
|
|
@ -2715,7 +2729,7 @@ void RTLIL::CaseRule::rewrite_sigspecs2(T &functor) {
|
|||
for (auto &it : compare)
|
||||
functor(it);
|
||||
for (auto &it : actions) {
|
||||
functor(it.first, it.second);
|
||||
functor(it.lhs, it.rhs);
|
||||
}
|
||||
for (auto it : switches)
|
||||
it->rewrite_sigspecs2(functor);
|
||||
|
|
@ -2742,8 +2756,8 @@ void RTLIL::SyncRule::rewrite_sigspecs(T &functor)
|
|||
{
|
||||
functor(signal);
|
||||
for (auto &it : actions) {
|
||||
functor(it.first);
|
||||
functor(it.second);
|
||||
functor(it.lhs);
|
||||
functor(it.rhs);
|
||||
}
|
||||
for (auto &it : mem_write_actions) {
|
||||
functor(it.address);
|
||||
|
|
@ -2757,7 +2771,7 @@ void RTLIL::SyncRule::rewrite_sigspecs2(T &functor)
|
|||
{
|
||||
functor(signal);
|
||||
for (auto &it : actions) {
|
||||
functor(it.first, it.second);
|
||||
functor(it.lhs, it.rhs);
|
||||
}
|
||||
for (auto &it : mem_write_actions) {
|
||||
functor(it.address);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue