RCCE_Fdiv.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Copyright 2010 Intel Corporation
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. #include "RCCE.h"
  17. #include <stdio.h>
  18. //void print_dividers(void);
  19. int RCCE_APP(int argc, char **argv){
  20. RCCE_REQUEST req;
  21. int fdiv, fdiv_in, ID;
  22. RCCE_init(&argc, &argv);
  23. if (argc==2) fdiv_in=atoi(*++argv);
  24. else return(0);
  25. ID = RCCE_ue();
  26. if (ID==RCCE_power_domain_master()) {
  27. if(RCCE_set_frequency_divider(fdiv_in, &fdiv)) {
  28. printf("UE %d failed SET_FREQUENCY_DIVIDER 8\n", ID);
  29. fflush(NULL);
  30. }
  31. else {
  32. printf("Requested fdiv: %d, actual fdiv: %d\n", fdiv_in, fdiv);
  33. fflush(NULL);
  34. }
  35. }
  36. RCCE_barrier(&RCCE_COMM_WORLD);
  37. //if (ID==0)
  38. print_dividers();
  39. RCCE_finalize();
  40. return(0);
  41. }