Commit a4515fff authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

cgen_vhdl: fixed f_x_to_zero() function in generated VHDL package causing…

cgen_vhdl: fixed f_x_to_zero() function in generated VHDL package causing synthesis error on Mentor Precision
parent 09fa8c89
......@@ -102,12 +102,12 @@ function cgen_vhdl_package()
emit("package body "..pkg_name.." is");
emit("function f_x_to_zero (x:std_logic) return std_logic is");
emit("begin");
emit("if(x = 'X' or x = 'U') then");
emit("return '0';");
emit("else");
emit("return x;");
emit("end if; ");
emit("begin")
emit("if x = '1' then")
emit("return '1';")
emit("else")
emit("return '0';")
emit("end if;")
emit("end function;");
emit("function f_x_to_zero (x:std_logic_vector) return std_logic_vector is");
......
......@@ -882,12 +882,12 @@ emit("end package;");
emit("");
emit("package body "..t.." is");
emit("function f_x_to_zero (x:std_logic) return std_logic is");
emit("begin");
emit("if(x = 'X' or x = 'U') then");
emit("return '0';");
emit("else");
emit("return x;");
emit("end if; ");
emit("begin")
emit("if x = '1' then")
emit("return '1';")
emit("else")
emit("return '0';")
emit("end if;")
emit("end function;");
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);");
......
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