public void ExtendLUT(LUTComponents components) { var lut = LUT.FromEntity(Entity); var biggerLut = components.GetBigerLut(lut); if (ChangeEnity(biggerLut.Entity)) { Map.ChangeEnity(biggerLut.Entity); var extraBits = biggerLut.Bits - lut.Bits; int times = (int)Math.Pow(2, extraBits); ChangeInitVector(InitVector.InitVectorMultiply(GetInitVector(), times)); Change(Map.Text); } }
public void ConstValuePort(Port port, bool isOne) { //var a = Assignment.Parse(this, port.N ); if (Assigmnets.FirstOrDefault(a => a.Left.Signal.Name == port.Name) != null) { var istr = Regex.Match(port.Name, IndexPattern).Value; int index; int.TryParse(istr, out index); var initVector = InitVector.ExtractInitVectorValut(GetInitVector()); var binaryValut = InitVector.FromHexToBibValue(initVector); var newBinary = new StringBuilder(string.Empty); var bit = isOne ? '1' : '0'; for (int j = 0; j < binaryValut.Length; j++) { newBinary.Append(j % ((index + 1) * 4) < (index + 1) * 2 ? bit : binaryValut[j]); } var hex = InitVector.FomBinToHexValue(newBinary.ToString()); var newVector = InitVector.ValueToVector(hex); ChangeInitVector(newVector); } }