public IEnumerable <TAVerb> Concat(ISignalSource <StdLogicVector>[] operands, ISignalSink <StdLogicVector> result) { var inps = _inSignals.Select((s, i) => s.Drive(operands[i])); var outps = Enumerable.Repeat(result.Comb.Connect(_outSignal.AsSignalSource <StdLogicVector>()), 1); yield return(Verb(ETVMode.Locked, inps.Concat(outps).ToArray())); }
/// <summary> /// Returns a transaction which loads a constant to the specified signal sink. /// </summary> /// <param name="target">signal sink to receive constant</param> public IEnumerable <TAVerb> LoadConstant(ISignalSink <StdLogicVector> target) { if (_constSignal != null) { yield return(Verb(ETVMode.Shared, target.Comb.Connect(_constSignal.AsSignalSource <StdLogicVector>()))); } else { yield return(Verb(ETVMode.Shared, target.Comb.Connect(SignalSource.Create(_constValue)))); } }
public IEnumerable <TAVerb> LdelemFixA(ISignalSource <StdLogicVector> addr, ISignalSink <StdLogicVector> data) { if (_wrEnI != null) { // Memory used as RAM yield return(Verb(ETVMode.Locked, _wrEnI.Stick(StdLogic._0), _addrI.Drive(addr), _dataInI.Stick(StdLogicVector._0s(_dataBits)))); } else { // Memory used as ROM yield return(Verb(ETVMode.Locked, _addrI.Drive(addr))); } yield return(Verb(ETVMode.Shared, data.Comb.Connect(_dataOutI.AsSignalSource <StdLogicVector>()))); }
public IEnumerable <TAVerb> Read(ISignalSink <StdLogicVector> dest) { var fref = _literal as FieldRef; if (fref != null) { if (!fref.FieldDesc.IsReadInCurrentContext(Host.Context)) { throw new InvalidOperationException("Field is marked as not being read"); } } yield return(Verb(ETVMode.Shared, dest.Comb.Connect(_dataOutI.AsSignalSource <StdLogicVector>()))); }