generate tool - source question
-
- Posts: 54
- Joined: Wed Mar 11, 2015 3:07 pm
generate tool - source question
Hi,
Why is there a loop in the following code of the generate tool?
https://github.com/RedPitaya/RedPitaya/ ... #L329:L331
is it possible to replace the loop with a memcpy?
Thanks,
Why is there a loop in the following code of the generate tool?
https://github.com/RedPitaya/RedPitaya/ ... #L329:L331
is it possible to replace the loop with a memcpy?
Thanks,
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generate tool - source question
The thing with this loop is, g_awg_ch[ab]_mem are pointers into the fpga's address space. The implication here is that you should only access this region 32bits at a time.
So replacing the loop with memcpy might work if 32bit accesses are preserved, but if the compiler decides to optimize the accesses, it may not work and you will experience difficult to diagnose problems.
In conclusion, I wouldn't risk it.
So replacing the loop with memcpy might work if 32bit accesses are preserved, but if the compiler decides to optimize the accesses, it may not work and you will experience difficult to diagnose problems.
In conclusion, I wouldn't risk it.
-
- Posts: 54
- Joined: Wed Mar 11, 2015 3:07 pm
Re: generate tool - source question
ok,
i think this issue is when you optimize your code with -O2 or -O3
could you memcpy from the /dev/mem to read the oscilloscope and memcpy to the /dev/mem to write to the awg? a for loops seems really slow...
i think this issue is when you optimize your code with -O2 or -O3
could you memcpy from the /dev/mem to read the oscilloscope and memcpy to the /dev/mem to write to the awg? a for loops seems really slow...
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generate tool - source question
mmapping dev/mem is just a way to tell the MMU how to retarget the accesses - the underlying restrictions of the targetted region remain in effect.
-
- Posts: 54
- Joined: Wed Mar 11, 2015 3:07 pm
Re: generate tool - source question
the code fails with -O3 optimization. the correct solution is to use a volatile pointer here! please fix this issue...
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generate tool - source question
I don't see an issue here - but if you do, I'll be welcoming useful contributions.
-
- Posts: 54
- Joined: Wed Mar 11, 2015 3:07 pm
Re: generate tool - source question
did you build the source with -O3?
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: generate tool - source question
No, I didn't, but I trust you when you say that building with -O3 breaks something.
The thing is, nobody ever said that it SHOULD work with aggressive optimizations turned on. If you change something, it is your responsibility to deal with any resulting issues.
The thing is, nobody ever said that it SHOULD work with aggressive optimizations turned on. If you change something, it is your responsibility to deal with any resulting issues.
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 18 guests