![]() |
|
|
|
#1 |
|
Hello,
I have question: If Argument of case is generic from entity, then after synthesis generated code will be equal to Q<= romValueArray2(iConvAdress); ???? ------------------------------------------ entity xxxx is generic( sectionCount :integer := 2; -- section count ); ....................... architecture xxx_arch of xxx is begin process(ADDRESS) variable iConvAdress:integer:=0; begin case sectionCount is when 2 => Q<= romValueArray2(iConvAdress); when 4 => Q<= romValueArray4(iConvAdress); ...................... MariuszK |
|
|
|
|
#2 |
|
Posts: n/a
|
"MariuszK" <> wrote in message
news: ups.com... > Hello, > I have question: > If Argument of case is generic from entity, then after synthesis > generated code will be equal to > Q<= romValueArray2(iConvAdress); ???? Yes, and you should see the same thing with a simulator. KJ |
|
|
|
#3 |
|
Posts: n/a
|
KJ napisal(a): > "MariuszK" <> wrote in message > news: ups.com... > > Hello, > > I have question: > > If Argument of case is generic from entity, then after synthesis > > generated code will be equal to > > Q<= romValueArray2(iConvAdress); ???? > > Yes, and you should see the same thing with a simulator. > > KJ Maybe I don't detailed my question. But I want ask If used of fpga resources will be the same for architecture ............ case genericValue is when 2 => Q<= romValueArray2(iConvAdress); .......... and for architecture with only this line (genericValue = 2) Q<= romValueArray2(iConvAdress); Mariusz |
|
|
|
#4 |
|
Posts: n/a
|
"MariuszK" <> wrote in message
news: oups.com... > > KJ napisal(a): >> "MariuszK" <> wrote in message >> news: ups.com... >> > Hello, >> > I have question: >> > If Argument of case is generic from entity, then after synthesis >> > generated code will be equal to >> > Q<= romValueArray2(iConvAdress); ???? >> >> Yes, and you should see the same thing with a simulator. >> >> KJ > Maybe I don't detailed my question. But I want ask If used of fpga > resources will be the same for architecture > ........... > case genericValue is > when 2 => > Q<= romValueArray2(iConvAdress); > ......... > and for architecture with only this line (genericValue = 2) > Q<= romValueArray2(iConvAdress); > > > Mariusz > Yes, both flavors of code will synthesize to the exact same thing. In your original code with the case statement, the synthesizer will see that 'sectionCount', which is used to select the appropriate case, is constant and will optomize out all cases other than the one corresponding to the selected value of the constant (in this case 'sectionCount = 2'). That leaves only the line of code Q<= romValueArray2(iConvAdress); to implement/synthesize. No synthesis tool that I know of would do anything different in this situation. KJ |
|
|
|
#5 |
|
Posts: n/a
|
KJ napisal(a): > "MariuszK" <> wrote in message > news: oups.com... > > > > KJ napisal(a): > >> "MariuszK" <> wrote in message > >> news: ups.com... > >> > Hello, > >> > I have question: > >> > If Argument of case is generic from entity, then after synthesis > >> > generated code will be equal to > >> > Q<= romValueArray2(iConvAdress); ???? > >> > >> Yes, and you should see the same thing with a simulator. > >> > >> KJ > > Maybe I don't detailed my question. But I want ask If used of fpga > > resources will be the same for architecture > > ........... > > case genericValue is > > when 2 => > > Q<= romValueArray2(iConvAdress); > > ......... > > and for architecture with only this line (genericValue = 2) > > Q<= romValueArray2(iConvAdress); > > > > > > Mariusz > > > Yes, both flavors of code will synthesize to the exact same thing. In your > original code with the case statement, the synthesizer will see that > 'sectionCount', which is used to select the appropriate case, is constant > and will optomize out all cases other than the one corresponding to the > selected value of the constant (in this case 'sectionCount = 2'). That > leaves only the line of code > Q<= romValueArray2(iConvAdress); > to implement/synthesize. No synthesis tool that I know of would do anything > different in this situation. > > KJ Thank you very much for clear answer. It is exacly what I expected. Mariusz |
|
|
|
#6 |
|
Posts: n/a
|
Synthesis automatically optimizes out constants and static values.
Also, since for-loops are unrolled for synthesis, the loop index becomes effectively static, and is optimized out as well. Andy MariuszK wrote: > KJ napisal(a): > > "MariuszK" <> wrote in message > > news: oups.com... > > > > > > KJ napisal(a): > > >> "MariuszK" <> wrote in message > > >> news: ups.com... > > >> > Hello, > > >> > I have question: > > >> > If Argument of case is generic from entity, then after synthesis > > >> > generated code will be equal to > > >> > Q<= romValueArray2(iConvAdress); ???? > > >> > > >> Yes, and you should see the same thing with a simulator. > > >> > > >> KJ > > > Maybe I don't detailed my question. But I want ask If used of fpga > > > resources will be the same for architecture > > > ........... > > > case genericValue is > > > when 2 => > > > Q<= romValueArray2(iConvAdress); > > > ......... > > > and for architecture with only this line (genericValue = 2) > > > Q<= romValueArray2(iConvAdress); > > > > > > > > > Mariusz > > > > > Yes, both flavors of code will synthesize to the exact same thing. In your > > original code with the case statement, the synthesizer will see that > > 'sectionCount', which is used to select the appropriate case, is constant > > and will optomize out all cases other than the one corresponding to the > > selected value of the constant (in this case 'sectionCount = 2'). That > > leaves only the line of code > > Q<= romValueArray2(iConvAdress); > > to implement/synthesize. No synthesis tool that I know of would do anything > > different in this situation. > > > > KJ > > Thank you very much for clear answer. > It is exacly what I expected. > > Mariusz |
|