+/* Scache configuration parameters.
+ ??? Experiments to determine reasonable values is wip.
+ These are just guesses. */
+
+/* Default number of scache elements.
+ The size of an element is typically 32-64 bytes, so the size of the
+ default scache will be between 512K and 1M bytes. */
+#ifdef CONFIG_SIM_CACHE_SIZE
+#define SCACHE_DEFAULT_CACHE_SIZE CONFIG_SIM_CACHE_SIZE
+#else
+#define SCACHE_DEFAULT_CACHE_SIZE 16384
+#endif
+
+/* Minimum cache size.
+ The m32r port assumes a cache size of at least 2 so it can decode both 16
+ bit insns. When compiling we need an extra for the chain entry. And this
+ must be a multiple of 2. Hence 4 is the minimum (though, for those with
+ featuritis or itchy pedantic bits, we could make this conditional on
+ WITH_SCACHE_PBB). */
+#define MIN_SCACHE_SIZE 4
+
+/* Ratio of size of text section to size of scache.
+ When compiling, we don't want to flush the scache more than we have to
+ but we also don't want it to be exorbitantly(sp?) large. So we pick a high
+ default value, then reduce it by the size of the program being simulated,
+ but we don't override any value specified on the command line.
+ If not specified on the command line, the size to use is computed as
+ max (MIN_SCACHE_SIZE,
+ min (DEFAULT_SCACHE_SIZE,
+ text_size / (base_insn_size * INSN_SCACHE_RATIO))). */
+/* ??? Interesting idea but not currently used. */
+#define INSN_SCACHE_RATIO 4
+
+/* Default maximum insn chain length.
+ The only reason for a maximum is so we can place a maximum size on the
+ profiling table. Chain lengths are determined by cti's.
+ 32 is a more reasonable number, but when profiling, the before/after
+ handlers take up that much more space. The scache is filled from front to
+ back so all this determines is when the scache needs to be flushed. */
+#define MAX_CHAIN_LENGTH 64
+
+/* Default maximum hash list length. */
+#define MAX_HASH_CHAIN_LENGTH 4
+
+/* Minimum hash table size. */
+#define MIN_HASH_CHAINS 32
+
+/* Ratio of number of scache elements to number of hash lists.
+ Since the user can only specify the size of the scache, we compute the
+ size of the hash table as
+ max (MIN_HASH_CHAINS, scache_size / SCACHE_HASH_RATIO). */
+#define SCACHE_HASH_RATIO 8
+
+/* Hash a PC value.
+ FIXME: May wish to make the hashing architecture specific.
+ FIXME: revisit */
+#define HASH_PC(pc) (((pc) >> 2) + ((pc) >> 5))
+