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)); } }
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)); } }
/// <summary> /// Constructs a new instance /// </summary> /// <param name="host">hosting storage unit</param> public LocalStorageUnitTransactionSite(LocalStorageUnit host) : base(host) { _host = host; }
/// <summary> /// Constructs a new instance. /// </summary> /// <param name="host">hosting storage unit</param> public LocalStorageUnitWriteMapping(LocalStorageUnit host) : base(host.TASite, EMappingKind.ExclusiveResource) { _host = host; }
/// <summary> /// Constructs a new instance /// </summary> /// <param name="host">hosting storage unit</param> public LocalStorageUnitTransactionSite(LocalStorageUnit host): base(host) { _host = host; }
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); }
/// <summary> /// Constructs a new instance. /// </summary> /// <param name="host">hosting storage unit</param> public LocalStorageUnitWriteMapping(LocalStorageUnit host) : base(host.TASite, EMappingKind.ExclusiveResource) { _host = host; }