/// <summary> /// Restore m_location2TileKey, m_tiles and m_matrices /// </summary> public void DoPostSerializationTasks() { m_location2TileKey.Clear(); m_tiles.Clear(); m_maxTileKeyX = 0; MaxX = 0; MaxY = 0; while (m_rawTiles.Count > 0) { RawTile rawTile = m_rawTiles.Dequeue(); Tile tile = new Tile(rawTile); foreach (RawSlice rawSlice in rawTile.RawSlices) { Slice slice = Slice.GetSliceFromRawSlice(tile, rawSlice); tile.Slices.Add(slice); } Add(tile); } m_matrices.Clear(); while (m_rawMatrices.Count > 0) { RawSwitchMatrix rawSM = m_rawMatrices.Dequeue(); SwitchMatrix sm = new SwitchMatrix(rawSM); Add(sm.HashCode, sm); } m_rawTiles.Clear(); m_rawMatrices.Clear(); // Time Model if (TimeModelAttributes != null) { Tile.TimeModelAttributeIndices = new Dictionary <Tile.TimeAttributes, int>(); int c = 0; for (int i = 0; i < 4; i++) { if (TimeModelAttributes[i]) { Tile.TimeModelAttributeIndices.Add((Tile.TimeAttributes)i, c); c++; } } } Commands.Debug.PrintGoAheadInternals.ObjectsToPrint.Add(this); }
public SwitchMatrix(RawSwitchMatrix rawSwitchMatrix) { for (int i = 0; i < rawSwitchMatrix.InPorts.Count; i++) { Port fromPort = new Port(rawSwitchMatrix.InPorts[i]); for (int j = 0; j < rawSwitchMatrix.OutPorts[i].Count; j++) { Port toPort = new Port(rawSwitchMatrix.OutPorts[i][j]); Add(fromPort, toPort); } } HashCode = rawSwitchMatrix.HashCode; }
public void DoPreSerializationTasks() { // no clear as this field might be NULL after deserialization m_rawTiles = new Queue <RawTile>(); foreach (Tile t in GetAllTiles()) { AddWLDtoFPGA(t); RawTile rawTile = new RawTile(t); m_rawTiles.Enqueue(rawTile); } //this.m_wires.Clear(); m_tiles.Clear(); m_location2TileKey.Clear(); // no clear as this field might be NULL after deserialization m_rawMatrices = new Queue <RawSwitchMatrix>(); foreach (SwitchMatrix sm in m_matrices.Values) { RawSwitchMatrix rawSm = new RawSwitchMatrix(sm); m_rawMatrices.Enqueue(rawSm); } m_matrices.Clear(); }