63 lines
No EOL
2.1 KiB
Python
63 lines
No EOL
2.1 KiB
Python
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]
|
|
YO1 = [796, 1546, 2296, 3046, 3796, 4546, 5296, 6046, 6796]
|
|
YO3 = [764, 1514, 2264, 3014, 3764, 4514, 5264, 6014, 6764]
|
|
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
|
|
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")
|
|
|
|
for i in range(9) :
|
|
Y[i] = (Y[i]*1e9)/f_RISCV1
|
|
YO1[i] = (YO1[i]*1e9)/f_RISCV1
|
|
YO3[i] = (YO3[i]*1e9)/f_RISCV1
|
|
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
|
|
|
|
|
|
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.yscale("log")
|
|
|
|
plt.xlim([0, 500])
|
|
plt.ylim([50, 500000])
|
|
plt.legend()
|
|
plt.title("Temps d'exécution en fonction de n_max")
|
|
plt.ylabel("T (ns)")
|
|
plt.xlabel("N_max")
|
|
plt.show()
|
|
plt.savefig("fibonacci_temps.png") |