Timing simulation collects simulated cycle counts for benchmarks, comparing against native M2 execution to measure accuracy.
Target: <20% average error (per issue #141)
| Benchmark | Instructions | Status |
|---|---|---|
| aha-mont64 | 1.88M | Ready |
| crc32 | 1.57M | Ready |
| matmult-int | 3.85M | Ready |
| primecount | 2.84M | Ready |
| edn | ~1M | Ready |
cd ~/dev/src/github.com/sarchlab/m2sim
go test -v -run "TestBenchmark.*ahamont64" ./benchmarks/ -timeout 10m./scripts/batch-timing.sh 2>&1 | tee reports/timing-output.logWarning: Timing simulation is slow. Each benchmark may take 5-10+ minutes. Run overnight or in a dedicated session.
nohup ./scripts/batch-timing.sh > reports/timing-$(date +%Y-%m-%d).log 2>&1 &
echo $! > reports/timing.pidCheck progress:
tail -f reports/timing-$(date +%Y-%m-%d).log- Raw output:
reports/embench-timing-YYYY-MM-DD.json - Logs:
reports/timing-YYYY-MM-DD.log
- Extract simulated cycles from timing output
- Compare against native M2 results (if available)
- Calculate error percentages
- Tune pipeline parameters (issue width, branch penalty)
- Re-run timing to verify improvements
| Benchmark | Error |
|---|---|
| arithmetic | 49.3% |
| dependency | 18.9% |
| branch | 51.3% |
| Average | 39.8% |
Key tuning targets:
- Arithmetic: 8-wide issue + instruction fusion
- Branch: Reduce misprediction penalty