|
@@ -87,16 +87,28 @@ namespace ShakerFpga
|
|
|
proname = RemovePropertySpecialcharacters(proname);
|
|
|
stringBuilder.AppendLine($" private {protype} _{proname};");
|
|
|
stringBuilder.AppendLine($" /// <summary>");
|
|
|
- stringBuilder.AppendLine($" /// {register.Name}");
|
|
|
+ stringBuilder.AppendLine($" ///<para> {register.Name}{(register.Datatype == Datatype.Array?$",数组长度为:{register.Size}":"")}</para>");
|
|
|
+ if(register.Datatype == Datatype.FXP || register.ArrayValueType == Datatype.FXP)
|
|
|
+ {
|
|
|
+ stringBuilder.AppendLine($" ///<para> 数据类型:定点数</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 最大值:{register.FxpTypeInfo.Max}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 最小值:{register.FxpTypeInfo.Min}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 最小分辨率:{register.FxpTypeInfo.Delta}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 字长:{register.FxpTypeInfo.wordLength}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 整数字长:{register.FxpTypeInfo.integerWordLength}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> {(register.FxpTypeInfo.isSigned?"有符号":"无符号")}</para>");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var type = register.Datatype != Datatype.Array ? register.Datatype : register.ArrayValueType;
|
|
|
+ stringBuilder.AppendLine($" ///<para> 数据类型:{type}</para>");
|
|
|
+ }
|
|
|
stringBuilder.AppendLine($" /// </summary>");
|
|
|
stringBuilder.AppendLine($" public {protype} {proname}");
|
|
|
stringBuilder.AppendLine(" {");
|
|
|
stringBuilder.AppendLine(" get");
|
|
|
stringBuilder.AppendLine(" {");
|
|
|
- stringBuilder.AppendLine($" if(_" + proname + "==null)");
|
|
|
- stringBuilder.AppendLine(" {");
|
|
|
- stringBuilder.AppendLine($" _" + proname + $"=({protype})fpga.Properties[\"{register.Name}\"];");
|
|
|
- stringBuilder.AppendLine(" }");
|
|
|
+ stringBuilder.AppendLine($" _" + proname + $" ??= ({protype})fpga.Properties[\"{register.Name}\"];");
|
|
|
stringBuilder.AppendLine($" return _" + proname + ";");
|
|
|
stringBuilder.AppendLine(" }");
|
|
|
stringBuilder.AppendLine(" }");
|
|
@@ -108,16 +120,27 @@ namespace ShakerFpga
|
|
|
proname = RemovePropertySpecialcharacters(proname);
|
|
|
stringBuilder.AppendLine($" private {protype} _{proname};");
|
|
|
stringBuilder.AppendLine($" /// <summary>");
|
|
|
- stringBuilder.AppendLine($" /// {dma.Name}");
|
|
|
+ stringBuilder.AppendLine($" ///<para> {dma.Name}</para>");
|
|
|
+ if(dma.Datatype == Datatype.FXP)
|
|
|
+ {
|
|
|
+ stringBuilder.AppendLine($" ///<para> 数据类型:定点数</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 最大值:{dma.FxpTypeInfo.Max}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 最小值:{dma.FxpTypeInfo.Min}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 最小分辨率:{dma.FxpTypeInfo.Delta}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 字长:{dma.FxpTypeInfo.wordLength}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> 整数字长:{dma.FxpTypeInfo.integerWordLength}</para>");
|
|
|
+ stringBuilder.AppendLine($" ///<para> {(dma.FxpTypeInfo.isSigned ? "有符号" : "无符号")}</para>");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ stringBuilder.AppendLine($" ///<para> 数据类型:{dma.Datatype}</para>");
|
|
|
+ }
|
|
|
stringBuilder.AppendLine($" /// </summary>");
|
|
|
stringBuilder.AppendLine($" public {protype} {proname}");
|
|
|
stringBuilder.AppendLine(" {");
|
|
|
stringBuilder.AppendLine(" get");
|
|
|
stringBuilder.AppendLine(" {");
|
|
|
- stringBuilder.AppendLine($" if(_" + proname + "==null)");
|
|
|
- stringBuilder.AppendLine(" {");
|
|
|
- stringBuilder.AppendLine($" _" + proname + $"=({protype})fpga.Fifos[\"{dma.Name}\"];");
|
|
|
- stringBuilder.AppendLine(" }");
|
|
|
+ stringBuilder.AppendLine($" _" + proname + $" ??= ({protype})fpga.Fifos[\"{dma.Name}\"];");
|
|
|
stringBuilder.AppendLine($" return _" + proname + ";");
|
|
|
stringBuilder.AppendLine(" }");
|
|
|
stringBuilder.AppendLine(" }");
|