Skip to content

Commit

Permalink
add simulation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
chetanyagoyal authored Nov 12, 2023
1 parent dcdfbf0 commit 967086a
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion .github/scripts/parse_rpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,34 @@
if check_gen_files(json_filename, _generator_is, cryo_library):
print("Flow check is clean!")
else:
print("Flow check failed!")
print("Flow check failed!")

if len(sys.argv) == 1 and sys.argv[1] == "sky130hd_temp_full":
result_filename = "work/prePEX_sim_result" # might remove from check or need to implement different logic later if sim outputs change due to downstream changes
sim_state_filename = "work/sim_state_file.txt"

with open(result_filename) as f2, open("../../../.github/scripts/expected_sim_outputs/prePEX_sim_result.txt") as f1:
content1 = f2.readlines()
content2 = f1.readlines()
if content1 != content2:
raise ValueError("Simulations failed: simulation result file does not match!")

sim_state = json.load(open("work/sim_state_file.txt"))
if sim_state["failed_sims"] != 0:
raise ValueError("Simulations failed: Non zero failed simulations!")

for folder_num in range(1, sim_state["completed_sims"] + 1):
dir_path = r'simulations/run/'
pex_path = os.listdir(dir_path)

file_name = "simulations/run/" + pex_path + "/" + str(folder_num) + "/"
param_file = file_name + "parameters.txt"
log_file = file_name + "sim_" + str(folder_num) + ".log"
spice_file = file_name + "sim_" + str(folder_num) + ".sp"

if os.path.exists(log_file) and os.path.exists(log_file) and os.path.exists(spice_file):
pass
else:
raise ValueError("Simulations failed: required files do not exist in sim run folders!")

print("Simulations are clean!")

0 comments on commit 967086a

Please sign in to comment.