private XDLPort ExtractPort(string portCode) { // extract port string[] atoms = Regex.Split(portCode, @"\s+"); XDLPort port = new XDLPort(); port.ExternalName = Regex.Replace(atoms[1], "\"", ""); port.InstanceName = Regex.Replace(atoms[2], "\"", ""); port.SlicePort = Regex.Replace(atoms[3], "\"", ""); port.SlicePort = Regex.Replace(port.SlicePort, ";", ""); port.Direction = FPGATypes.GetDirection(new Port(port.SlicePort)); return(port); }
private void ReadPort(XDLModule module, char c, StreamReader sr, ref int charIndex) { string portCode = ""; portCode += c; while (true) { c = (char)sr.Read(); charIndex++; if (c == ';') { break; } portCode += c; } XDLPort p = ExtractPort(portCode); module.Add(p); }