added 8x8 and randomized 4x4 circuits for testing

This commit is contained in:
Fabian Posch 2025-02-04 10:32:36 +01:00
parent fdd972181f
commit e775471440
5 changed files with 16916 additions and 0 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,31 @@
import re
import random
def replace_after_pattern(text):
# Define a function to generate a random number between 950 and 1050
def random_replacement(match):
return f"[after={random.randint(950, 1050)}]"
# Use re.sub to find all instances of '[after=1000]' and replace with random number
result = re.sub(r'\[after=1000\]', random_replacement, text)
return result
def process_file(input_filename, output_filename):
# Read content from the input file
with open(input_filename, 'r') as input_file:
text = input_file.read()
# Replace the patterns in the text
updated_text = replace_after_pattern(text)
# Save the updated text to the output file
with open(output_filename, 'w') as output_file:
output_file.write(updated_text)
# Example usage
input_file = 'prs/umul4x4_DIMS_delay.act' # Replace with your input file name
output_file = 'prs/umul4x4_DIMS_rand.act' # Replace with your desired output file name
process_file(input_file, output_file)