ruby: slicc: remove member buffer_expr from Var class
authorNilay Vaish <nilay@cs.wisc.edu>
Mon, 14 Sep 2015 15:04:55 +0000 (10:04 -0500)
committerNilay Vaish <nilay@cs.wisc.edu>
Mon, 14 Sep 2015 15:04:55 +0000 (10:04 -0500)
This was added by changeset 51f40b101a56.  Instead, buffer_expr would now be
associated with the InPort class.

src/mem/slicc/ast/InPortDeclAST.py
src/mem/slicc/symbols/StateMachine.py
src/mem/slicc/symbols/Var.py

index 7a019a0e07792a3a4e4382fb05bfa0a228f1ac58..e0aa25236ea1a96dff280e73095a4822e8d7114c 100644 (file)
@@ -58,8 +58,9 @@ class InPortDeclAST(DeclAST):
                        queue_type)
 
         type = self.queue_type.type
+        self.pairs["buffer_expr"] = self.var_expr
         in_port = Var(self.symtab, self.ident, self.location, type, str(code),
-                      self.pairs, machine, self.var_expr)
+                      self.pairs, machine)
         symtab.newSymbol(in_port)
 
         symtab.pushFrame()
index 3e6a93fa7ea56cf4a64e8c64a33d14ed7cf78205..b5d9c2afe4f616559cb0e77a0537f86a0bda9f4e 100644 (file)
@@ -196,7 +196,7 @@ class StateMachine(Symbol):
         port_to_buf_map = {}
         in_msg_bufs = {}
         for port in self.in_ports:
-            buf_name = "m_%s_ptr" % port.buffer_expr.name
+            buf_name = "m_%s_ptr" % port.pairs["buffer_expr"].name
             msg_bufs.append(buf_name)
             port_to_buf_map[port] = msg_bufs.index(buf_name)
             if buf_name not in in_msg_bufs:
index 85b9e67cd24bd0901ba310f73d8da00eace0d7d7..2a4ef23db3f28bf1ad122bafd2aec3cc79badabe 100644 (file)
@@ -29,10 +29,9 @@ from slicc.symbols.Symbol import Symbol
 
 class Var(Symbol):
     def __init__(self, symtab, ident, location, type, code, pairs,
-                 machine=None, buffer_expr=""):
+                 machine=None):
         super(Var, self).__init__(symtab, ident, location, pairs)
 
-        self.buffer_expr = buffer_expr
         self.machine = machine
         self.type = type
         self.code = code