aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/mem.h
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2021-07-12 20:04:59 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2021-07-13 15:59:11 +0200
commit8bf9cb407d929255ae985b33a537ac6d489553c5 (patch)
tree7279251ab076a7d0bf8fc24117bad5bb087caa5e /kernel/mem.h
parent4379375d899b917d3f6ed00db64ab52c35f4f004 (diff)
downloadyosys-8bf9cb407d929255ae985b33a537ac6d489553c5.tar.gz
yosys-8bf9cb407d929255ae985b33a537ac6d489553c5.tar.bz2
yosys-8bf9cb407d929255ae985b33a537ac6d489553c5.zip
kernel/mem: Add a coalesce_inits helper.
While this helper is already useful to squash sequential initializations into one in cxxrtl, its main purpose is to squash overlapping masked memory initializations (when they land) and avoid having to deal with them in cxxrtl runtime.
Diffstat (limited to 'kernel/mem.h')
-rw-r--r--kernel/mem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/mem.h b/kernel/mem.h
index 6ea18f26f..62403e00c 100644
--- a/kernel/mem.h
+++ b/kernel/mem.h
@@ -97,6 +97,13 @@ struct Mem : RTLIL::AttrObject {
// Marks all inits as removed.
void clear_inits();
+ // Coalesces inits: whenever two inits have overlapping or touching
+ // address ranges, they are combined into one, with the higher-priority
+ // one's data overwriting the other. Running this results in
+ // an inits list equivalent to the original, in which all entries
+ // cover disjoint (and non-touching) address ranges.
+ void coalesce_inits();
+
// Checks consistency of this memory and all its ports/inits, using
// log_assert.
void check();