About Manhattan Length

本文介绍了在Allegro软件中如何查看网络信息,并解释了关键指标如etchlength(实际走线长度)和ManhattanLength(直角边之和长度)的概念及意义,通过Percentmanhattan百分比评估布线效率。

在allegro中查看网络信息,能看到如下的内容:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            < NET >             

  Net Name:            $2N1788

  Pin count:              5
  Via count:              2
  Total etch length:      2030.05 MIL
  Total manhattan length: 1433 MIL
  Percent manhattan:      141.66%
。。。。。。。。。。。。。。。。。。。
。。。。。。。。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

etch length是指实际网络走线的长度,
Manhattan Length 是指两点之间|dx|+|dy|的数值,形象的讲是直角三角形直角边之和
意义:通过这个数值可以评价布线长度,如 Percent manhattan:      141.66%
通过这段代码进行修改JavaScript:// A simple demo of 3D Tiles feature picking with hover and select behavior // Building data courtesy of NYC OpenData portal: http://www1.nyc.gov/site/doitt/initiatives/3d-building.page const viewer = new Cesium.Viewer("cesiumContainer", { terrain: Cesium.Terrain.fromWorldTerrain(), }); viewer.scene.globe.depthTestAgainstTerrain = true; // Set the initial camera view to look at Manhattan const initialPosition = Cesium.Cartesian3.fromDegrees( -74.01881302800248, 40.69114333714821, 753, ); const initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees( 21.27879878293835, -21.34390550872461, 0.0716951918898415, ); viewer.scene.camera.setView({ destination: initialPosition, orientation: initialOrientation, endTransform: Cesium.Matrix4.IDENTITY, }); // Load the NYC buildings tileset try { const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(75343); viewer.scene.primitives.add(tileset); } catch (error) { console.log(`Error loading tileset: ${error}`); } // HTML overlay for showing feature name on mouseover const nameOverlay = document.createElement("div"); viewer.container.appendChild(nameOverlay); nameOverlay.className = "backdrop"; nameOverlay.style.display = "none"; nameOverlay.style.position = "absolute"; nameOverlay.style.bottom = "0"; nameOverlay.style.left = "0"; nameOverlay.style["pointer-events"] = "none"; nameOverlay.style.padding = "4px"; nameOverlay.style.backgroundColor = "black"; // Information about the currently selected feature const selected = { feature: undefined, originalColor: new Cesium.Color(), }; // An entity object which will hold info about the currently selected feature for infobox display const selectedEntity = new Cesium.Entity(); // Get default left click handler for when a feature is not picked on left click const clickHandler = viewer.screenSpaceEventHandler.getInputAction( Cesium.ScreenSpaceEventType.LEFT_CLICK, ); // Update the 'nameOverlay' for the given picked feature, // at the given (screen) position. function updateNameOverlay(pickedFeature, position) { if (!Cesium.defined(pickedFeature)) { nameOverlay.style.display = "none"; return; } // A feature was picked, so show its overlay content nameOverlay.style.display = "block"; nameOverlay.style.bottom = `${viewer.canvas.clientHeight - position.y}px`; nameOverlay.style.left = `${position.x}px`; const name = pickedFeature.getProperty("BIN"); nameOverlay.textContent = name; } // Create the HTML that will be put into the info box that shows // information about the currently selected feature function createPickedFeatureDescription(pickedFeature) { const description = `${ '<table class="cesium-infoBox-defaultTable"><tbody>' + "<tr><th>BIN</th><td>" }${pickedFeature.getProperty("BIN")}</td></tr>` + `<tr><th>DOITT ID</th><td>${pickedFeature.getProperty( "DOITT_ID", )}</td></tr>` + `<tr><th>SOURCE ID</th><td>${pickedFeature.getProperty( "SOURCE_ID", )}</td></tr>` + `<tr><th>Longitude</th><td>${pickedFeature.getProperty( "Longitude", )}</td></tr>` + `<tr><th>Latitude</th><td>${pickedFeature.getProperty( "Latitude", )}</td></tr>` + `<tr><th>Height</th><td>${pickedFeature.getProperty("Height")}</td></tr>` + `<tr><th>Terrain Height (Ellipsoid)</th><td>${pickedFeature.getProperty( "TerrainHeight", )}</td></tr>` + `</tbody></table>`; return description; } // If silhouettes are supported, silhouette features in blue on mouse over and silhouette green on mouse click. // If silhouettes are not supported, change the feature color to yellow on mouse over and green on mouse click. if (Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)) { // Silhouettes are supported const silhouetteBlue = Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); silhouetteBlue.uniforms.color = Cesium.Color.BLUE; silhouetteBlue.uniforms.length = 0.01; silhouetteBlue.selected = []; const silhouetteGreen = Cesium.PostProcessStageLibrary.createEdgeDetectionStage(); silhouetteGreen.uniforms.color = Cesium.Color.LIME; silhouetteGreen.uniforms.length = 0.01; silhouetteGreen.selected = []; viewer.scene.postProcessStages.add( Cesium.PostProcessStageLibrary.createSilhouetteStage([ silhouetteBlue, silhouetteGreen, ]), ); // Silhouette a feature blue on hover. viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { // If a feature was previously highlighted, undo the highlight silhouetteBlue.selected = []; // Pick a new feature const pickedFeature = viewer.scene.pick(movement.endPosition); updateNameOverlay(pickedFeature, movement.endPosition); if (!Cesium.defined(pickedFeature)) { return; } // Highlight the feature if it's not already selected. if (pickedFeature !== selected.feature) { silhouetteBlue.selected = [pickedFeature]; } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); // Silhouette a feature on selection and show metadata in the InfoBox. viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { // If a feature was previously selected, undo the highlight silhouetteGreen.selected = []; // Pick a new feature const pickedFeature = viewer.scene.pick(movement.position); if (!Cesium.defined(pickedFeature)) { clickHandler(movement); return; } // Select the feature if it's not already selected if (silhouetteGreen.selected[0] === pickedFeature) { return; } // Save the selected feature's original color const highlightedFeature = silhouetteBlue.selected[0]; if (pickedFeature === highlightedFeature) { silhouetteBlue.selected = []; } // Highlight newly selected feature silhouetteGreen.selected = [pickedFeature]; // Set feature infobox description viewer.selectedEntity = selectedEntity; selectedEntity.description = createPickedFeatureDescription(pickedFeature); }, Cesium.ScreenSpaceEventType.LEFT_CLICK); } else { // Silhouettes are not supported. Instead, change the feature color. // Information about the currently highlighted feature const highlighted = { feature: undefined, originalColor: new Cesium.Color(), }; // Color a feature yellow on hover. viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) { // If a feature was previously highlighted, undo the highlight if (Cesium.defined(highlighted.feature)) { highlighted.feature.color = highlighted.originalColor; highlighted.feature = undefined; } // Pick a new feature const pickedFeature = viewer.scene.pick(movement.endPosition); updateNameOverlay(pickedFeature, movement.endPosition); if (!Cesium.defined(pickedFeature)) { return; } // Highlight the feature if it's not already selected. if (pickedFeature !== selected.feature) { highlighted.feature = pickedFeature; Cesium.Color.clone(pickedFeature.color, highlighted.originalColor); pickedFeature.color = Cesium.Color.YELLOW; } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); // Color a feature on selection and show metadata in the InfoBox. viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { // If a feature was previously selected, undo the highlight if (Cesium.defined(selected.feature)) { selected.feature.color = selected.originalColor; selected.feature = undefined; } // Pick a new feature const pickedFeature = viewer.scene.pick(movement.position); if (!Cesium.defined(pickedFeature)) { clickHandler(movement); return; } // Select the feature if it's not already selected if (selected.feature === pickedFeature) { return; } selected.feature = pickedFeature; // Save the selected feature's original color if (pickedFeature === highlighted.feature) { Cesium.Color.clone(highlighted.originalColor, selected.originalColor); highlighted.feature = undefined; } else { Cesium.Color.clone(pickedFeature.color, selected.originalColor); } // Highlight newly selected feature pickedFeature.color = Cesium.Color.LIME; // Set feature infobox description viewer.selectedEntity = selectedEntity; selectedEntity.description = createPickedFeatureDescription(pickedFeature); }, Cesium.ScreenSpaceEventType.LEFT_CLICK); } html: <style> @import url(../templates/bucket.css); </style> <div id="cesiumContainer" class="fullSize"></div> <div id="loadingOverlay"><h1>Loading...</h1></div> <div id="toolbar"></div>
06-12
### 总蚀刻长度 (Total Etch Length) 的定义 总蚀刻长度是指电路板上导体路径的实际物理长度,即从起点到终点沿着实际走线轨迹测量的距离。这种度量方式考虑到了走线的具体形状和弯曲情况,在 Allegro 中用于精确计算信号传输的真实路径长度[^1]。 ```python def calculate_total_etch_length(wire_segments): """ Calculate the total etch length of a wire. Args: wire_segments (list): List of tuples representing segments, each containing start and end points Returns: float: The sum of lengths of all segments """ from math import sqrt return sum(sqrt((end_x-start_x)**2 + (end_y-start_y)**2) for (start_x, start_y), (end_x, end_y) in wire_segments) ``` ### 曼哈顿距离 (Manhattan Distance) 曼哈顿距离则是指两点之间沿坐标轴方向上的绝对差值之和,简单来说就是只允许水平或垂直移动而不考虑斜向的情况下的最短路径长度。对于VLSI布局工具而言,这意味着忽略掉任何角度小于90度的转弯部分,仅统计直角转折点之间的直线距离相加得到的结果[^3]。 ```python def calculate_manhattan_distance(point_a, point_b): """ Calculate Manhattan distance between two points. Args: point_a (tuple): Coordinates of first point as (x,y) point_b (tuple): Coordinates of second point as (x,y) Returns: int: Sum of absolute differences along axes """ ax, ay = point_a bx, by = point_b return abs(ax-bx)+abs(ay-by) ``` ### 两者的主要差异 - **精度不同**:由于 `Total Etch Length` 更贴近实际情况,因此其数值通常大于等于对应的 `Manhattan Distance` 。特别是在存在大量曲折线路的情况下,两者的差距可能会更加明显。 - **应用场景有别**:虽然两种方法都可以用来评估布线长度,但在某些特定场合下各有优势。比如当关注电磁兼容性等问题时更倾向于采用前者;而后者则更适合于初步规划阶段快速估算所需资源等场景.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值