Ejemplo n.º 1
0
        private void WriteCompound(EsiCompound c)
        {
            W($"typedef struct packed {{");
            switch (c.Type)
            {
            case EsiCompound.CompoundType.EsiFixed:
                W($"  logic [{c.Fractional-1}:0] frac;");
                W($"  logic [{c.Whole-1}:0] whole;");
                break;

            case EsiCompound.CompoundType.EsiFloat:
                W($"  logic [{c.Fractional-1}:0] mant;");
                W($"  logic [{c.Whole-1}:0] exp;");
                break;

            default:
                C.Log.Error("Invalid EsiCompound type: {type}", c.Type);
                break;
            }
            if (c.Signed)
            {
                W("  logic sign;");
            }
            W($"}} {c.GetSVCompoundModuleName()};");
        }
 public static string GetSVCompoundModuleName(EsiCompound c) => c.GetSVCompoundModuleName();