Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Knute Lingaard authored and Knute Lingaard committed Sep 20, 2023
1 parent 62395cf commit 7330e51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sparta/example/CoreModel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ add_custom_command(TARGET core_example_regress_valgrind POST_BUILD COMMAND ctest
# Testing
#
sparta_copy(sparta_core_example *.yaml)
sparta_copy(sparta_core_example cpu_layout.alf)
sparta_copy(sparta_core_example gen_layouts.py)
sparta_recursive_copy(sparta_core_example subdir_yamls*)
sparta_recursive_copy(sparta_core_example test_configs)
# build this guy as part of the regress
Expand Down
19 changes: 15 additions & 4 deletions sparta/example/CoreModel/gen_layouts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import sys,os
import pathlib

sys.path.append('../../../../helios/pipeViewer/scripts')

gen_dir = pathlib.PurePath(os.path.abspath(__file__))
scripts_dir =''
alf_gen_path = '/helios/pipeViewer/scripts'
for part in gen_dir.parts[1:]:
scripts_dir += '/' + part
if os.path.exists(scripts_dir + alf_gen_path):
scripts_dir += alf_gen_path
break
assert scripts_dir != '', f"Can't find {alf_gen_path}"

sys.path.append(scripts_dir)
from alf_gen.ALFLayout import ALFLayout

if os.path.isfile("pipeout/location.dat") == False:
Expand All @@ -10,15 +22,14 @@
./sparta_core_example -i1 -z pipeout/
''')
exit(255)

try:
os.mkdir('layouts')
except:
pass

num_cycles = 55
NUM_CYCLES = 55
layout = ALFLayout(start_time = -10,
num_cycles = num_cycles,
num_cycles = NUM_CYCLES,
clock_scale = 1,
location_file = "pipeout/location.dat",
alf_file = "layouts/cpu_layout.alf")
Expand Down

0 comments on commit 7330e51

Please sign in to comment.