[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: draw_binary_real??



  XXXX draw_binary_real(%)
  ivl: eval_real.c:83: draw_binary_real: Assertion '0' failed.

Try the attached patch.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
steve at picturel.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

Index: tgt-vvp/eval_real.c
===================================================================
RCS file: /home/u/icarus/steve/CVS/verilog/tgt-vvp/eval_real.c,v
retrieving revision 1.8
diff -c -r1.8 eval_real.c
*** tgt-vvp/eval_real.c	23 Apr 2003 02:22:47 -0000	1.8
--- tgt-vvp/eval_real.c	24 May 2003 04:05:10 -0000
***************
*** 57,63 ****
  
  static int draw_binary_real(ivl_expr_t exp)
  {
!       int l, r;
  
        l = draw_eval_real(ivl_expr_oper1(exp));
        r = draw_eval_real(ivl_expr_oper2(exp));
--- 57,63 ----
  
  static int draw_binary_real(ivl_expr_t exp)
  {
!       int l, r = -1;
  
        l = draw_eval_real(ivl_expr_oper1(exp));
        r = draw_eval_real(ivl_expr_oper2(exp));
***************
*** 80,91 ****
  	    fprintf(vvp_out, "    %%div/wr %d, %d;\n", l, r);
  	    break;
  
  	  default:
  	    fprintf(stderr, "XXXX draw_binary_real(%c)\n",
  		    ivl_expr_opcode(exp));
  	    assert(0);
        }
!       clr_word(r);
  
        return l;
  }
--- 80,102 ----
  	    fprintf(vvp_out, "    %%div/wr %d, %d;\n", l, r);
  	    break;
  
+ 	  case '%':
+ 	      { struct vector_info res = draw_eval_expr(exp, STUFF_OK_XZ);
+ 		l = allocate_word();
+ 		fprintf(vvp_out, "    %%ix/get %d, %u, %u;\n",
+ 			l, res.base, res.wid);
+ 		fprintf(vvp_out, "    %%cvt/ri %d, %d;\n", l, l);
+ 	        clr_vector(res);
+ 	      }
+ 	      break;
+ 
  	  default:
  	    fprintf(stderr, "XXXX draw_binary_real(%c)\n",
  		    ivl_expr_opcode(exp));
  	    assert(0);
        }
! 
!       if (r >= 0) clr_word(r);
  
        return l;
  }