exjobb-public/plots/synth_results.py

68 lines
2.0 KiB
Python

import matplotlib.pyplot as plt
import numpy as np
## Bar diagram chunked on different parameters.
text_size = 30
stroke = 2
marker_width = 8
metrics = ("LUTs", "DFFs", "Carry", "Memory Blocks")
configs = {
'Single Issue': (2.68, 1.61, 1.69, 3.57),
'IO Pipelined': (3.68, 1.84, 3.02, 3.57),
'Minimized IO Pipelined': (2.84, 1.62, 1.45, 3.57),
}
x = np.arange(len(metrics)) # the label locations
ys = np.arange(0,10,1)
width = 0.25 # the width of the bars
multiplier = 0
fig, ax = plt.subplots(layout='constrained')
for attribute, measurement in configs.items():
offset = width * multiplier
rects = ax.bar(x + offset, measurement, width, label=attribute)
ax.bar_label(rects, padding=3,fontsize=text_size)
#ax.bar_label(rects, padding=3)
multiplier += 1
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Utilization (%)',fontsize=text_size)
ax.set_xlabel('Metric',fontsize=text_size)
ax.set_title('Resource Utilization of GANIMEDE versions',fontsize=text_size)
ax.set_xticks(x + width, metrics,fontsize=text_size)
ax.set_yticks(ys, ys,fontsize=text_size)
ax.legend(loc='upper left', ncols=3,fontsize=text_size)
ax.set_ylim(0, 10)
plt.show()
##metrics = ("LUTs", "DFFs", "Carry", "Memory Blocks")
##configs = {
## 'Single Issue': (874, 496, 130, 2),
## 'IO Pipelined': (1200, 565, 232, 2),
## 'Minimized IO Pipelined': (926, 499, 111, 2),
##}
##
##x = np.arange(len(metrics)) # the label locations
##width = 0.25 # the width of the bars
##multiplier = 0
##
##fig, ax = plt.subplots(layout='constrained')
##
##for attribute, measurement in configs.items():
## offset = width * multiplier
## rects = ax.bar(x + offset, measurement, width, label=attribute)
## ax.bar_label(rects, padding=3)
## multiplier += 1
##
### Add some text for labels, title and custom x-axis tick labels, etc.
##ax.set_ylabel('Utilization (%)')
##ax.set_title('configs attributes by metrics')
##ax.set_xticks(x + width, metrics)
##ax.legend(loc='upper left', ncols=3)
##ax.set_ylim(0, 1500)
##
##plt.show()
##