In a multi-way cache, a method for selecting N ways available for replacement
includes providing a plurality of rulesets where each one of the plurality of rulesets
specifies N ways in the cache that are available for replacement (where N is equal
to or greater than zero). The method further includes receiving an access address,
and using at least a portion of the access address to select one of the plurality
of rulesets. The selected one of the plurality of rulesets may then be used to
select N ways in that cache that are available for replacement. One embodiment
uses the high order bits of the access address to select a ruleset. An alternate
embodiment uses at least a portion of the access address and a ruleset selector
control register to select the ruleset. Yet another embodiment uses the access
address and address range comparators to select the ruleset.