Projet_SETI_RISC-V/Rapport/Fibonnaci/plot.py

63 lines
2.1 KiB
Python
Raw Normal View History

2023-03-08 14:44:31 +01:00
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
import numpy as np
Y = [1100, 2150, 3200, 4250, 5300, 6350, 7400, 8450, 9500]
2023-03-08 16:24:42 +01:00
YO1 = [796, 1546, 2296, 3046, 3796, 4546, 5296, 6046, 6796]
YO3 = [764, 1514, 2264, 3014, 3764, 4514, 5264, 6014, 6764]
2023-03-08 14:44:31 +01:00
Y_ARM = [912, 1736 , 2560 , 3352, 4216, 5304 , 5840, 6704, 7464]
Y_ARMO3 = [173, 329, 480, 633, 789, 945, 1098, 1308, 1406]
Y_gcc = [2296, 5119, 6715, 9078, 10830, 12541, 15041, 16780, 18883]
Y_O3 = [165, 287, 380, 559, 900, 901, 776, 1122, 1574]
f_RISCV1 = 50e6
f_RISCV2 = 100e6
f_ARM = 800e6
f_PC = 2400e6
2023-03-08 16:24:42 +01:00
X = [50, 100, 150, 200, 250, 300, 350, 400, 450]
plt.scatter(X, Y, color="b", label="RISCV -O0")
plt.scatter(X, YO1, color="b", marker="x", label="RISCV -O1")
plt.scatter(X, YO3, color="b", marker="^", label="RISCV -O3")
plt.scatter(X, Y_ARM, color="g", label="ARM -O0")
plt.scatter(X, Y_ARMO3, color="g", marker="x",label="ARM -O3")
plt.scatter(X, Y_gcc, color="r", label="desktop -O0 2,4Ghz")
plt.scatter(X, Y_O3, color="r",marker="x", label="desktop -O3 2,4Ghz")
plt.xlim([0, 500])
plt.ylim([50, 20000])
plt.legend()
plt.title("Cycles d'exécution en fonction de n_max")
plt.ylabel("Cycles")
plt.xlabel("N_max")
plt.show()
plt.savefig("fibonacci_cycles.png")
2023-03-08 14:44:31 +01:00
for i in range(9) :
Y[i] = (Y[i]*1e9)/f_RISCV1
2023-03-08 16:24:42 +01:00
YO1[i] = (YO1[i]*1e9)/f_RISCV1
YO3[i] = (YO3[i]*1e9)/f_RISCV1
2023-03-08 14:44:31 +01:00
Y_ARM[i] = (Y_ARM[i]*1e9)/f_ARM
Y_ARMO3[i] = (Y_ARMO3[i]*1e9)/f_ARM
Y_gcc[i] = (Y_gcc[i]*1e9)/f_PC
Y_O3[i] = (Y_O3[i]*1e9)/f_PC
2023-03-08 16:24:42 +01:00
plt.scatter(X, Y, color="b", label="RISCV -O0")
plt.scatter(X, YO1, color="b", marker="x", label="RISCV -O1")
plt.scatter(X, YO3, color="b", marker="^", label="RISCV -O3")
plt.scatter(X, Y_ARM, color="g", label="ARM -O0")
plt.scatter(X, Y_ARMO3, color="g", marker="x",label="ARM -O3")
plt.scatter(X, Y_gcc, color="r", label="desktop -O0 2,4Ghz")
plt.scatter(X, Y_O3, color="r",marker="x", label="desktop -O3 2,4Ghz")
2023-03-08 14:44:31 +01:00
plt.yscale("log")
plt.xlim([0, 500])
2023-03-08 16:24:42 +01:00
plt.ylim([50, 500000])
2023-03-08 14:44:31 +01:00
plt.legend()
plt.title("Temps d'exécution en fonction de n_max")
plt.ylabel("T (ns)")
plt.xlabel("N_max")
plt.show()
2023-03-08 16:24:42 +01:00
plt.savefig("fibonacci_temps.png")