private void ExtractPins(string pins, InPortOutPortMapping pm, FPGATypes.PortDirection direction, Slice slice) { string[] pinPaths = pins.Split(' '); foreach (string pinPath in pinPaths.Where(s => !string.IsNullOrEmpty(s))) { int index = pinPath.IndexOf('/'); if (index <= 0) { throw new ArgumentException("Unexpected line " + pinPath); } string bel = pinPath.Substring(0, index); string pin = pinPath.Substring(index + 1, pinPath.Length - index - 1); Port p = new Port(pin); pm.AddSlicePort(p, direction); pm.Add(bel, p); slice.AddBel(bel); /* * string[] components = pinPath.Split('/'); * Port p = new Port(components[1]); * pm.AddSlicePort(p, direction); * pm.Add(components[0], p); * slice.AddBel(components[0]); */ } }
public void AddSlicePort(Port port, FPGATypes.PortDirection direction) { if (direction.Equals(FPGATypes.PortDirection.In)) { m_InPorts.Add(port); } else { m_OutPorts.Add(port); } }
private void AddXDLPort(LibraryElement el, string portName, FPGATypes.PortDirection dir) { XDLPort p = new XDLPort(); p.Direction = dir; p.ExternalName = portName; p.InstanceName = "unknown"; p.SlicePort = "unknown"; p.ConstantValuePort = false; el.Containter.Add(p); }
private XDLPort MakeXDLPort(string name, FPGATypes.PortDirection dir, bool makeInputsConstant = false) { return(new XDLPort { Direction = dir, ExternalName = name, InstanceName = "unknown", SlicePort = "unknown", ConstantValuePort = makeInputsConstant }); }
private void AddXDLPort(LibraryElement el, string prefix, int index, FPGATypes.PortDirection dir, bool makeInputsConstant) { XDLPort p = new XDLPort(); p.Direction = dir; p.ExternalName = prefix + index; p.InstanceName = "unknown"; p.SlicePort = "unknown"; p.ConstantValuePort = makeInputsConstant; el.Containter.Add(p); }
public IEnumerable <Port> GetPorts(FPGATypes.PortDirection direction) { if (direction == FPGATypes.PortDirection.In) { foreach (Port p in m_InPorts) { yield return(p); } } else if (direction == FPGATypes.PortDirection.Out) { foreach (Port p in m_OutPorts) { yield return(p); } } else { throw new ArgumentException("Unknown direction found in PortMapping.GetAllPorts: " + direction); } }
public void SetDirection(string signalName, FPGATypes.PortDirection direction) { m_directions[signalName] = direction; }