aboutsummaryrefslogtreecommitdiffstats
path: root/passes/memory
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-12-17 00:25:08 -0800
committerEddie Hung <eddie@fpgeh.com>2019-12-17 00:25:08 -0800
commitdccd7eb39f897f7fb04b038ee8ac11e676a8ea77 (patch)
tree056d840f872f1d1721262d0d053af9dcc93c3903 /passes/memory
parenta73f96594f4688afc85098b485ef7788e79f5c33 (diff)
downloadyosys-dccd7eb39f897f7fb04b038ee8ac11e676a8ea77.tar.gz
yosys-dccd7eb39f897f7fb04b038ee8ac11e676a8ea77.tar.bz2
yosys-dccd7eb39f897f7fb04b038ee8ac11e676a8ea77.zip
Cleanup
Diffstat (limited to 'passes/memory')
-rw-r--r--passes/memory/memory_bram.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/passes/memory/memory_bram.cc b/passes/memory/memory_bram.cc
index e0970d192..24478f2ee 100644
--- a/passes/memory/memory_bram.cc
+++ b/passes/memory/memory_bram.cc
@@ -330,7 +330,7 @@ struct rules_t
if (GetSize(tokens) >= 2 && tokens[0] == "attribute") {
data.attributes.emplace_back();
- for (int idx = 1; idx <= GetSize(tokens)-1; idx++) {
+ for (int idx = 1; idx < GetSize(tokens); idx++) {
size_t c1 = tokens[idx][0] == '!' ? 1 : 0;
size_t c2 = tokens[idx].find("=");
bool exists = (c1 == 0);
@@ -854,12 +854,10 @@ grow_read_ports:;
if (!exists)
ss << "!";
IdString key = std::get<1>(sums.front());
- ss << key.str();
+ ss << log_id(key);
const Const &value = std::get<2>(sums.front());
- if (exists)
- ss << "=";
- if (value != Const(1))
- ss << "\"" << value.decode_string() << "\"";
+ if (exists && value != Const(1))
+ ss << "=\"" << value.decode_string() << "\"";
log(" Rule for bram type %s rejected: requirement 'attribute %s ...' not met.\n",
log_id(match.name), ss.str().c_str());
@@ -1180,12 +1178,10 @@ void handle_cell(Cell *cell, const rules_t &rules)
if (!exists)
ss << "!";
IdString key = std::get<1>(sums.front());
- ss << key.str();
+ ss << log_id(key);
const Const &value = std::get<2>(sums.front());
- if (exists)
- ss << "=";
- if (value != Const(1))
- ss << "\"" << value.decode_string() << "\"";
+ if (exists && value != Const(1))
+ ss << "=\"" << value.decode_string() << "\"";
log(" Rule for bram type %s (variant %d) rejected: requirement 'attribute %s ...' not met.\n",
log_id(bram.name), bram.variant, ss.str().c_str());