parts.m 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. close all; clc
  2. % reportrisc = csvread('report_risc.csv');
  3. % reportoisc = csvread('report_oisc.csv');
  4. % load 'risc8.mat' risc8
  5. % load 'oisc8.mat' oisc8
  6. data = table2array(reportrisc(:,2:end-1));
  7. names = table2array(reportrisc(:,1));
  8. gnames = reportrisc.Properties.VariableNames(2:end-1);
  9. data = data-data(6,:);
  10. data(6,:) = [];
  11. data(1,:) = [];
  12. data2 = table2array(reportoisc(:,2:end-1));
  13. data2 = data2-data2(6,:); data2(data2<0)=0;
  14. data2(6,:) = [];
  15. data2(1,:) = [];
  16. names2 = table2array(reportoisc(:,1));
  17. gnames2 = reportoisc.Properties.VariableNames(2:end-1);
  18. gnames2_dst = erase(gnames2(1:2:end),"dst");
  19. gnames2_src = erase(gnames2(2:2:end),"src");
  20. namesf = {
  21. % "16bit division 0001h / 0001h";
  22. "16bit Modulo 0001h % FFFFh";
  23. "16bit Modulo FFFFh % 0001h";
  24. "16bit Modulo FFFFh % FFFFh";
  25. "16bit Multiplication";
  26. % "test functions";
  27. "Print Character";
  28. "Print 16bit unsigned int FFFFh";
  29. "Print 8bit unsigned int 00h";
  30. "Print 8bit unsigned int FFh";
  31. };
  32. d3names = {'Mod 0001h % FFFFh' 'Mod FFFFh % 0001h' ...
  33. 'Mod FFFFh % FFFFh' '16bit multiply' ...
  34. 'Print char' 'Print uint16 FFFFh' ...
  35. 'Print uint8 00h' 'Print uint8 FFh'};
  36. x2 = categorical(d3names);
  37. x2 = reordercats(x2,d3names);
  38. data3 = [table2array(reportrisc(:,end))'; table2array(reportoisc(:,end))']';
  39. data3(6,:) = [];
  40. data3(1,:) = [];
  41. bar(x2, data3, 1);
  42. grid on
  43. ylabel('Program size in bits')
  44. legend('RISC', 'OISC')
  45. xtickangle(60)
  46. title('Benchmark functions effective program size')
  47. %%
  48. x = categorical(gnames);
  49. x = reordercats(x,gnames);
  50. %
  51. % t = tiledlayout(5,2);
  52. [ha, pos] = tight_subplot(4,2,[.05 .05],[.15 .05],[.07 .01]);
  53. for i=1:8
  54. axes(ha(i));
  55. % subplot(4,2,i)
  56. d0 = data(i,:);
  57. d1 = data2(i,:);
  58. d_src = d1(1:2:end);
  59. d_dst = d1(2:2:end);
  60. B = bar(x, [d0; d_src; d_dst]', 1);
  61. if mod(i,2)==1
  62. ylabel('Instructions')
  63. end
  64. grid on
  65. title([namesf(i)])
  66. % set(gcf,'Position',[100 100 500 300])
  67. end
  68. set(ha(1:6),'XTickLabel','');
  69. legend({'RISC', 'OISC Destination', 'OISC Source'})
  70. %%
  71. OISCF = 1705;
  72. RISCF = 3218;
  73. % ALU, MEM
  74. x = categorical({'RISC', 'OISC'});
  75. y0 = [
  76. 293 RISCF-2845 RISCF-2563 RISCF-((RISCF-2845) + (RISCF-2563))-293;
  77. 293 486 225 701;
  78. ];
  79. bar(x, y0, 'stacked');
  80. legend('COMMON', 'ALU', 'MEMORY', 'OTHER')
  81. grid on
  82. ylabel("Logic elements")
  83. title("Processors FPGA logic element composition")
  84. figure
  85. y1 = [
  86. 170 1 407-315 144;
  87. 170 142 86 328;
  88. ];
  89. bar(x, y1, 'stacked');
  90. legend('COMMON', 'ALU', 'MEMORY', 'OTHER')
  91. grid on
  92. ylabel("Registers")
  93. title("Processors FPGA register usage composition")
  94. % EMPTY Processor
  95. %Total logic elements 293 / 22,320 ( 1 % ) // 294??
  96. %Total registers 170
  97. % RISC FULL
  98. %Total logic elements 3,218 / 22,320 ( 14 % )
  99. %Total registers 407
  100. % RISC without ALU
  101. %Total logic elements 2,845 / 22,320 ( 13 % )
  102. %Total registers 406
  103. % RISC without Memory
  104. %Total logic elements 2,563 / 22,320 ( 11 % )
  105. %Total registers 315
  106. %
  107. %OISC without rom
  108. %Total logic elements 291 / 22,320 ( 1 % )
  109. %Total registers 170
  110. % OISC FULL
  111. %Total logic elements 1,705 / 22,320 ( 8 % )
  112. %Total registers 726
  113. %Total memory bits 93,184 / 608,256 ( 15 % )
  114. %Embedded Multiplier 9-bit elements 1 / 132 ( < 1 % )
  115. % OISC without ALU
  116. %Total logic elements 1,219 / 22,320 ( 5 % )
  117. %Total registers 584
  118. %Total memory bits 93,184 / 608,256 ( 15 % )
  119. % OISC without mem/stack logic
  120. %Total logic elements 1,480 / 22,320 ( 7 % )
  121. %Total registers 640
  122. %Total memory bits 93,184 / 608,256 ( 15 % )