diff --git a/samples/runner/runner.go b/samples/runner/runner.go index 71f15c72..a722333b 100644 --- a/samples/runner/runner.go +++ b/samples/runner/runner.go @@ -149,11 +149,11 @@ func (r *Runner) buildTimingPlatform() { func (*Runner) setAnalyszer( b R9NanoPlatformBuilder, ) R9NanoPlatformBuilder { - if *analyszerPeriodFlag != 0 && *analyszerNameFlag == "" { - panic("must specify -analyszer-name when using -analyszer-period") + if *analyszerPeriodFlag == 0 && *analyszerNameFlag != "" { + panic("must specify -analyszer-period when using -analyszer-name") } - if *analyszerNameFlag != "" { + if *analyszerPeriodFlag != 0 { b = b.WithPerfAnalyzer( *analyszerNameFlag, *analyszerPeriodFlag, diff --git a/samples/runner/timingplatform.go b/samples/runner/timingplatform.go index 1eae1349..01c088fc 100644 --- a/samples/runner/timingplatform.go +++ b/samples/runner/timingplatform.go @@ -241,13 +241,11 @@ func (b *R9NanoPlatformBuilder) setupVisTracing() { } func (b *R9NanoPlatformBuilder) setupPerformanceAnalyzer() { - if b.perfAnalysisFileName != "" { - b.perfAnalyzer = analysis.MakePerfAnalyzerBuilder(). - WithPeriod(sim.VTimeInSec(b.perfAnalyzingPeriod)). - WithDBFilename(b.perfAnalysisFileName). - WithEngine(b.engine). - Build() - } + b.perfAnalyzer = analysis.MakePerfAnalyzerBuilder(). + WithPeriod(sim.VTimeInSec(b.perfAnalyzingPeriod)). + WithDBFilename(b.perfAnalysisFileName). + WithEngine(b.engine). + Build() if b.monitor != nil { b.monitor.RegisterPerfAnalyzer(b.perfAnalyzer)