From 536e3664e41d406af1e618dd02c3222f7cbbcaee Mon Sep 17 00:00:00 2001 From: David Hashe Date: Mon, 20 Jul 2015 09:15:18 -0500 Subject: slicc: support for multiple cache entry types in the same state machine To have multiple Entry types (e.g., a cache Entry type and a directory Entry type), just declare one of them as a secondary type by using the pair 'main="false"', e.g.: structure(DirEntry, desc="...", interface="AbstractCacheEntry", main="false") { ...and the primary type would be declared: structure(Entry, desc="...", interface="AbstractCacheEntry") { --- src/mem/slicc/symbols/StateMachine.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/mem/slicc/symbols') diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index 8a4d7d9b5..e90abaf44 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -144,10 +144,13 @@ class StateMachine(Symbol): self.TBEType = type elif "interface" in type and "AbstractCacheEntry" == type["interface"]: - if self.EntryType != None: - self.error("Multiple AbstractCacheEntry types in a " \ - "single machine."); - self.EntryType = type + if "main" in type and "false" == type["main"].lower(): + pass # this isn't the EntryType + else: + if self.EntryType != None: + self.error("Multiple AbstractCacheEntry types in a " \ + "single machine."); + self.EntryType = type # Needs to be called before accessing the table def buildTable(self): -- cgit v1.2.3