Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions benchmarks/accuracy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ func calculateError(simCPI, baselineCPI float64) float64 {
// TestAccuracyAgainstBaseline compares simulator results against M2 baseline.
// This is the main accuracy validation test for M2Sim.
func TestAccuracyAgainstBaseline(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running accuracy test in short mode")
}

// Load baseline data
baseline := loadBaseline(t)

Expand Down Expand Up @@ -212,6 +216,10 @@ func TestAccuracyAgainstBaseline(t *testing.T) {
// TestAccuracyDependencyChain specifically tests the dependency chain accuracy.
// This is critical because it measures the simulator's handling of RAW hazards.
func TestAccuracyDependencyChain(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running accuracy test in short mode")
}

baseline := loadBaseline(t)
baselineEntry := findBaseline(baseline, "dependency")
if baselineEntry == nil {
Expand Down Expand Up @@ -249,6 +257,10 @@ func TestAccuracyDependencyChain(t *testing.T) {

// TestAccuracyArithmetic tests ALU throughput accuracy.
func TestAccuracyArithmetic(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running accuracy test in short mode")
}

baseline := loadBaseline(t)
baselineEntry := findBaseline(baseline, "arithmetic")
if baselineEntry == nil {
Expand Down Expand Up @@ -280,6 +292,10 @@ func TestAccuracyArithmetic(t *testing.T) {
// TestAccuracyBranch tests branch handling accuracy using conditional branches.
// Uses branchTakenConditional to match native benchmark pattern (CMP + B.GE).
func TestAccuracyBranch(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running accuracy test in short mode")
}

baseline := loadBaseline(t)
baselineEntry := findBaseline(baseline, "branch")
if baselineEntry == nil {
Expand Down Expand Up @@ -373,6 +389,10 @@ func GenerateAccuracyReport(t *testing.T) AccuracyReport {

// TestGenerateAccuracyReport tests the report generation and outputs JSON.
func TestGenerateAccuracyReport(t *testing.T) {
if testing.Short() {
t.Skip("skipping long-running accuracy report generation in short mode")
}

report := GenerateAccuracyReport(t)

reportJSON, err := json.MarshalIndent(report, "", " ")
Expand Down
Loading