Commit ed4e1500 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

cgen_vhdl: fixed f_x_to_zero(std_logic_vector) for Mentor Precision

parent ff1f5a98
......@@ -114,10 +114,10 @@ function cgen_vhdl_package()
emit("variable tmp: std_logic_vector(x'length-1 downto 0);");
emit("begin");
emit("for i in 0 to x'length-1 loop");
emit("if(x(i) = 'X' or x(i) = 'U') then");
emit("tmp(i):= '0';");
emit("if x(i) = '1' then");
emit("tmp(i):= '1';");
emit("else");
emit("tmp(i):=x(i);");
emit("tmp(i):= '0';");
emit("end if; ");
emit("end loop; ");
emit("return tmp;");
......
......@@ -899,10 +899,10 @@ emit("function f_x_to_zero (x:std_logic_vector) return std_logic_vector is");
emit("variable tmp: std_logic_vector(x'length-1 downto 0);");
emit("begin");
emit("for i in 0 to x'length-1 loop");
emit("if(x(i) = 'X' or x(i) = 'U') then");
emit("tmp(i):= '0';");
emit("if x(i) = '1' then");
emit("tmp(i):= '1';");
emit("else");
emit("tmp(i):=x(i);");
emit("tmp(i):= '0';");
emit("end if; ");
emit("end loop; ");
emit("return tmp;");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment