aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-08-05 16:31:35 +0100
committerDavid Shah <dave@ds0.me>2019-08-05 17:22:37 +0100
commitec48f8f464a63dece47e9af903098387088c68c5 (patch)
tree9573b37b3bb55d2e503817e427269d12102293d4 /common
parent1839a3a770a71c928b92bf876e04728d2649e425 (diff)
downloadnextpnr-ec48f8f464a63dece47e9af903098387088c68c5.tar.gz
nextpnr-ec48f8f464a63dece47e9af903098387088c68c5.tar.bz2
nextpnr-ec48f8f464a63dece47e9af903098387088c68c5.zip
ecp5: New Property interface
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.cc2
-rw-r--r--common/nextpnr.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index 8f172422..0d89b55a 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -135,7 +135,7 @@ Property::Property() : is_string(false), str(""), intval(0) {}
Property::Property(int64_t intval, int width) : is_string(false), intval(intval)
{
- str.resize(width);
+ str.reserve(width);
for (int i = 0; i < width; i++)
str.push_back((intval & (1ULL << i)) ? S1 : S0);
}
diff --git a/common/nextpnr.h b/common/nextpnr.h
index efa326c0..177048bf 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -333,6 +333,7 @@ struct Property
NPNR_ASSERT(!is_string);
for (auto c : str)
result.push_back(c == S1);
+ return result;
}
std::string as_string() const
{