added 8x8 and randomized 4x4 circuits for testing
This commit is contained in:
parent
fdd972181f
commit
e775471440
5 changed files with 16916 additions and 0 deletions
2504
test-circuit/prs/umul4x4_DIMS_delay.act
Normal file
2504
test-circuit/prs/umul4x4_DIMS_delay.act
Normal file
File diff suppressed because it is too large
Load diff
2504
test-circuit/prs/umul4x4_DIMS_rand.act
Normal file
2504
test-circuit/prs/umul4x4_DIMS_rand.act
Normal file
File diff suppressed because it is too large
Load diff
11876
test-circuit/prs/umul8x8_DIMS.act
Normal file
11876
test-circuit/prs/umul8x8_DIMS.act
Normal file
File diff suppressed because it is too large
Load diff
1
test-circuit/prs/umul8x8_DIMS.fanout.json
Normal file
1
test-circuit/prs/umul8x8_DIMS.fanout.json
Normal file
File diff suppressed because one or more lines are too long
31
test-circuit/randomizer.py
Normal file
31
test-circuit/randomizer.py
Normal 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)
|
||||
Loading…
Reference in a new issue