xschem simulation doc updates

This commit is contained in:
Stefan Frederik 2021-09-27 16:41:32 +02:00
parent e8e56aa025
commit 945368db9c
2 changed files with 9 additions and 3 deletions

View File

@ -337,10 +337,16 @@ m5 net1 b net2 VSSPIN nlv w=wn l=ln geomod=0 m=1
<li> <kbd>|</kbd>: Does a logical OR operation of the last 2 elements on top of the stack, the result is left on the stack</li>
<li> <kbd>^</kbd>: Does a logical XOR operation of the last 2 elements on top of the stack, the result is left on the stack</li>
<li> <kbd>~</kbd>: Does a logical Negation operation of the last element on top of the stack, the result is left on the stack</li>
<li> <kbd>M</kbd>: preceeded by 3 element 'a', 'b', 'm', return 'a' if 'm' == 0, 'b' if 'm'==1, else 'X' </li>
<li> <kbd>m</kbd>: same as above, but don't update if 'm' not 1 or 0. Used to avoid deadlocks.</li>
<li> <kbd>z</kbd>: preceeded by 2 elements, 'a', 'e', return 'a' if 'e' == 1 else Z (hi-Z)</li>
<li> <kbd>d</kbd>: Duplicates top element on the stack</li>
<li> <kbd>x</kbd>: Exhanges the 2 top elements on the stack</li>
<li> <kbd>r</kbd>: Rotate down: bottom element of stack goes to top</li>
<li> <kbd>H</kbd>: Puts a Logic '1' on the stack</li>
<li> <kbd>L</kbd>: Puts a Logic '0' on the stack</li>
<li> <kbd>Z</kbd>: Puts a Logic 'Z' on the stack</li>
<li> <kbd>U</kbd>: Puts a Logic 'U' on the stack (do not assign to node)</li>
</ul>
<p>
The remaining value on the stack is the value that is returned and assigned to the output pin.

View File

@ -1176,17 +1176,17 @@ int eval_logic_expr(int inst, int output)
if(s < 2) {
stack[sp - 3] = (s == 0) ? stack[sp - 3] : stack[sp - 2];
}
else stack[sp - 3] = 2; /* setting to 2 (X) leads to simulation deadlocks */
else stack[sp - 3] = 2; /* setting to 2 (X) may lead to simulation deadlocks */
sp -=2;
}
break;
case 'm': /* mux operator , lower priority*/
if(sp > 2) {
s = stack[sp - 1];
if(s < 2) { /* reduce pessimism, avoid infinite loops */
if(s < 2) {
stack[sp - 3] = (s == 0) ? stack[sp - 3] : stack[sp - 2];
}
else stack[sp - 3] = 4;
else stack[sp - 3] = 4; /* don't update, to avoid deadlocks */
sp -=2;
}
break;