4 ## Copyright (c) 2010-2017 Intel Corporation
6 ## Licensed under the Apache License, Version 2.0 (the "License");
7 ## you may not use this file except in compliance with the License.
8 ## You may obtain a copy of the License at
10 ## http://www.apache.org/licenses/LICENSE-2.0
12 ## Unless required by applicable law or agreed to in writing, software
13 ## distributed under the License is distributed on an "AS IS" BASIS,
14 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ## See the License for the specific language governing permissions and
16 ## limitations under the License.
20 from remotesystem import *
24 class ProxDpiSut(Prox):
25 def __init__(self, ts, coreCount):
26 super(ProxDpiSut, self).__init__(ts)
28 self._setDefaultArguments();
29 self._setDpiCoreCount(coreCount);
31 def _setDefaultArguments(self):
32 self.addArgument("-e");
33 self.addArgument("-t");
34 self.addArgument("-k");
35 self.addArgument("-d");
36 self.addArgument("-r 0.01");
38 def _setDpiCoreCount(self, count):
39 self.addArgument("-q dpi_core_count=" + str(count))
41 def _querySetup2(self):
44 def _query_cores(self):
45 print "querying cores"
46 self._wk = self._get_core_list("$wk");
48 def _get_core_list(self, var):
50 result = self._send("echo " + var)._recv();
51 for e in result.split(","):
56 cmd = "stats task.core(%s).task(0).tsc" % self._wk[-1]
57 res = int(self._send(cmd)._recv());
59 return self._getTsc();