Ok, so based on the comment where Hida says that this is a timing issue, I think there could be a couple things going on here. I can help you improve timing, but I am not certain that we can get to 1.5Ghz. You should let us know which vendor you are using too.
You have a if with a reset, but you do not reset all variables. That is okay as long as you know that you don't have anything uninitialized. But the real thing here is that many new FPGA technologies, don't want you to use reset if you don't have to. I notice that you are reseting, x and y with inputs a and b. Do you have to do this? If you do not have to reset, x and y to a and b respectively, you can remove them from the reset and this will help timing improve.
Your state machine, (using the variable state) is not one hot. You may look at coding that to use one hot and that will give you a little boost.
To do this, make count a 40 bit registers, reset it to 40'h00001, and then on clock assign it as such count <= {count[38:0],count[39]};
then use the individual bit to trigger your logic.
Next, take a look at your if's You have a bunch of one-off if's. In some cases, you have multiple if's assigning the same variable. This probably okay, but the synthesizer is probably having to work some things out, and it might not be as efficient as it could be if you coded it differently. Try using a case statement. If you follow the one-hot suggestion above your case statements will be like this
case(count)
40'd11 : begin
do some stuff
end
40'd12 : begin
do some other stuff
end
etc...
endcase
Finally, also in your IF's, you have some if and if else going on. Get those massaged into this case statement above, because you are basically assignably priority to counts 27, 28 and 39. For one variable, there can and should be no priority between the values. The value is either 27, 28 or 39, or something else, and the logic will never have a case to choose one state over another.
If you make some of those changes, your speed should go up. Would really like to know which vendor is saying you hit 1.5Ghz though.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…