mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-05 13:56:04 +00:00
rtlil: replace SigSig actions with new type SyncAction
This commit is contained in:
parent
37875fdedf
commit
1eb696c786
19 changed files with 305 additions and 252 deletions
|
|
@ -116,6 +116,7 @@ namespace RTLIL
|
|||
struct CaseRule;
|
||||
struct SwitchRule;
|
||||
struct MemWriteAction;
|
||||
struct SyncAction;
|
||||
struct SyncRule;
|
||||
struct Process;
|
||||
struct Binding;
|
||||
|
|
@ -1113,6 +1114,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;
|
||||
|
|
@ -2194,7 +2202,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();
|
||||
|
|
@ -2229,11 +2237,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);
|
||||
|
|
@ -2363,8 +2377,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);
|
||||
|
|
@ -2375,7 +2389,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);
|
||||
|
|
@ -2402,8 +2416,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);
|
||||
|
|
@ -2417,7 +2431,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