formatNoValue.append(";");\r
}\r
\r
- if (!userValue.isNull()) {\r
- ret = formatValue.arg(name).arg(getTypeString()).arg(userValue.toString());\r
+ QString typeStr = "";\r
+ QString valueStr = "";\r
+ if ((type == Boolean)||(type == Bit)) {\r
+ typeStr = "std_logic";\r
+ if (!userValue.isNull()) {\r
+ valueStr = "'"+userValue.toString()+"'";\r
+ ret = formatValue.arg(name).arg(typeStr).arg(valueStr);\r
+ }\r
+ else if (!defaultValue.isNull()) {\r
+ valueStr = "'"+defaultValue.toString()+"'";\r
+ ret = formatValue.arg(name).arg(typeStr).arg(valueStr);\r
+ }\r
+ else {\r
+ ret = formatNoValue.arg(name).arg(typeStr);\r
+ }\r
}\r
- else if (!defaultValue.isNull()) {\r
- ret = formatValue.arg(name).arg(getTypeString()).arg(defaultValue.toString());\r
+ else if (type == String) {\r
+ typeStr = "string";\r
+ if (!userValue.isNull()) {\r
+ valueStr = "\""+userValue.toString()+"\"";\r
+ ret = formatValue.arg(name).arg(typeStr).arg(valueStr);\r
+ }\r
+ else if (!defaultValue.isNull()) {\r
+ valueStr = "\""+defaultValue.toString()+"\"";\r
+ ret = formatValue.arg(name).arg(typeStr).arg(valueStr);\r
+ }\r
+ else {\r
+ ret = formatNoValue.arg(name).arg(typeStr);\r
+ }\r
}\r
else {\r
- ret = formatNoValue.arg(name).arg(getTypeString());\r
+ typeStr = getTypeString();\r
+ if (!userValue.isNull()) {\r
+ ret = formatValue.arg(name).arg(typeStr).arg(userValue.toString());\r
+ }\r
+ else if (!defaultValue.isNull()) {\r
+ ret = formatValue.arg(name).arg(typeStr).arg(defaultValue.toString());\r
+ }\r
+ else {\r
+ ret = formatNoValue.arg(name).arg(typeStr);\r
+ }\r
}\r
}\r
- else if (context == BlockParameter::Architecture) {\r
+ else if (context == BlockParameter::Instance) {\r
QString format = "%1 => %2";\r
if ((flags & BlockParameter::NoComma) == 0) {\r
format.append(";");\r
}\r
AbstractBlock* parent = owner->getParent();\r
- BlockParameter* p = parent->getParameterFromName(name);\r
+ BlockParameter* p = NULL;\r
+ if (parent != NULL) {\r
+ p = parent->getParameterFromName(name);\r
+ }\r
if (p != NULL) {\r
/* the parent group has a generic parameter with the same\r
name\r
}\r
else {\r
if (!userValue.isNull()) {\r
- ret = format.arg(name).arg(userValue.toString());\r
+ if ((type == Boolean)||(type == Bit)) {\r
+ ret = format.arg(name).arg("'"+userValue.toString()+"'");\r
+ }\r
+ else if (type == String) {\r
+ ret = format.arg(name).arg("\""+userValue.toString()+"\"");\r
+ }\r
+ else {\r
+ ret = format.arg(name).arg(userValue.toString());\r
+ }\r
}\r
else if (!defaultValue.isNull()) {\r
- ret = format.arg(name).arg(defaultValue.toString());\r
+ if ((type == Boolean)||(type == Bit)) {\r
+ ret = format.arg(name).arg("'"+defaultValue.toString()+"'");\r
+ }\r
+ else if (type == String) {\r
+ ret = format.arg(name).arg("\""+defaultValue.toString()+"\"");\r
+ }\r
+ else {\r
+ ret = format.arg(name).arg(defaultValue.toString());\r
+ }\r
}\r
else {\r
// abnormal case\r