C
cruzin
Guest
Is it possible to make a function synchronous to the clock?
I have written an arbitrary-size mux using a recursive function:
function mux( ... )
begin
...
return ( mux(top_half), mux(bottom_half) );
end mux;
To improve synthesized performance, I want to register each level of
the mux. Something like:
function mux( clk, ... )
begin
...
wait until clk='1';
return ( mux(top_half), mux(bottom_half) );
end mux;
I realize I can not use wait in a function.
Are functions always meant to complete in zero-time? Is my only
recourse to write the synchronous mux using a recursive component
model?
I have written an arbitrary-size mux using a recursive function:
function mux( ... )
begin
...
return ( mux(top_half), mux(bottom_half) );
end mux;
To improve synthesized performance, I want to register each level of
the mux. Something like:
function mux( clk, ... )
begin
...
wait until clk='1';
return ( mux(top_half), mux(bottom_half) );
end mux;
I realize I can not use wait in a function.
Are functions always meant to complete in zero-time? Is my only
recourse to write the synchronous mux using a recursive component
model?