Browse Source

Add example testcase that includes carry set

master
Forest Belton 3 years ago
parent
commit
d1d364b5dc
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      ex.py

+ 3
- 6
ex.py View File

@ -19,18 +19,15 @@ prgm = Program(
)
outputs = [R8.A]
test_cases = [TestCase()]
test_cases = [TestCase(), TestCase(state=CPUState(carry=1))]
params = OptimizationParameters(max_size=4)
initial_cost = cost(prgm, test_cases, outputs, prgm)
initial_cycles = prgm.perf()
print("Program to optimize:")
prgm.display()
print(f"Cost: {initial_cost[0]}")
print(f"Cycles: {initial_cycles}")
print(f"Cost: 0.0")
print(f"Cycles: {prgm.perf()}")
start_time = time()

Loading…
Cancel
Save