From ba197c116368bbab05af6d636ab24cb65c73b291 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 29 Sep 2020 00:39:01 -0700 Subject: [PATCH] arch: Wrap a docstring in isa_parser.py. This brings the ISA parser in line with the style guide. Note that the docstring needs to be a single string literal for python to consider it a docstring, and the parser itself needs each line of the docstring to be a rule in its CFG. We can accomplish both by taking advantage of the fact that two directly adjacent quoted strings are treated as a single string literal by python, and by escaping the newline so that they're actually considered adjacent. Change-Id: I7f4d252998877808425aafb0159600ba4c3bf9ad Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35276 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/arch/isa_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index d69bea2f0..4f69a3f4a 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -2082,7 +2082,8 @@ del wrap # 'def [signed] bitfield [:]' # This generates a preprocessor macro in the output file. def p_def_bitfield_0(self, t): - 'def_bitfield : DEF opt_signed BITFIELD ID LESS INTLIT COLON INTLIT GREATER SEMI' + 'def_bitfield : DEF opt_signed ' \ + 'BITFIELD ID LESS INTLIT COLON INTLIT GREATER SEMI' expr = 'bits(machInst, %2d, %2d)' % (t[6], t[8]) if (t[2] == 'signed'): expr = 'sext<%d>(%s)' % (t[6] - t[8] + 1, expr) -- 2.30.2