P
Pasacco
Guest
Hi
I am having problem synthesizing VHDL functions and mapping in Xilinx
FPGA.
Simulation is working as expected.
But it is not working after synthesis (and implementation).
It seems that 'latches' are used and they are NOT functioning.
(I heard that we better use "flip flop" rather than 'latch' in FPGA)
Problem is following.
I wrote two simple functions.
One function generates 'multiplexor'.
The other function generates "multiplexor select signal".
Each function looks like below.
I need these "variable initializations".
In case latches generated for "MUX_OUT" and "MUX_SEL_OUT" signals are
problems,
can anyone help me with working around this problem? Thankyou.
------------------------------------------------------------------------------------
--- function 1 : very simple multiplexor
------------------------------------------------------------------------------------
function MUX_FUNC( Temp: <some type> ) return integer is
variable MUX_OUT : integer;
begin
MUX_OUT := 0; /* this part is unclear */
if <some condition> then MUX_OUT := 0;
else
for <loop range> loop
if <some condition> then
MUX_OUT := <some value>;
end if;
end loop;
end if;
return MUX_OUT;
end MUX_FUNC;
-----------------------------------------------------------------------------------
-- function 2 : very simple "mux select signal generator"
------------------------------------------------------------------------------------
function MUX_SEL_FUNC( Temp: <some type> ) return <some type> is
variable MUX_SEL_OUT : <some type>;
begin
MUX_SEL_OUT := 0; /* this part is unclear */
Loop1: for <loop range> loop
if <some condition> then
MUX_SEL_OUT := <some value>
end if;
end loop;
return MUX_SEL_OUT;
end MUX_SEL_FUNC;
I am having problem synthesizing VHDL functions and mapping in Xilinx
FPGA.
Simulation is working as expected.
But it is not working after synthesis (and implementation).
It seems that 'latches' are used and they are NOT functioning.
(I heard that we better use "flip flop" rather than 'latch' in FPGA)
Problem is following.
I wrote two simple functions.
One function generates 'multiplexor'.
The other function generates "multiplexor select signal".
Each function looks like below.
I need these "variable initializations".
In case latches generated for "MUX_OUT" and "MUX_SEL_OUT" signals are
problems,
can anyone help me with working around this problem? Thankyou.
------------------------------------------------------------------------------------
--- function 1 : very simple multiplexor
------------------------------------------------------------------------------------
function MUX_FUNC( Temp: <some type> ) return integer is
variable MUX_OUT : integer;
begin
MUX_OUT := 0; /* this part is unclear */
if <some condition> then MUX_OUT := 0;
else
for <loop range> loop
if <some condition> then
MUX_OUT := <some value>;
end if;
end loop;
end if;
return MUX_OUT;
end MUX_FUNC;
-----------------------------------------------------------------------------------
-- function 2 : very simple "mux select signal generator"
------------------------------------------------------------------------------------
function MUX_SEL_FUNC( Temp: <some type> ) return <some type> is
variable MUX_SEL_OUT : <some type>;
begin
MUX_SEL_OUT := 0; /* this part is unclear */
Loop1: for <loop range> loop
if <some condition> then
MUX_SEL_OUT := <some value>
end if;
end loop;
return MUX_SEL_OUT;
end MUX_SEL_FUNC;