Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

Packed data in Ruby?

DSP related issues, mathematics, processing and techniques

Re: Packed data in Ruby?

Postby tulamide » Sat Nov 28, 2015 5:25 pm

martinvicanek wrote:And then you still need to check for a valid mem address in the ASM, which is about what a hop instruction would cost CPU wise.

I don't understand what you mean by "vast overkill"? What the Ruby module does is the same as what Flowstone does in the background.
That valid mem check was introduced for the case that new data of different size is incoming (which makes a new memory block neccessary). Since for this project you will always have 16 bytes no matter what, I can refine the module to always use the same mem-block and just replace the data. So you would only need to check once, when the whole mechanism starts.
tulamide
 
Posts: 2160
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Packed data in Ruby?

Postby tulamide » Thu Dec 03, 2015 5:17 am

I wasn't quite sure wether you wanted me to do it or not, since you didn't react. Also, you didn't sound very optimistic regarding the use of it.

I'm currently at this result: Basically, it works. So, if it runs, it runs. But for some reason I sometimes have to switch the RubyEdit off and back on (even multiple times here and there), before it works. I tried to find the cause for the last two days, but didn't succeed. Whatever I change in code, this behavior stays.

I publish it in this version because you can already try it. Just look inside the module in the RubyEdit info pane after you loaded the schematic and triggered "create mem block". If you read "QuickWatch = 6.0", everythings working. If you read 0.0 instead of 6.0, you have to switch the RubyEdit off and on, trigger "create mem block", and repeat this until you read 6.0. From then on it works and you can start changing the floats (use "update mem block" after the changes).

If your tests reveal that you would like to use it, tell me and I will continue to solve the issue. If not, I'll keep it in this stage.

Oh, and if anyone finds the issue - don't hesitate to point me to the stupid mistake I made!
Attachments
floats_to_sse.fsm
(2.13 KiB) Downloaded 528 times
tulamide
 
Posts: 2160
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Packed data in Ruby?

Postby martinvicanek » Thu Dec 03, 2015 10:13 am

Thanks tulamide, I really appreciate your help. It is a pity that we have no easier and more reliable way to manage memory. Even if your solution does work with a little help by the user, I still consider it too much overhed in comparison with a straight assignment in stage0. So for me you can leave it at that.
Once again, thank you for your help. Believe it or not, by studiyng your examples I am finally beginning to write my own stuff in Ruby. :)
User avatar
martinvicanek
 
Posts: 1056
Joined: Sat Jun 22, 2013 8:28 pm

Re: Packed data in Ruby?

Postby tulamide » Thu Dec 03, 2015 10:56 am

I agree when it comes to SSE-compatible memory blocks. It should be easier (in C/C++ there's a simple function call that you just give the size as parameter). The difference, as far as I understood is, that with stage0 you can't change the floats at runtime, right? Because with this Ruby solution (when it's working reliable) you can.

But I would prefer a solution all in assembler as well, if it is doable.

And nice to see that I could push you to the bright side of programming languages ;)
tulamide
 
Posts: 2160
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Previous

Return to DSP

Who is online

Users browsing this forum: No registered users and 2 guests