Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).
Hi all,
i'm writing a piece of assembly code and i get unespected behaviour.
The significant part of the code is:
LOOP:
exec packet # 1:
[B_i] BDEC .S2 LOOP, B_i
exec packet # 2:
XPND4 .M1 A_cmp, A_mask
|| AND .L1 A_y, A_mask, A_sd
|| SHL .S1 A_4, SH, A_o4
exec packet # 3:
MPY2 .M1 A_43, A_scale, A_4:A_3
|| SHL .S1 A_3, SH, A_o3
END OF LOOP
I have XPND4 instruction and MPY2 that should give me a result in the
exec packet #1 (XPND4 has 1 cycle delay while MPY2 has 3). The
expected behaviour is to have in A_4:A_3 the result of MPY2 and in
A_mask the result of XPND4. Actually i get the MPY2 result in A_3 ok,
but in A_mask there is nothing while the XPND4 result in put in A_4. I
found no documentation on this and i'm asking you if this is normal
and i didn't searched the documentation well or... what else ?
Thanks to all
Emiliano
--
Emiliano Testa
Sviluppo software embedded
Politecnico di Torino
"certamente l'Italia e l'Europa meritano qualcosa di meglio di Silvio
Berlusconi" The Observer
"Io non so se sia nata prima la prostituzione o il capitalismo, ma
Sombart ha scoperto che la donna e il denaro sono due termini
dipendenti l'uno dall'altro." Mario Mariani
------------------------------------
OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
Emiliano, On Fri, Jul 25, 2008 at 5:14 AM, Emiliano Testa <c...@gmail.com> wrote: > Hi all, > i'm writing a piece of assembly code and i get unespected behaviour. > The significant part of the code is: > > LOOP: > > exec packet # 1: > [B_i] BDEC .S2 LOOP, B_i > > exec packet # 2: > XPND4 .M1 A_cmp, A_mask > || AND .L1 A_y, A_mask, A_sd > || SHL .S1 A_4, SH, A_o4 > > exec packet # 3: > MPY2 .M1 A_43, A_scale, A_4:A_3 > || SHL .S1 A_3, SH, A_o3 > > END OF LOOP > > I have XPND4 instruction and MPY2 that should give me a result in the > exec packet #1 (XPND4 has 1 cycle delay while MPY2 has 3). The > expected behaviour is to have in A_4:A_3 the result of MPY2 and in > A_mask the result of XPND4. Actually i get the MPY2 result in A_3 ok, > but in A_mask there is nothing while the XPND4 result in put in A_4. I > found no documentation on this and i'm asking you if this is normal > and i didn't searched the documentation well or... what else ? <mld> Which DSP do you have?? It is important. 1. Put a BP [breakpoint] at the beginning of the loop. 2. Run to the BP 3. View the code in the disassembly window to verify that it is what you expect. Look closely at registers. 4. Asm step through the code with the view registers window open to see if you get a clue. mikedunn > > Thanks to all > > Emiliano > > -- > Emiliano Testa > Sviluppo software embedded > Politecnico di Torino > > "certamente l'Italia e l'Europa meritano qualcosa di meglio di Silvio > Berlusconi" The Observer > > "Io non so se sia nata prima la prostituzione o il capitalismo, ma > Sombart ha scoperto che la donna e il denaro sono due termini > dipendenti l'uno dall'altro." Mario Mariani -- www.dsprelated.com/blogs-1/nf/Mike_Dunn.php ------------------------------------ OMAP35x EVM jump-starts low-power apps ------------------------------------ The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
2008/7/25 Michael Dunn <m...@gmail.com>: > Emiliano, > [...] > > <mld> > Which DSP do you have?? It is important. Sorry, i forgot: it's a TMS320C6416T, 1GHz clock. > 1. Put a BP [breakpoint] at the beginning of the loop. > 2. Run to the BP > 3. View the code in the disassembly window to verify that it is what > you expect. Look closely at registers. > 4. Asm step through the code with the view registers window open to > see if you get a clue. No, i didn't find the problem but since i have no time i wrote the routine in a different manner to avoid that the same unit has to give two results in the same cycle. Now i make XPND4, NOP, MPY and in this case it works perfectly. In future i will be careful on what i write, thanks for the reply. Emiliano -- Emiliano Testa Sviluppo software embedded Politecnico di Torino "certamente l'Italia e l'Europa meritano qualcosa di meglio di Silvio Berlusconi" The Observer "Io non so se sia nata prima la prostituzione o il capitalismo, ma Sombart ha scoperto che la donna e il denaro sono due termini dipendenti l'uno dall'altro." Mario Mariani ------------------------------------ OMAP35x EVM jump-starts low-power apps ------------------------------------ The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
Hello Emiliano, Just a thought... Please be careful with your quotes at the bottom of your messages, since they might be way off-topic, just a liiiittle offensive, not really funny or simply this might not the place where to share them. I'm sure you'll understand and I hope next time you'll keep this kind of thoughts for yourself and your close friends. Thanks. > "Io non so se sia nata prima la prostituzione o il capitalismo, ma > Sombart ha scoperto che la donna e il denaro sono due termini > dipendenti l'uno dall'altro." Mario Mariani Mercedes.
Is this code linear assembly or scheduled assembly? I am guessing it is scheduled since the branch is above the end of the loop. I can also see that you have 5 instructions past the branch to account for the 5 instructions that will execute from the pipeline before the branch is effective. However, the 5 "instructions" should be 5 execute packets and since you have 3 instructions in the first and 2 instructions in the 2nd execute packets your loop is executing the following 3 execute packets before the branch takes effect. On Fri, Jul 25, 2008 at 3:14 AM, Emiliano Testa <c...@gmail.com> wrote: > Hi all, > i'm writing a piece of assembly code and i get unespected behaviour. > The significant part of the code is: > > LOOP: > > exec packet # 1: > [B_i] BDEC .S2 LOOP, B_i > > exec packet # 2: > XPND4 .M1 A_cmp, A_mask > || AND .L1 A_y, A_mask, A_sd > || SHL .S1 A_4, SH, A_o4 > > exec packet # 3: > MPY2 .M1 A_43, A_scale, A_4:A_3 > || SHL .S1 A_3, SH, A_o3 > > END OF LOOP > > I have XPND4 instruction and MPY2 that should give me a result in the > exec packet #1 (XPND4 has 1 cycle delay while MPY2 has 3). The > expected behaviour is to have in A_4:A_3 the result of MPY2 and in > A_mask the result of XPND4. Actually i get the MPY2 result in A_3 ok, > but in A_mask there is nothing while the XPND4 result in put in A_4. I > found no documentation on this and i'm asking you if this is normal > and i didn't searched the documentation well or... what else ? > Thanks to all > > Emiliano > > -- > Emiliano Testa > Sviluppo software embedded > Politecnico di Torino > > "certamente l'Italia e l'Europa meritano qualcosa di meglio di Silvio > Berlusconi" The Observer > > "Io non so se sia nata prima la prostituzione o il capitalismo, ma > Sombart ha scoperto che la donna e il denaro sono due termini > dipendenti l'uno dall'altro." Mario Mariani > > ------------------------------------ > > OMAP35x EVM jump-starts low-power apps > ------------------------------------ > The modular and extensible OMAP35x Evaluation Module (EVM) enables > developers to start building applications based on the OMAP35x architecture: >http://www.DSPRelated.com/omap35x > > NEW! You can now post a message or access and search the archives of this > group on DSPRelated.com: > http://www.dsprelated.com/groups/c6x/1.php > > _____________________________________ > Note: If you do a simple "reply" with your email client, only the author of > this message will receive your answer. You need to do a "reply all" if you > want your answer to be distributed to the entire group. > > _____________________________________ > About this discussion group: > > Archives: http://www.dsprelated.com/groups/c6x/1.php > > To Post: Send an email to c...@yahoogroups.com > > Other DSP Related Groups: http://www.dsprelated.com/groups.phpYahoo! > Groups Links -- Gregory Lee
Please consider writing linear assembly, and allow the compiler about
scheduling the instructions. Yes, we need to play around with
the linear assembly input, but allowing the compiler to worry about
pipeline latencies allows it to take advantage of more advanced
architectural features as well, as keeping your code in a form that can
move from one generation to another, without having to re-code.
Regards
JS
________________________________
From: c...@yahoogroups.com [mailto:c...@yahoogroups.com] On Behalf Of
Gregory Lee
Sent: Saturday, July 26, 2008 10:23 AM
To: Emiliano Testa
Cc: c...@yahoogroups.com
Subject: Re: [c6x] Possible constraint?
Is this code linear assembly or scheduled assembly?
I am guessing it is scheduled since the branch is above the end of the
loop. I can also see that you have 5 instructions past the branch to
account for the 5 instructions that will execute from the pipeline
before the branch is effective. However, the 5 "instructions" should be
5 execute packets and since you have 3 instructions in the first and 2
instructions in the 2nd execute packets your loop is executing the
following 3 execute packets before the branch takes effect.
On Fri, Jul 25, 2008 at 3:14 AM, Emiliano Testa <c...@gmail.com>
wrote:
Hi all,
i'm writing a piece of assembly code and i get unespected behaviour.
The significant part of the code is:
LOOP:
exec packet # 1:
[B_i] BDEC .S2 LOOP, B_i
exec packet # 2:
XPND4 .M1 A_cmp, A_mask
|| AND .L1 A_y, A_mask, A_sd
|| SHL .S1 A_4, SH, A_o4
exec packet # 3:
MPY2 .M1 A_43, A_scale, A_4:A_3
|| SHL .S1 A_3, SH, A_o3
END OF LOOP
I have XPND4 instruction and MPY2 that should give me a result in the
exec packet #1 (XPND4 has 1 cycle delay while MPY2 has 3). The
expected behaviour is to have in A_4:A_3 the result of MPY2 and in
A_mask the result of XPND4. Actually i get the MPY2 result in A_3 ok,
but in A_mask there is nothing while the XPND4 result in put in A_4. I
found no documentation on this and i'm asking you if this is normal
and i didn't searched the documentation well or... what else ?
Thanks to all
Emiliano
--
Emiliano Testa
Sviluppo software embedded
Politecnico di Torino
------------------------------------
OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
> Subject: Re: Possible constraint? > Posted by: "Emiliano Testa" c...@gmail.com emiliano.testa > Date: Fri Jul 25, 2008 8:23 am ((PDT)) > > No, i didn't find the problem but since i have no time i wrote the > routine in a different manner to avoid that the same unit has to give > two results in the same cycle. Hi Emiliano, Why are you saying that you didn't find the glitch? Yes you have! A functional unit most certainly cannot yield _two_ results on the same cycle - this is stated in the description of the pipeline. Rgds, Andrew ------------------------------------ OMAP35x EVM jump-starts low-power apps ------------------------------------ The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
2008/7/27 Andrew Nesterov <a...@techemail.com>: [...] > > Why are you saying that you didn't find the glitch? Yes you have! A > functional unit most certainly cannot yield _two_ results on the same > cycle - this is stated in the description of the pipeline. Ok, i missed this information in the manual, next time i'll read more carefully, thanks a lot! > > Rgds, > Andrew Emiliano -- Emiliano Testa Sviluppo software embedded Politecnico di Torino "certamente l'Italia e l'Europa meritano qualcosa di meglio di Silvio Berlusconi" The Observer ------------------------------------ OMAP35x EVM jump-starts low-power apps ------------------------------------ The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x