diff options
-rw-r--r-- | src/python/m5/params.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 1f9a41d9e..db10a818f 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -311,6 +311,10 @@ class VectorParamDesc(ParamDesc): if isinstance(value, (list, tuple)): # list: coerce each element into new list tmp_list = [ ParamDesc.convert(self, v) for v in value ] + elif isinstance(value, str): + # If input is a csv string + tmp_list = [ ParamDesc.convert(self, v) \ + for v in value.strip('[').strip(']').split(',') ] else: # singleton: coerce to a single-element list tmp_list = [ ParamDesc.convert(self, value) ] @@ -346,7 +350,8 @@ class VectorParamDesc(ParamDesc): tmp_list = [ ParamDesc.convert(self, v) for v in value ] elif isinstance(value, str): # If input is a csv string - tmp_list = [ ParamDesc.convert(self, v) for v in value.split(',') ] + tmp_list = [ ParamDesc.convert(self, v) \ + for v in value.strip('[').strip(']').split(',') ] else: # singleton: coerce to a single-element list tmp_list = [ ParamDesc.convert(self, value) ] |