-
Notifications
You must be signed in to change notification settings - Fork 21
Level 3 cache #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
martijnbesamusca
wants to merge
16
commits into
marg-tools:main
Choose a base branch
from
martijnbesamusca:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c1368d0
Add stacked and non-stacked L3 options to floorplanlib
martijnbesamusca 7a8163e
Add stacked and non-stacked L3 configurations
martijnbesamusca c67054c
add l3 test
martijnbesamusca 4dbe0d0
Add stacked and non-stacked L3 plotting options to heatView.py
martijnbesamusca d166655
Add support for reading L3 value in memTherm_core.py
martijnbesamusca 318d0a5
fix wrong help text floorplanlib
martijnbesamusca a04a909
Add L3 (stacked and non-stacked) configs
martijnbesamusca 8779e6e
update matplotlib to 3.5.2
martijnbesamusca 8da0e45
floorplan and tests updated
martijnbesamusca c476bfb
update memtherm_core to read and write l3 cache
martijnbesamusca 75fb4cf
add L3 header support
martijnbesamusca 0d68930
l3 cache test
martijnbesamusca b058754
add l3 cache support to simulationcontroll
martijnbesamusca ddb4c18
add stacked and non-stacked l3 cache support
martijnbesamusca ea07d90
Added 2 tests configs
martijnbesamusca 4e93fa8
Merge branch 'marg-tools:main' into main
martijnbesamusca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,9 @@ def usage(): | |
--banks_in_x: Number of memory banks in x dimension (default 4) | ||
--banks_in_y: Number of memory banks in y dimension (default 4) | ||
--banks_in_z: Number of memory banks in z dimension (default 8) | ||
--cache_l3: Enable L3 cache (default False) | ||
--cache_l3_stacked: Put L3 cache on seperate layer (default True) | ||
--cache_l3_width: Width of the L3 cache, only needed with non-stacked L3 (default 0) | ||
--arch_type: Architecture type = 3D, 3Dmem, 2.5D, DDR (default 3Dmem) | ||
--plot_type: Generated view = 3D or 2D (default 3D) | ||
--layer_to_view: Layer number to view in 3D plot (starting from 0) (default 0) | ||
|
@@ -52,6 +55,10 @@ def usage(): | |
banks_in_y=4 | ||
banks_in_z=8 | ||
|
||
cache_l3=False | ||
cache_l3_stacked=False | ||
cache_l3_width=0 | ||
|
||
arch_type="3Dmem" ##option = 3D, other. | ||
inverted_view=False | ||
|
||
|
@@ -77,13 +84,13 @@ def usage(): | |
if not sys.argv[1:]: | ||
usage() | ||
|
||
opts_passthrough = [ 'cores_in_x=', 'cores_in_y=', 'cores_in_z=', 'banks_in_x=', 'banks_in_y=', 'banks_in_z=', 'arch_type=', 'plot_type=', 'layer_to_view=', 'type_to_view=', 'verbose', 'inverted_view', 'debug', 'tmin=', 'tmax=', 'samplingRate=', 'traceFile=', 'output=', 'clean' ] | ||
opts_passthrough = [ 'cores_in_x=', 'cores_in_y=', 'cores_in_z=', 'banks_in_x=', 'banks_in_y=', 'banks_in_z=', 'cache_l3', 'cache_l3_stacked', 'cache_l3_width=', 'arch_type=', 'plot_type=', 'layer_to_view=', 'type_to_view=', 'verbose', 'inverted_view', 'debug', 'tmin=', 'tmax=', 'samplingRate=', 'traceFile=', 'output=', 'clean' ] | ||
|
||
try: | ||
# arguments, shortopts, longopts | ||
opts, args = getopt.getopt(sys.argv[1:], "hvidcs:t:o:", opts_passthrough) | ||
|
||
except: #getopt.GetoptError, e: | ||
except getopt.GetoptError as e: | ||
# print help information and exit: | ||
print (e) | ||
usage() | ||
|
@@ -108,6 +115,12 @@ def usage(): | |
banks_in_y = int(a) | ||
if o == '--banks_in_z': | ||
banks_in_z = int(a) | ||
if o == '--cache_l3': | ||
cache_l3 = True | ||
if o == '--cache_l3_stacked': | ||
cache_l3_stacked = True | ||
if o == '--cache_l3_width': | ||
cache_l3_width = float(a) | ||
if o == '--arch_type': | ||
arch_type = a | ||
if o == '--plot_type': | ||
|
@@ -145,31 +158,42 @@ def usage(): | |
total_cores = cores_in_x*cores_in_y*cores_in_z | ||
total_banks = banks_in_x*banks_in_y*banks_in_z | ||
|
||
temperature_l3 = [0] | ||
temperatures_core = [0] * total_cores | ||
temperatures_bank = [0] * total_banks | ||
|
||
def parse_tfile(tfilename, orig_line): | ||
line=orig_line.rstrip() | ||
line=line.split('\t') | ||
i = 0 | ||
if (debug): | ||
print ("DEBUG::Temperature trace:\n%s" %line) | ||
for value in line[0:total_cores]: | ||
|
||
col = 0 | ||
if cache_l3: | ||
value = line[col] | ||
temperature_l3[0] = float(value) | ||
col += 1 | ||
i = 0 | ||
for value in line[col:col+total_cores]: | ||
temperatures_core[i] = float(value) | ||
i+=1 | ||
i = 0 | ||
for value in line[total_cores:]: | ||
for value in line[col+total_cores:]: | ||
temperatures_bank[i] = float(value) | ||
i+=1 | ||
|
||
def parse_tfile_header(tfilename, orig_line): | ||
count_L3_column=0 | ||
count_core_column=0 | ||
count_bank_column=0 | ||
column=0 | ||
line=orig_line.split('\t') | ||
if (debug): | ||
print ("DEBUG::Temperature trace file header:\n%s" %line) | ||
|
||
while (line[column].startswith('L3')): | ||
count_L3_column+=1 | ||
column+=1 | ||
while (line[column].startswith('C')): | ||
count_core_column+=1 | ||
column+=1 | ||
|
@@ -189,7 +213,7 @@ def plot_opaque_cube(ax, x=10, y=20, z=30, dx=40, dy=50, dz=60, color='cyan', al | |
if (debug): | ||
print("DEBUG:: plot_opaque_cube: x=%d,y=%d,z=%d" %(x,y,z)) | ||
|
||
kwargs = {'alpha': alpha, 'color': color, 'edgecolor': 'k', 'shade':False} | ||
kwargs = {'alpha': alpha, 'color': color, 'edgecolor': 'k', 'shade':False, 'zorder':1/(z+1)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the setting of zorder do? |
||
|
||
xx = np.linspace(x, x+dx, 2) | ||
yy = np.linspace(y, y+dy, 2) | ||
|
@@ -216,7 +240,7 @@ def plot_opaque_cube(ax, x=10, y=20, z=30, dx=40, dy=50, dz=60, color='cyan', al | |
#plt.title("Cube") | ||
#plt.show() | ||
|
||
def plot_3D_structure(ax, tmin, tmax, xdim, ydim, zdim, zstart, xwidth, ywidth, temperatures, title_message, axes_postprocess=True, inverted=False, layer_type="Core", adjust=0): | ||
def plot_3D_structure(ax, tmin, tmax, xdim, ydim, zdim, zstart, xwidth, ywidth, temperatures, title_message, axes_postprocess=True, inverted=False, layer_type="Core", adjust=0, xstart=0, ystart=0): | ||
if (debug): | ||
print ("DEBUG:: plot_3D_structure: xwidth = %f" %xwidth) | ||
color_lvl = 200 | ||
|
@@ -238,14 +262,14 @@ def plot_3D_structure(ax, tmin, tmax, xdim, ydim, zdim, zstart, xwidth, ywidth, | |
offset = 0 | ||
if offset > color_lvl: | ||
offset = color_lvl | ||
plot_opaque_cube(ax, 0+xwidth*xx, 0+ywidth*yy-shift_amount*(zz+zstart), 0+zz+zstart, xwidth, ywidth, 0.2, color[offset], 1) | ||
plot_opaque_cube(ax, xstart+xwidth*xx, ystart+ywidth*yy-shift_amount*(zz+zstart), 0+zz+zstart, xwidth, ywidth, 0.2, color[offset], 1) | ||
ind += 1 | ||
if (inverted): | ||
layer_num = zdim-zz-1 | ||
else: | ||
layer_num = zz | ||
annotate_text = layer_type + " L"+ str(layer_num) | ||
if (zdim > 1 or zstart > 0): | ||
if (layer_type and (zdim > 1 or zstart > 0)): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does layer_type inside the if indicate? Shouldn't it be compared with something? Please check |
||
ax.text(xx+3,-1.2+adjust,zz+zstart+1.0,annotate_text,(0,1,0), verticalalignment='center', fontsize=17) | ||
# ax.annotate("Time step = "+str(count) +" ms", xy=(xx+1, 0), xycoords='axes points', fontsize=21) | ||
|
||
|
@@ -338,6 +362,8 @@ def plot_2D_map(ax, tmin, tmax, xdim, ydim, xwidth, ywidth, title_message, tempe | |
print("\n") | ||
print("DEBUG::Core temperatures:", temperatures_core) | ||
print("DEBUG::Bank temperatures:", temperatures_bank) | ||
if cache_l3: | ||
print("DEBUG::L3 temperatures:", temperature_l3) | ||
print("Processing line %d" %count) | ||
|
||
count+=1 | ||
|
@@ -371,16 +397,18 @@ def plot_2D_map(ax, tmin, tmax, xdim, ydim, xwidth, ywidth, title_message, tempe | |
#beginning of 3D plotting | ||
else: | ||
ax = fig.add_subplot(gs[0], projection='3d') | ||
cache_in_z = 1 if cache_l3 and cache_l3_stacked else 0 | ||
#ind = yy + cores_in_y*xx + cores_in_x*cores_in_y*zz | ||
|
||
#core | ||
if (arch_type=="3D"): | ||
xwidth=(float)(banks_in_x)/cores_in_x | ||
cores_and_l3_in_x = cores_in_x + cache_l3_width | ||
xwidth=(float)(banks_in_x)/cores_and_l3_in_x | ||
kediarajesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ywidth=(float)(banks_in_y)/cores_in_y | ||
if (inverted_view): | ||
zstart = 0 | ||
else: | ||
zstart = banks_in_z | ||
zstart = banks_in_z + cache_in_z | ||
postprocess=False | ||
title_message = None | ||
adj=0.0 #adjust annotation | ||
|
@@ -403,12 +431,36 @@ def plot_2D_map(ax, tmin, tmax, xdim, ydim, xwidth, ywidth, title_message, tempe | |
# art3d.pathpatch_2d_to_3d(p, z=0, zdir = "x") | ||
#plot_opaque_cube(ax, 0, 0, 0, cores_in_x, cores_in_y, cores_in_z, color='none', alpha=0.05)## | ||
|
||
# cache | ||
if (cache_l3 and cache_l3_stacked): | ||
kediarajesh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (inverted_view): | ||
zstart = cores_in_z | ||
else: | ||
zstart = banks_in_z | ||
xwidth=banks_in_x | ||
ywidth=banks_in_y | ||
postprocess=False | ||
adj=-0.7 | ||
plot_3D_structure(ax, tmin, tmax, 1, 1, 1, zstart, xwidth, ywidth, temperature_l3, None, postprocess, inverted_view, "L3", adj) | ||
|
||
if (cache_l3 and not cache_l3_stacked): | ||
if (inverted_view): | ||
zstart = 0 | ||
else: | ||
zstart = banks_in_z | ||
xwidth=(float)(banks_in_x)/cores_and_l3_in_x | ||
ywidth=banks_in_y | ||
xstart = cores_in_x * xwidth | ||
plot_3D_structure(ax, tmin, tmax, 1, 1, 1, zstart, xwidth, ywidth, temperature_l3, None, postprocess, inverted_view, "", adj, xstart=xstart) | ||
|
||
# plot_opaque_cube(ax, xwidth*3, ywidth*3, zstart, xwidth, ywidth, 0.2, color[temperature_l3], 1) | ||
|
||
#memory | ||
if (arch_type=="3D"): | ||
postprocess=True | ||
title_message = "3D architecture temperature map" | ||
if (inverted_view): | ||
zstart = cores_in_z | ||
zstart = cores_in_z + cache_in_z | ||
else: | ||
zstart = 0 | ||
adj=0.7 #adjust annotation | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.