Hi Xing, I think in your case you want to add your function to the RubySlicc_Util.sm file since your new function is similar to the other member functions in class Address such as makeLineAddress().
Malek On Wed, May 9, 2012 at 11:06 PM, Xing HAN <[email protected]> wrote: > Hello, > > > I want to make some modifications to the Address-typed variables in > MOESI_CMP_token_dir.sm, so I added a member function to > 'Class Address in Address.hh/cc files, noted as 'int testFunc()'. > > However, when the SLICC anaylize the .sm file, it threw an > error that Address doesn't have a method called testFunc. > > Then I tried to add the structure for Address into > MOESI_CMP_token_dir.sm in two methods, but > neither works, as listed below: > > I. According to the description in slicc/doc/SLICC_V02.txt > structure(Address, "Address", desc="xxx"){ > int testFunc(); > } > Error: > Exception: MOESI_CMP_token-dir.sm:173: Error: Invalid > method call: Type 'DirectoryMemory' does not have a method > lookup, 'lookup_Directory_Address' nor '': > > It seems that the Address is overrided in DirectoryMemory > as Directory_Address, so I tried the way similar to 'structure > TBETable' > > II. Add structure Address as 'external' like TBETable > structure(Address, external="yes"){ > int testFunc(); > } > Error: > KeyError: 'interface': > # part of error info.: > File "/home/hanxing/Projects/grave/gem5-stable/build/ALPHA_SE/ > mem/protocol/SConscript", line 70: > slicc.process() > File "gem5-stable/src/mem/slicc/parser.py", line 65: > self.decl_list.generate() > File "gem5-stable/src/mem/slicc/ast/DeclListAST.py", line 52: > decl.generate() > File "gem5-stable/src/mem/slicc/ast/MachineAST.py", line 68: > self.decls.generate() > File "gem5-stable/src/mem/slicc/ast/DeclListAST.py", line 52: > decl.generate() > File "gem5-stable/src/mem/slicc/ast/FuncDeclAST.py", line 69: > rtype = self.statements.generate(body, return_type) > File "gem5-stable/src/mem/slicc/ast/StatementListAST.py", line 42: > statement.generate(code, return_type) > File "gem5-stable/src/mem/slicc/ast/ReturnStatementAST.py", line > 40: > actual_type, ecode = self.expr_ast.inline(True) > File "gem5-stable/src/mem/slicc/ast/ExprAST.py", line 39: > return_type = self.generate(code) > File "gem5-stable/src/mem/slicc/ast/StaticCastAST.py", line 41: > actual_type, ecode = self.expr_ast.inline(True) > File "gem5-stable/src/mem/slicc/ast/ExprAST.py", line 39: > return_type = self.generate(code) > File "gem5-stable/src/mem/slicc/ast/MethodCallExprAST.py", line > 70: > str(actual_type["interface"]) != str(expected_type): > File "gem5-stable/src/mem/slicc/util.py", line 40: > return self.pairs[item] > > Could anyone help me on solving this problem? Is there > anything i missed while modifying the code? > > Thanks a lot! > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
