Skip to content

Commit

Permalink
add axis testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaoqun Liang committed Feb 15, 2024
1 parent e781d79 commit 63c5859
Show file tree
Hide file tree
Showing 8 changed files with 400,088 additions and 1 deletion.
30 changes: 30 additions & 0 deletions jobs/backend_rw_axi_rw_axis/huge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
def replace_first_line_in_groups_with_huge(small_modified_path, huge_path, final_output_path):

Check failure on line 1 in jobs/backend_rw_axi_rw_axis/huge.py

View workflow job for this annotation

GitHub Actions / lint-license

FAILED: File does not start with comment

Check failure on line 1 in jobs/backend_rw_axi_rw_axis/huge.py

View workflow job for this annotation

GitHub Actions / lint-license

FAILED: File does not start with comment
# Open and read the lines from huge.txt
with open(huge_path, 'r') as huge_file:
huge_lines = huge_file.readlines()

# Open and read the lines from the previously modified small_modified.txt
with open(small_modified_path, 'r') as modified_file:
modified_lines = modified_file.readlines()

# Define the group size
group_size = 10

# Iterate over the modified small file's lines to replace the first line of each group
for i in range(0, len(modified_lines), group_size):
if i // group_size < len(huge_lines): # Check if there's a corresponding line in huge.txt
modified_lines[i] = huge_lines[i // group_size]

# Write the final modified lines to a new output file
with open(final_output_path, 'w') as output_file:
output_file.writelines(modified_lines)

# Define the file paths
small_modified_path = '/scratch/chaol/idma_fixed/iDMA/jobs/backend_rw_axi_rw_axis/small.txt' # Adjust with the actual path
huge_path = '/scratch/chaol/idma_fixed/iDMA/jobs/backend_r_obi_w_axi/huge.txt' # Adjust with the actual path
final_output_path = '/scratch/chaol/idma_fixed/iDMA/jobs/backend_rw_axi_rw_axis/huge.txt' # Define your output path

# Call the function to perform the replacement
replace_first_line_in_groups_with_huge(small_modified_path, huge_path, final_output_path)

print("Replacement complete. The output is saved in:", final_output_path)
Loading

0 comments on commit 63c5859

Please sign in to comment.