From 8e3db3507ef0d3f11d98628a8e36468cefa7df73 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 29 May 2017 13:01:13 +0200 Subject: DFADriver: DriverEvalThread_{class} für Benchmarkwerte per Klassenslice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Kratos/DFADriver.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm index e06d577..f238ba4 100644 --- a/lib/Kratos/DFADriver.pm +++ b/lib/Kratos/DFADriver.pm @@ -877,7 +877,7 @@ EOF sub to_test_ah { my ($self) = @_; - my $buf = <<'EOF'; + my $buf = <<"EOF"; /* * Autogenerated code -- Manual changes are not preserved @@ -906,6 +906,7 @@ EOF sub to_test_cc { my ($self) = @_; + my $class_name = $self->{class_name}; my @runs = $self->dfa->traces; my @state_enum = $self->model->get_state_enum; my $dfa = $self->dfa->dfa; @@ -924,12 +925,12 @@ sub to_test_cc { #include "DriverEval.h" #include "syscall/guarded_buzzer.h" -DeclareThread(DriverEvalThread, driverEvalThread, 256); +DeclareThread(DriverEvalThread_${class_name}, driverEvalThread, 256); EOF $buf .= <<"EOF"; -void DriverEvalThread::action() +void DriverEvalThread_${class_name}::action() { Guarded_Buzzer buzzer; @@ -984,9 +985,10 @@ EOF sub to_test_h { my ($self) = @_; + my $class_name = $self->{class_name}; my $class_prefix - = $self->repo->get_class_path_prefix( $self->{class_name} ); + = $self->repo->get_class_path_prefix( $class_name ); my $buf = <<"EOF"; @@ -1001,13 +1003,13 @@ sub to_test_h { #include "${class_prefix}.h" #include "syscall/thread.h" -class DriverEvalThread : public Thread { +class DriverEvalThread_${class_name} : public Thread { public: - DriverEvalThread(void* tos) : Thread(tos) { } + DriverEvalThread_${class_name}(void* tos) : Thread(tos) { } void action(); }; -extern DriverEvalThread driverEvalThread; +extern DriverEvalThread_${class_name} driverEvalThread; #endif -- cgit v1.2.3