mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Correctly use physical port in mirror configuration
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@
|
||||
<div style="margin-left:16%;padding:1px 16px;height:1000px;">
|
||||
<div id="ports"></div>
|
||||
<h1>Mirror Configuration</h1>
|
||||
<label class="tswitch">Enabled: <input id="me" type="checkbox"><span class="slider"></span></label><br/>
|
||||
<label class="tswitch">Enabled: <input id="me" type="checkbox"></label><br/>
|
||||
<label for="mp">Mirroring Port:</label> <input type="number" id="mp" name="mp" min="1" max="9"/>
|
||||
<h2>Mirrored Ports (TX)</h2>
|
||||
<div id="mPortsTX"></div>
|
||||
|
||||
+4
-2
@@ -49,8 +49,10 @@ function fetchMirror() {
|
||||
let m_tx = parseInt(s.mirror_tx, 2);
|
||||
let m_rx = parseInt(s.mirror_rx, 2);
|
||||
for (let i = 1; i <= numPorts; i++) {
|
||||
setM("mPortsTX"+i, m_tx&1); setM("mPortsRX"+i, m_rx&1);
|
||||
m_tx = m_tx >> 1; m_rx = m_tx >> 1;
|
||||
let p = i - 1;
|
||||
if (numPorts < 9)
|
||||
p = physToLogPort[p];members & (1<<p)
|
||||
setM("mPortsTX"+i, m_tx&(1<<p)); setM("mPortsRX"+i, m_rx&(1<<p));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user