----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2801/#review6272 -----------------------------------------------------------
src/mem/slicc/symbols/StateMachine.py (line 629) <http://reviews.gem5.org/r/2801/#comment5420> I see. On my first pass here, I misread that this code allows arbitrary expressions for setting buffer_size. You're right that the parser disallows that. However, you should be using the pair values' types here to be consistent with other code generation rather than using isinstance, which is very out-of-place here. Each PairAST value has a type. From the parser: def p_pair__assign(self, p): """pair : ident '=' STRING | ident '=' ident | ident '=' NUMBER""" p[0] = ast.PairAST(self, p[1], p[3]) And for instance, the parser sets STRING types as follows: def t_STRING1(self, t): r'\"[^"\n]*\"' t.type = 'STRING' t.value = t.value[1:-1] return t Thus, you should be able to get the buffer_size value's type with code like: size_type = var["buffer_size"].type Then you can predicate code generation on whether the type is IDENT, STRING, or INT like other code here (e.g. see 'vtype' local var). This same issue applies in review request 2814 ( http://reviews.gem5.org/r/2814/ ), which looks like it is just replicating this code? - Joel Hestness On May 11, 2015, 10:20 p.m., Tony Gutierrez wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2801/ > ----------------------------------------------------------- > > (Updated May 11, 2015, 10:20 p.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 10858:b1d4246c12ad > --------------------------- > slicc: Support for setting individual message buffer size > > This patch adds support for setting per-MessageBuffer buffer sizes. Prior to > this patch, all buffers used the same size that was set globally. This patch > also adds a "kill switch" that turns all buffers back into infinite > buffers. The configuration will print warnings when either the kill switch is > on and an attempt is made to set a finite buffer size or the kill switch is > off and there is an attempt to set an inifinite buffer size. > > The global buffer size variable still exists, and is now turned into a default > value if no more specific value is set (such as internal buffers created by > switches). > > > Diffs > ----- > > src/mem/ruby/network/MessageBuffer.hh > fbdaa08aaa426b9f4660c366f934ccb670d954ec > src/mem/ruby/network/MessageBuffer.cc > fbdaa08aaa426b9f4660c366f934ccb670d954ec > src/mem/ruby/system/RubySystem.py fbdaa08aaa426b9f4660c366f934ccb670d954ec > src/mem/ruby/system/System.hh fbdaa08aaa426b9f4660c366f934ccb670d954ec > src/mem/ruby/system/System.cc fbdaa08aaa426b9f4660c366f934ccb670d954ec > src/mem/slicc/symbols/StateMachine.py > fbdaa08aaa426b9f4660c366f934ccb670d954ec > > Diff: http://reviews.gem5.org/r/2801/diff/ > > > Testing > ------- > > > Thanks, > > Tony Gutierrez > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
