private void CreateStagedInterconnect(FlowMatrix flowSpec, FlowMatrix detailedFlow) { flowSpec.Transitize(); detailedFlow.AddNeutral(flowSpec.NeutralFlow); var tflows = flowSpec.GetTimedFlows(); var grouped = tflows.GroupBy(tf => tf.Target); foreach (var group in grouped) { var net = ConstructNetwork(group.Key, group); foreach (var tflow in net) { var tsf = tflow as TimedSignalFlow; var tvf = tflow as TimedValueFlow; if (tsf != null) { detailedFlow.Add((int)tflow.Time, new SignalFlow(tsf.Source, tsf.Target)); } else { detailedFlow.Add((int)tflow.Time, new ValueFlow(tvf.Value, tvf.Target)); } } } for (int i = 0; i < _stageInSignals.Count; i++) { detailedFlow.AddNeutral(new SignalFlow( _stageOutSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Cur), _stageInSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next))); } }
private void AssembleFlowMatrix() { _realFlow.AddNeutral(_flowSpec.NeutralFlow); for (int i = 0; i < _regsCur.Length; i++) { if (_regsCur[i] == null) { continue; } _realFlow.AddNeutral( new SignalFlow( _regsCur[i].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Cur), _regsNext[i].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Next))); } for (int i = 0; i < _flowSpec.NumCSteps; i++) { var pflow = _flowSpec.GetFlow(i); foreach (var flow in pflow.Flows) { var sflow = flow as SignalFlow; var vflow = flow as ValueFlow; var target = flow.Target; int tindex = flow.Target.GetTemporaryIndex(); if (tindex >= 0) { int rindex = _regIndices[tindex]; if (rindex < 0) { continue; } target = _regsNext[rindex].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Next); } if (sflow != null) { var source = sflow.Source; int sindex = sflow.Source.GetTemporaryIndex(); if (sindex >= 0) { int rindex = _regIndices[sindex]; source = _regsCur[rindex].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Cur); } _realFlow.Add(i, new SignalFlow(source, target)); } else { _realFlow.Add(i, new ValueFlow(vflow.Value, target)); } } } }
public void CreateInterconnect(FlowMatrix flowSpec, FlowMatrix detailedFlow) { flowSpec.Transitize(); var tflows = flowSpec.GetTimedFlows(); var sflows = tflows .Select(tf => tf as TimedSignalFlow) .Where(tf => tf != null); SlimMux <int, int, TimedSignalFlow> .ConstructInterconnect(_smih, sflows); var pipeen = _smih.ComputePipeEnMatrix(flowSpec.NumCSteps); var pipes = _smih.InstantiatePipes(); int idx = 0; foreach (RegPipe rp in pipes) { string id = "icpipe" + idx; _host.Descriptor.AddChild(rp.Descriptor, id); ++idx; } var pflows = _smih.ToFlow(flowSpec.NumCSteps, flowSpec.NeutralFlow, pipeen); var vflows = tflows .Select(tf => tf as TimedValueFlow) .Where(tf => tf != null); detailedFlow.AddNeutral(flowSpec.NeutralFlow); foreach (var vf in vflows) { detailedFlow.Add((int)vf.Time, new ValueFlow(vf.Value, vf.Target)); } int cstep = 0; foreach (var pf in pflows) { detailedFlow.Add(cstep, pf); cstep++; } _host.Descriptor.GetDocumentation().Documents.Add( new Document("SlimMuxInterconnectGraph.dotty", _smih.GetInterconnectGraphForDotty())); }
private void CreateStagedInterconnect(FlowMatrix flowSpec, FlowMatrix detailedFlow) { flowSpec.Transitize(); detailedFlow.AddNeutral(flowSpec.NeutralFlow); var tflows = flowSpec.GetTimedFlows(); var grouped = tflows.GroupBy(tf => tf.Target); foreach (var group in grouped) { var net = ConstructNetwork(group.Key, group); foreach (var tflow in net) { var tsf = tflow as TimedSignalFlow; var tvf = tflow as TimedValueFlow; if (tsf != null) detailedFlow.Add((int)tflow.Time, new SignalFlow(tsf.Source, tsf.Target)); else detailedFlow.Add((int)tflow.Time, new ValueFlow(tvf.Value, tvf.Target)); } } for (int i = 0; i < _stageInSignals.Count; i++) { detailedFlow.AddNeutral(new SignalFlow( _stageOutSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Cur), _stageInSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next))); } }
private void AssembleFlowMatrix() { _detailedFlow.AddNeutral(_flowSpec.NeutralFlow); if (_regsCur != null) { for (int i = 0; i < _regsCur.Length; i++) { if (_regsCur[i] == null) { continue; } _detailedFlow.AddNeutral( new SignalFlow( _regsCur[i].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Cur), _regsNext[i].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Next))); } } if (_memInstances != null) { for (int i = 0; i < _memInstances.Length; i++) { _detailedFlow.AddNeutral( new ValueFlow( StdLogic._0, _memWrSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next))); _detailedFlow.AddNeutral( new ValueFlow( StdLogicVector.DCs(_memInstances[i].AddrWidth), _memAddrRSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next))); _detailedFlow.AddNeutral( new ValueFlow( StdLogicVector.DCs(_memInstances[i].AddrWidth), _memAddrWSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next))); _detailedFlow.AddNeutral( new ValueFlow( StdLogicVector.DCs(_memInstances[i].Width), _memDInSignals[i].ToSignalRef(SignalRef.EReferencedProperty.Next))); } } for (int i = 0; i < _flowSpec.NumCSteps; i++) { var pflow = _flowSpec.GetFlow(i); foreach (var flow in pflow.Flows) { var sflow = flow as SignalFlow; var vflow = flow as ValueFlow; var target = flow.Target; int tindex = flow.Target.GetTemporaryIndex(); if (tindex >= 0) { if (IsUnused(tindex)) { continue; } int rep = _eqRegs.Find(tindex); if (_isMemMap[rep]) { int rindex = _idxMap[_eqMems.Find(rep)]; target = _memDInSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next); _detailedFlow.Add(i, new ValueFlow(_memAddrs[rep], _memAddrWSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next))); _detailedFlow.Add(i, new ValueFlow(StdLogic._1, _memWrSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next))); } else { int rindex = _idxMap[rep]; if (rindex < 0) { continue; } target = _regsNext[rindex].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Next); } } if (sflow != null) { var source = sflow.Source; int sindex = sflow.Source.GetTemporaryIndex(); if (sindex >= 0) { int rep = _eqRegs.Find(sindex); if (_isMemMap[rep]) { int rindex = _idxMap[_eqMems.Find(rep)]; source = _memDOutSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Cur); _detailedFlow.Add(i - 1, new ValueFlow(_memAddrs[rep], _memAddrRSignals[rindex].ToSignalRef(SignalRef.EReferencedProperty.Next))); } else { int rindex = _idxMap[rep]; source = _regsCur[rindex].ToSignalRef(SysDOM.SignalRef.EReferencedProperty.Cur); } } _detailedFlow.Add(i, new SignalFlow(source, target)); } else { _detailedFlow.Add(i, new ValueFlow(vflow.Value, target)); } } } }
public void CreateInterconnect(FlowMatrix flowSpec, FlowMatrix detailedFlow) { flowSpec.Transitize(); var tflows = flowSpec.GetTimedFlows(); var sflows = tflows .Select(tf => tf as TimedSignalFlow) .Where(tf => tf != null); SlimMux<int, int, TimedSignalFlow>.ConstructInterconnect(_smih, sflows); var pipeen = _smih.ComputePipeEnMatrix(flowSpec.NumCSteps); var pipes = _smih.InstantiatePipes(); int idx = 0; foreach (RegPipe rp in pipes) { string id = "icpipe" + idx; _host.Descriptor.AddChild(rp.Descriptor, id); ++idx; } var pflows = _smih.ToFlow(flowSpec.NumCSteps, flowSpec.NeutralFlow, pipeen); var vflows = tflows .Select(tf => tf as TimedValueFlow) .Where(tf => tf != null); detailedFlow.AddNeutral(flowSpec.NeutralFlow); foreach (var vf in vflows) { detailedFlow.Add((int)vf.Time, new ValueFlow(vf.Value, vf.Target)); } int cstep = 0; foreach (var pf in pflows) { detailedFlow.Add(cstep, pf); cstep++; } _host.Descriptor.GetDocumentation().Documents.Add( new Document("SlimMuxInterconnectGraph.dotty", _smih.GetInterconnectGraphForDotty())); }