Пример #1
0
        public IXILMapping TryAllocate(Component host, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes, IProject proj)
        {
            if (!instr.Name.Equals(InstructionCodes.LoadVar) &&
                !instr.Name.Equals(InstructionCodes.StoreVar))
            {
                return(null);
            }

            var tgtVar = instr.Operand as Variable;

            if (tgtVar == null)
            {
                return(null);
            }

            bool dfeed = EnableDirectFeed;

            if (tgtVar.HasAttribute <FeedThruVariable>())
            {
                dfeed = true;
            }
            else if (tgtVar.HasAttribute <RegisteredVariable>())
            {
                dfeed = false;
            }

            LocalStorageUnit lsu = new LocalStorageUnit(tgtVar, dfeed);

            if (instr.Name.Equals(InstructionCodes.LoadVar))
            {
                return(new LocalStorageUnitReadMapping(lsu));
            }
            else
            {
                return(new LocalStorageUnitWriteMapping(lsu));
            }
        }
Пример #2
0
        public IEnumerable <IXILMapping> TryMap(ITransactionSite taSite, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes)
        {
            if (!instr.Name.Equals(InstructionCodes.LoadVar) &&
                !instr.Name.Equals(InstructionCodes.StoreVar))
            {
                yield break;
            }

            var tgtVar = instr.Operand as Variable;

            if (tgtVar == null)
            {
                yield break;
            }

            var fu = taSite.Host;
            LocalStorageUnit lsu = fu as LocalStorageUnit;

            if (lsu == null)
            {
                yield break;
            }
            if (!lsu.MappedVariable.Equals(tgtVar))
            {
                yield break;
            }

            if (instr.Name.Equals(InstructionCodes.LoadVar))
            {
                yield return(new LocalStorageUnitReadMapping(lsu));
            }
            else
            {
                yield return(new LocalStorageUnitWriteMapping(lsu));
            }
        }
Пример #3
0
 /// <summary>
 /// Constructs a new instance
 /// </summary>
 /// <param name="host">hosting storage unit</param>
 public LocalStorageUnitTransactionSite(LocalStorageUnit host) :
     base(host)
 {
     _host = host;
 }
Пример #4
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="host">hosting storage unit</param>
 public LocalStorageUnitWriteMapping(LocalStorageUnit host) :
     base(host.TASite, EMappingKind.ExclusiveResource)
 {
     _host = host;
 }
Пример #5
0
 /// <summary>
 /// Constructs a new instance
 /// </summary>
 /// <param name="host">hosting storage unit</param>
 public LocalStorageUnitTransactionSite(LocalStorageUnit host):
     base(host)
 {
     _host = host;
 }
Пример #6
0
        public IXILMapping TryAllocate(Component host, XILInstr instr, TypeDescriptor[] operandTypes, TypeDescriptor[] resultTypes, IProject proj)
        {
            if (!instr.Name.Equals(InstructionCodes.LoadVar) &&
                !instr.Name.Equals(InstructionCodes.StoreVar))
                return null;

            var tgtVar = instr.Operand as Variable;
            if (tgtVar == null)
                return null;

            bool dfeed = EnableDirectFeed;
            if (tgtVar.HasAttribute<FeedThruVariable>())
                dfeed = true;
            else if (tgtVar.HasAttribute<RegisteredVariable>())
                dfeed = false;

            LocalStorageUnit lsu = new LocalStorageUnit(tgtVar, dfeed);

            if (instr.Name.Equals(InstructionCodes.LoadVar))
                return new LocalStorageUnitReadMapping(lsu);
            else
                return new LocalStorageUnitWriteMapping(lsu);
        }
Пример #7
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="host">hosting storage unit</param>
 public LocalStorageUnitWriteMapping(LocalStorageUnit host) :
     base(host.TASite, EMappingKind.ExclusiveResource)
 {
     _host = host;
 }