Forum Discussion
Altera_Forum
Honored Contributor
11 years agoI tried simulating the scaler chain.
First I have changed the input and output timing to exactly the same framerates: 1024x768 is beeing upscaled to 1280x1024, so the scaling factors are 1.25 and 1.3333 for horizontal and vertical direction. Input pixel clock is 60MHz, output clock is 60MHz x 1.25 x 1.3333 = 100MHz. The input size including blanking is 1248x801, the output size is 1248 x 1.25 and 801 x 1.3333 = 1560x1068. Both do not only produce exactly the same framerates of 60.0211Hz but also have the same effective data rates (output datarate = input data rate x 1.25 x 1.3333), so there should be a minimal buffer requirement. Both fifos at CVI and CVO cores are set to 16380 pixels (16 lines for a width of 1024 and 12.8 lines for 1280). But the result on the display is exactly the same as before: The last 5 lines are wrong. They are filled with the same color, probably from some pixels at the end of the previous line. In the simulation sooner or later underflow or overflow or both signals get set, depending on the CVI and CVO fifo settings. A CVO start threshold of around 2000 pixels seems to be the best value giving the earliest starting point without underflow getting set after a few lines. The output of the active frame starts arround line 5 of the active input data. At input line 22 overflow gets set. It seems strange to me, because of the large buffer size. Measuring the horizontal output timing it matches the settings: 1560 pixels per line. Therefore I have absolutely no idea why the fifo under or overflows. 18 lines of fifo buffer should be enough for a perfectly matched timing. It is really strange. The result on the display is always the same regardless of the fifo and timing settings unless I use something totally off. Then I get either no display at all, or I can clearly see a fifo over/underflow somewhere in the middle of the sreeen. But this looks totally different than the problem at the last 5 lines. From the output image it looks like the overflow and underflow signals are set spuriously, because up to the last 5 lines the image is completely fine. I have attached screenshots of the first few lines from the 1st and from the 3rd. frame. The almost randomly changing signals on the Avalon interface look suspicious. Can you give me any hints at what signals I should look at to identify the problem?