From 945368db9cf21c6a402260f6ee03350893a233ef Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Mon, 27 Sep 2021 16:41:32 +0200 Subject: [PATCH] xschem simulation doc updates --- doc/xschem_man/symbol_property_syntax.html | 6 ++++++ src/hilight.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/xschem_man/symbol_property_syntax.html b/doc/xschem_man/symbol_property_syntax.html index b65bfbad..02469cfd 100644 --- a/doc/xschem_man/symbol_property_syntax.html +++ b/doc/xschem_man/symbol_property_syntax.html @@ -337,10 +337,16 @@ m5 net1 b net2 VSSPIN nlv w=wn l=ln geomod=0 m=1
  • |: Does a logical OR operation of the last 2 elements on top of the stack, the result is left on the stack
  • ^: Does a logical XOR operation of the last 2 elements on top of the stack, the result is left on the stack
  • ~: Does a logical Negation operation of the last element on top of the stack, the result is left on the stack
  • +
  • M: preceeded by 3 element 'a', 'b', 'm', return 'a' if 'm' == 0, 'b' if 'm'==1, else 'X'
  • +
  • m: same as above, but don't update if 'm' not 1 or 0. Used to avoid deadlocks.
  • +
  • z: preceeded by 2 elements, 'a', 'e', return 'a' if 'e' == 1 else Z (hi-Z)
  • d: Duplicates top element on the stack
  • x: Exhanges the 2 top elements on the stack
  • +
  • r: Rotate down: bottom element of stack goes to top
  • H: Puts a Logic '1' on the stack
  • L: Puts a Logic '0' on the stack
  • +
  • Z: Puts a Logic 'Z' on the stack
  • +
  • U: Puts a Logic 'U' on the stack (do not assign to node)
  • The remaining value on the stack is the value that is returned and assigned to the output pin. diff --git a/src/hilight.c b/src/hilight.c index f6c6bd00..e8ca84aa 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -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;