Go to Post Gracious professionalism... otherwise, the program has failed. - Yan Wang [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-08-2013, 21:03
tragic tragic is offline
Programming Mentor
FRC #4633 (Bobcats)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Calgary Alberta
Posts: 19
tragic is an unknown quantity at this point
Question CRIO SIMD

Hello all.

Im interested to know if the CRIO supports SIMD (Single Instruction Multiple Data)
(https://en.wikipedia.org/wiki/SIMD)
Or if anyone has the technical specifications that would be great as well.

The reason I ask is because I am currently working on a math library for a game engine and it uses the 128bit register on the CPU to hold multiple data that can be operated on with a single instruction thus increasing performance (e.g. scaling a vector (x,y,z)*2)

So i was thinking same technique could be used to increase code performance for FRC 2014.
  #2   Spotlight this post!  
Unread 08-08-2013, 01:12
gluxon's Avatar
gluxon gluxon is offline
\n
AKA: Brandon Cheng
FRC #0178 (The 2nd Law Enforcers)
Team Role: Leadership
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Connecticut
Posts: 65
gluxon has a spectacular aura aboutgluxon has a spectacular aura aboutgluxon has a spectacular aura about
Re: CRIO SIMD

Searching the cRIO's processor documentation online instead of the cRIO itself may help.

Quote:
Originally Posted by https://decibel.ni.com/content/thread/13043
The processor in the cRIO-FRC is a Freescale MPC5200B. In the cRIO-FRC II it is a Frescale MPC5125.
If I may ask, what kind of application are you using this for?
  #3   Spotlight this post!  
Unread 08-08-2013, 02:32
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 487
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: CRIO SIMD

Corresponding manuals:
http://cache.freescale.com/files/mic...5RM.pdf?fpsp=1
http://cache.freescale.com/files/32b...BUM.pdf?fr=gdc

A quick glance seems to suggest you're out of luck.
  #4   Spotlight this post!  
Unread 08-08-2013, 04:05
tragic tragic is offline
Programming Mentor
FRC #4633 (Bobcats)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Calgary Alberta
Posts: 19
tragic is an unknown quantity at this point
Re: CRIO SIMD

Quote:
Originally Posted by gluxon View Post
If I may ask, what kind of application are you using this for?
I was hoping to optimize the source code of our robot a bit further.

Quote:
Corresponding manuals:
http://cache.freescale.com/files/mic...5RM.pdf?fpsp=1
http://cache.freescale.com/files/32b...BUM.pdf?fr=gdc

A quick glance seems to suggest you're out of luck.
yeah I don't see anything either but it was worth a shot.

Thanks all for the help and documents
  #5   Spotlight this post!  
Unread 08-08-2013, 07:31
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: CRIO SIMD

I'm just wondering, what exactly are you planning to do on the cRIO that requires optimization of the math library? Also, you'll only see benefits on things that deal with complex math and vectors, not something that teams really use too much on FRC robots.

If your robot's code doesn't work correctly (100% CPU usage), and it needs to be optimized, you can post it here and people can help.

NOTE: This is wrong, it doesn't have SIMD.
Also, the first page in the datasheet for the cpu says
e300 Power Architecture processor core
Wikipedia says that all e300's meet Power ISA 2.03
Wikipedia says that Power ISA 2.03 requires AltiVec
Wikipedia says AltiVec is a floating point and integer SIMD instruction set

Most modern processors have SIMD, so it's not always explicitly stated in the datasheet.

Last edited by magnets : 08-08-2013 at 08:09.
  #6   Spotlight this post!  
Unread 08-08-2013, 07:46
Isaac501 Isaac501 is offline
Registered User
FRC #0501 (The PowerKnights)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 1995
Location: Thunder Bluff
Posts: 95
Isaac501 is just really niceIsaac501 is just really niceIsaac501 is just really niceIsaac501 is just really nice
Re: CRIO SIMD

The e300 (PPC 603e) doesn't have altivec.

http://www.freescale.com/files/commu..._e600_comp.pdf


I'd be more worried about making the robot move and function properly than trying to speed up a math library that's rarely used in this application in the first place....
__________________
Team 501 Academic Advisor, Systems Build Mentor
  #7   Spotlight this post!  
Unread 08-08-2013, 08:07
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: CRIO SIMD

Oops!
The reference book in front of me says e200 and up, but when I actually read the wikipedia article, it doesn't show that e300 is in 2.03.
  #8   Spotlight this post!  
Unread 08-08-2013, 19:09
tragic tragic is offline
Programming Mentor
FRC #4633 (Bobcats)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Calgary Alberta
Posts: 19
tragic is an unknown quantity at this point
Re: CRIO SIMD

Quote:
Originally Posted by Isaac501 View Post
I'd be more worried about making the robot move and function properly than trying to speed up a math library that's rarely used in this application in the first place....
Quote:
I'm just wondering, what exactly are you planning to do on the cRIO that requires optimization of the math library? Also, you'll only see benefits on things that deal with complex math and vectors, not something that teams really use too much on FRC robots.

If your robot's code doesn't work correctly (100% CPU usage), and it needs to be optimized, you can post it here and people can help.
The robot is functional.

I just have a lot time on my hands so I've been investing my time into learning new software design, coding concepts, techniques and libraries even if its trivial or non applicable to the function of the robot. (What im doing is more for my own benefit, but if i can incorporate it to assist my team its even better)
  #9   Spotlight this post!  
Unread 08-08-2013, 19:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: CRIO SIMD

If you can wait until 2015, the roboRIO's Cortex A9 ARM processor appears to support NEON.
  #10   Spotlight this post!  
Unread 08-08-2013, 20:40
tragic tragic is offline
Programming Mentor
FRC #4633 (Bobcats)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Calgary Alberta
Posts: 19
tragic is an unknown quantity at this point
Re: CRIO SIMD

Quote:
Originally Posted by Joe Ross View Post
If you can wait until 2015, the roboRIO's Cortex A9 ARM processor appears to support NEON.
That is good to know. Its just a question now of whether or not they will enable NEON as it is listed as optional on the specs of the Cortex A9. I hope the RRIO gets deployed before I enroll for U of BC so I can at least mentor for a bit.

Last edited by tragic : 08-08-2013 at 21:18.
  #11   Spotlight this post!  
Unread 09-08-2013, 01:13
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 268
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: CRIO SIMD

Quote:
Originally Posted by tragic View Post
That is good to know. Its just a question now of whether or not they will enable NEON as it is listed as optional on the specs of the Cortex A9. I hope the RRIO gets deployed before I enroll for U of BC so I can at least mentor for a bit.
Per http://www.xilinx.com/products/silic...ices/index.htm, all Xilinx Zynq 7000 series devices have NEON support, including the 7020 that the RoboRIO uses.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
  #12   Spotlight this post!  
Unread 09-08-2013, 07:25
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: CRIO SIMD

I applaud your curiosity to better understand computer architectures. To reiterate, the cRIO processor used in FRC does not support any vector operations in HW, no SIMD. Rather than wait for a new controller or look for opportunities to do this with robotics, I'd encourage you to do this on your desktop or laptop computer. SSE, MMX, and other vector technologies from Intel are readily available and great examples to learn from.

My own exposure to this was via Altivec a number of years ago when a bug caused me to break into disassembled code for the system's memcpy, copyMem, or whatever it was called then. I was puzzled to find an complex arrangement of vector and prefetch instructions being used. The complexity was there to optimize a various alignment situations, and the calling code was copying a large buffer from an even to an odd address. The architecture isn't generally efficient at dealing with odd accesses, so they used Altivec to unroll and vectorize the operation.

This led me to find other libraries hand-tuned with Altivec including those for image processing and sound processing.

My suggestion would be to find a project that interests you, perhaps sound processing or image processing and compare different implementation techniques for the same operation. You can write very simple C code to walk through the data, use vector iterators, and compare to optimized SSE libraries from Intel. Even better is to use the debugger or the disassembly option of the compiler to inspect what the compiler produced and what the CPU is executing. Use the reference manuals and white papers for SSE to better understand why the libraries were written that way. This sort of investigation is still something I do from time to time to understand newer architecture features and language features.

Greg McKaskle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi