cycles.m 1.9 KB

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