--- Quote Start ---
You can find a lot of examples of pipelines in books and on web. Have you found where to insert pipeline in VHDL?
--- Quote End ---
I think I should insert pipeline in the code below. Am I right?
-- Gray bar(16 gray bars)
HelperGrayBar <= "1111"; -- gray level 15
if unsigned(Setting_Pixel) < shift_right(unsigned(Setting_TotPixel),4) then
HelperGrayBar <= "0000"; -- black
elsif unsigned(Setting_Pixel) < shift_right(unsigned(Setting_TotPixel),3) then
HelperGrayBar <= "0001"; -- gray level 1
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),3)) + (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "0010"; -- gray level 2
elsif unsigned(Setting_Pixel) < shift_right(unsigned(Setting_TotPixel),2) then
HelperGrayBar <= "0011"; -- gray level 3
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),2)) + (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "0100"; -- gray level 4
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),2)) + (shift_right(unsigned(Setting_TotPixel),3))) then
HelperGrayBar <= "0101"; -- gray level 5
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) - (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "0110"; -- gray level 6
elsif unsigned(Setting_Pixel) < (shift_right(unsigned(Setting_TotPixel),1)) then
HelperGrayBar <= "0111"; -- gray level 7
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) + (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "1000"; -- gray level 8
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) + (shift_right(unsigned(Setting_TotPixel),3))) then
HelperGrayBar <= "1001"; -- gray level 9
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) + (shift_right(unsigned(Setting_TotPixel),3)) + (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "1010"; -- gray level 10
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) + (shift_right(unsigned(Setting_TotPixel),2))) then
HelperGrayBar <= "1011"; -- gray level 11
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) + (shift_right(unsigned(Setting_TotPixel),2)) + (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "1100"; -- gray level 12
elsif unsigned(Setting_Pixel) < ((shift_right(unsigned(Setting_TotPixel),1)) + (shift_right(unsigned(Setting_TotPixel),2)) + (shift_right(unsigned(Setting_TotPixel),3))) then
HelperGrayBar <= "1101"; -- gray level 13
elsif unsigned(Setting_Pixel) < (unsigned(Setting_TotPixel) - (shift_right(unsigned(Setting_TotPixel),4))) then
HelperGrayBar <= "1110"; -- gray level 14
end if;
If there are some limitation of the resources that i'm not allowed to add more pipeline, do you have some ideas to simplify the logic in my design?