cycles.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. close all
  2. %set(0,'defaulttextinterpreter','latex')
  3. %set(0,'DefaultTextFontname', 'CMU Serif')
  4. %set(0,'DefaultAxesFontName', 'CMU Serif')
  5. %text(0.5, 0.8, '\textsf{sans serif}','interpreter','latex')
  6. %NaN 963; div ffff/0001
  7. %NaN 663; div ffff/ffff
  8. %NaN 598; div 0001/ffff
  9. data = [
  10. 208 204
  11. 361 534
  12. 618 1076
  13. 59 99
  14. 27 49
  15. 52 55
  16. ];
  17. grid on
  18. legend
  19. B = bar(1:length(data),data);
  20. x_labels = [
  21. {'Print Decimal 0000h'}
  22. {'Print Decimal FFFFh'}
  23. {'Modulus FFFFh%0001h'}
  24. {'Modulus FFFFh%FFFFh'}
  25. {'Modulus 0001h%FFFFh'}
  26. {'Multiply 16bit'}
  27. ];
  28. set(gca,'XTickLabel', x_labels);
  29. %x_labels = [
  30. %{'\begin{tabular}{r}Divide\\FFFFh/0001h\end{tabular}'}
  31. %{'\begin{tabular}{r}Divide\\FFFFh/FFFFh\end{tabular}'}
  32. %{'\begin{tabular}{r}Divide\\0001h/FFFFh\end{tabular}'}
  33. %{'\begin{tabular}{r}Modulus\\FFFFh\%0001h\end{tabular}'}
  34. %{'\begin{tabular}{r}Modulus\\FFFFh\%FFFFh\end{tabular}'}
  35. %{'\begin{tabular}{r}Modulus\\0001h\%FFFFh\end{tabular}'}
  36. %{'\begin{tabular}{r}Multiply 16bit\end{tabular}'}
  37. %];
  38. %set(gca,'XTickLabel', x_labels, 'TickLabelInterpreter', 'latex')
  39. title("Processor cycles per function")
  40. ylabel("Numer of cycles")
  41. xtickangle(30);
  42. xtips1 = [1:length(data)] - 0.21;
  43. ytips1 = B(1).YData;
  44. labels1 = string(B(1).YData);
  45. text(xtips1,ytips1,labels1,'HorizontalAlignment','center','VerticalAlignment','bottom');
  46. xtips2 = [1:length(data)] + 0.25;
  47. ytips2 = B(2).YData;
  48. labels2 = string(B(2).YData);
  49. text(xtips2,ytips2,labels2,'HorizontalAlignment','center','VerticalAlignment','bottom');
  50. legend("RISC", "OISC");
  51. grid on
  52. %set(gcf, 'Color', 'None')
  53. %%
  54. figure
  55. P = [359.09 360.851 360.732];
  56. Pstd = [0.245 0.239 0.223];
  57. bar(1:3,P)
  58. hold on
  59. er = errorbar(1:3, P, -Pstd./2,+Pstd./2);
  60. er.Color = [0 0 0];
  61. er.LineStyle = 'none';
  62. set(gca,'xticklabel',{'None'; 'RISC'; 'OISC'})
  63. ylabel("Power (mW)")
  64. title("Processor power consumtion")