Forum Discussion
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- Try to move part of the code into a concurent statement. Something like this: assign aux = frame_line_size - (player_1_length << 1); And then rewrite your code as: if((controller_buffer[RIGHTPAD]) && (player_1_pos < aux)) begin player_1_pos = player_1_pos + 1; end --- Quote End --- Naa, it doesn't seem to work. Thanks anyways. --- Quote Start --- Obviously. The design is effectively not synthesizable, because the complexity of set_pixel actions exceeds the logic resources of any available FPGA. It doesn't work this way. --- Quote End --- I think this is my problem. I guess I'll have to spread the work across several clock cycles. But, the odd thing is that when I replace this code that just increments/decrements based on a buffer flag: if((controller_buffer[LEFTPAD]) && (player_1_pos > 0)) begin player_1_pos <= player_1_pos - 1; end if((controller_buffer[RIGHTPAD]) && (player_1_pos < (frame_line_size - (player_1_length * 2)))) begin player_1_pos <= player_1_pos + 1; end with something like this that does a lot more processing: draw_player_1(player_1_pos, player_1_y + 20, GREEN); it compiles in 3 minutes, while the former code eventually runs out of memory after an hour. I guess the compiler is doing a lot more background work on the first block of code than the second block of code that I am not aware of. Thanks for your response.