From 4cc74346f11e96b9a2bce1c984c674a22771a00a Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 20 Aug 2019 20:27:05 -0700 Subject: [PATCH] Fix compile error --- passes/pmgen/ice40_dsp.cc | 4 ---- passes/pmgen/ice40_dsp.pmg | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/passes/pmgen/ice40_dsp.cc b/passes/pmgen/ice40_dsp.cc index a1a397b83..31e11c742 100644 --- a/passes/pmgen/ice40_dsp.cc +++ b/passes/pmgen/ice40_dsp.cc @@ -23,10 +23,6 @@ USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN -template inline bool includes(const T &lhs, const T &rhs) { - return std::includes(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); -} -#include #include "passes/pmgen/ice40_dsp_pm.h" void create_ice40_dsp(ice40_dsp_pm &pm) diff --git a/passes/pmgen/ice40_dsp.pmg b/passes/pmgen/ice40_dsp.pmg index cf7957ff3..24bdfd3f2 100644 --- a/passes/pmgen/ice40_dsp.pmg +++ b/passes/pmgen/ice40_dsp.pmg @@ -34,7 +34,6 @@ match ffA if mul->type != \SB_MAC16 || !param(mul, \A_REG).as_bool() if !sigAset.empty() select ffA->type.in($dff) - filter includes(port(ffA, \Q).to_sigbit_set(), sigAset) optional endmatch @@ -42,6 +41,10 @@ code sigA clock clock_pol sigA = port(mul, \A); if (ffA) { + auto ffAset = port(ffA, \Q).to_sigbit_set(); + if (!std::includes(ffAset.begin(), ffAset.end(), sigAset.begin(), sigAset.end())) + reject; + for (auto b : port(ffA, \Q)) if (b.wire->get_bool_attribute(\keep)) reject; @@ -57,7 +60,6 @@ match ffB if mul->type != \SB_MAC16 || !param(mul, \B_REG).as_bool() if !sigBset.empty() select ffB->type.in($dff) - filter includes(port(ffB, \Q).to_sigbit_set(), sigBset) optional endmatch @@ -65,6 +67,10 @@ code sigB clock clock_pol sigB = port(mul, \B); if (ffB) { + auto ffBset = port(ffB, \Q).to_sigbit_set(); + if (!std::includes(ffBset.begin(), ffBset.end(), sigBset.begin(), sigBset.end())) + reject; + for (auto b : port(ffB, \Q)) if (b.wire->get_bool_attribute(\keep)) reject; @@ -207,7 +213,9 @@ code if (ffO_lo) { SigSpec O = sigOused.extract(0,std::min(16,param(ffO_lo, \WIDTH).as_int())); O.remove_const(); - if (!includes(port(ffO_lo, \D).to_sigbit_set(), O.to_sigbit_set())) + auto ffO_loSet = port(ffO_lo, \D).to_sigbit_set(); + auto Oset = O.to_sigbit_set(); + if (!std::includes(ffO_loSet.begin(), ffO_loSet.end(), Oset.begin(), Oset.end())) reject; } endcode @@ -223,7 +231,9 @@ code if (ffO_hi) { SigSpec O = sigOused.extract_end(16); O.remove_const(); - if (!includes(port(ffO_hi, \D).to_sigbit_set(), O.to_sigbit_set())) + auto ffO_hiSet = port(ffO_hi, \D).to_sigbit_set(); + auto Oset = O.to_sigbit_set(); + if (!std::includes(ffO_hiSet.begin(), ffO_hiSet.end(), Oset.begin(), Oset.end())) reject; } endcode -- 2.30.2