nervecell_23
Member level 1
Hi,
I want to capture the data that is available one clock cycle after the rising of a certain flag.
I experimented with the following code and it worked:
I find this very convenient because previously I have to create a new signal which equals to 'flag' with one clock cycle delay and then capture the data when the delayed signal is high.
I'm wondering if the above code is synthesizable and if it is the same thing as the conventional way of doing it in terms of the generated hardware after synthesis?
Thanks!
I want to capture the data that is available one clock cycle after the rising of a certain flag.
I experimented with the following code and it worked:
Code:
always@(posedge clk)
begin
if(flag == 1)begin
@(posedge clk);
$fwrite(file,"%d\n",data);
end
end
I find this very convenient because previously I have to create a new signal which equals to 'flag' with one clock cycle delay and then capture the data when the delayed signal is high.
I'm wondering if the above code is synthesizable and if it is the same thing as the conventional way of doing it in terms of the generated hardware after synthesis?
Thanks!