Fix max conditions, add doc
diff --git a/passes/memory/memory_bram.cc b/passes/memory/memory_bram.cc
index 52e7ac7..cd8c9c5 100644
--- a/passes/memory/memory_bram.cc
+++ b/passes/memory/memory_bram.cc
@@ -797,6 +797,7 @@
match_properties["dcells"] = ((mem_width + bram.dbits - 1) / bram.dbits);
match_properties["acells"] = ((mem_size + (1 << bram.abits) - 1) / (1 << bram.abits));
match_properties["cells"] = match_properties["dcells"] * match_properties["acells"] * match_properties["dups"];
+
log(" Updated properties: dups=%d waste=%d efficiency=%d\n",
match_properties["dups"], match_properties["waste"], match_properties["efficiency"]);
@@ -814,6 +815,8 @@
if (!match_properties.count(it.first))
log_error("Unknown property '%s' in match rule for bram type %s.\n",
it.first.c_str(), log_id(match.name));
+ if (match_properties[it.first] <= it.second)
+ continue;
log(" Rule for bram type %s rejected: requirement 'max %s %d' not met.\n",
log_id(match.name), it.first.c_str(), it.second);
return false;
@@ -1266,6 +1269,11 @@
log(" dcells ....... number of cells in 'data-direction'\n");
log(" cells ........ total number of cells (acells*dcells*dups)\n");
log("\n");
+ log("A match containing the condition 'attribute' followed by a name and optional\n");
+ log("value requires that the memory contains the given attribute name and value\n");
+ log("(if specified) or that the attribute is not present or the value is empty (if\n");
+ log("value is not specified\n).");
+ log("\n");
log("The interface for the created bram instances is derived from the bram\n");
log("description. Use 'techmap' to convert the created bram instances into\n");
log("instances of the actual bram cells of your target architecture.\n");
@@ -1283,9 +1291,6 @@
log("A match containing the command 'shuffle_enable A' will re-organize\n");
log("the data bits to accommodate the enable pattern of port A.\n");
log("\n");
- log("A match containing the command 'attribute' will bypass min bits/efficiency\n");
- log("to select the type of memory.\n");
- log("\n");
}
void execute(vector<string> args, Design *design) YS_OVERRIDE
{