cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
saber26
Participant
Participant
6,384 Views
Registered: ‎03-18-2014

Running 2 tasks on both CPU of the Zynq

Hello every body,

 

I am trying ton run two tasks (one on the fisrt CPU other on the second) under FreeRTOS or Linux. I have installed FreeRTOS on the Zynq. I have tested it by running 2 tasks on one CPU and it ok.
But i don't how to share both CPU.

 

Via SDK i create a project (using ps7_cortexa9_0) than another one (using ps7_cortexa9_1) and in the main of each one i create my tasks. How to link between each projetc ? i mean how to link between each task in each Core ?

 

Thanks a lot

0 Kudos
Reply
6 Replies
Anonymous
Not applicable
6,382 Views

0 Kudos
Reply
saber26
Participant
Participant
6,372 Views
Registered: ‎03-18-2014

Hello, 

 

Thaks for your reply. 

But what i want to do is a sample SMP architecture. I mean a single OS to utilize both cores and scedule 2 tasks for example on both cores.

 

Best regards

0 Kudos
Reply
milosoftware
Scholar
Scholar
6,365 Views
Registered: ‎10-26-2012

If you run Linux on the zynq, it will automatically allocate tasks to CPUs as it sees fit. It will do a better job than manually assigning tasks to cores, even though it allows you to bind tasks to cores if you insist.

0 Kudos
Reply
saber26
Participant
Participant
6,350 Views
Registered: ‎03-18-2014

Thanks.

 

But how bind tasks to core ? I mean i want to choose the core that will contain the task is it possible to do that ?

0 Kudos
Reply
johnmcd
Xilinx Employee
Xilinx Employee
6,342 Views
Registered: ‎02-01-2008

Sounds like you want to set processor affinity. Do a google search for the C functions or command line options.

0 Kudos
Reply
milosoftware
Scholar
Scholar
6,333 Views
Registered: ‎10-26-2012

Just google on "cpu affinity".

 

Be aware that manually assigning threads to CPUs will invariably result in lower performance. Don't do it - unless there's a very specific reason that you know better than the OS how to schedule processes.

 

I'm very curious to what you are trying to accomplish. Please tell us why you think you can do better than the Linux scheduler!

0 Kudos
Reply