skyeye-sdk-js 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ export declare class RequestFactory {
4
4
  private static _instance;
5
5
  private constructor();
6
6
  static getInstance(): RequestFactory;
7
+ getAddressWidth(cpuName: string): JSONRequest;
7
8
  getModuleStatus(): JSONRequest;
8
9
  getRunningStatus(): JSONRequest;
9
10
  runScriptRequest(filename: string): JSONRequest;
@@ -22,6 +23,7 @@ export declare class RequestFactory {
22
23
  getCpuFreq(cpuName: string): JSONRequest;
23
24
  runToTimeRequest(cpuName: string, time: string): JSONRequest;
24
25
  getCurrentPC(cpuName: string): JSONRequest;
26
+ getCpuFreqHz(cpuName: string): JSONRequest;
25
27
  getCpuMips(cpuName: string): JSONRequest;
26
28
  getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): JSONRequest;
27
29
  setGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType, value: string): JSONRequest;
@@ -34,6 +36,7 @@ export declare class RequestFactory {
34
36
  deleteFaultInject(machName: string, deviceName: string, addr: string, bit: string, mode: string): JSONRequest;
35
37
  getFaultInjectList(): JSONRequest;
36
38
  getDisassembleInfo(cpuName: string, startAddr: string, nums: string): JSONRequest;
39
+ step(cpuName: string, stepNum: number): JSONRequest;
37
40
  singleStep(cpuName: string): JSONRequest;
38
41
  getcpuRegisterInfo(cpuName: string): JSONRequest;
39
42
  }
@@ -12,6 +12,16 @@ class RequestFactory {
12
12
  return this._instance;
13
13
  }
14
14
  //判断模块是否完全加载成功
15
+ getAddressWidth(cpuName) {
16
+ const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_address_width");
17
+ const args = {};
18
+ args.cpuname = cpuName;
19
+ baseRequest.setArgs(args);
20
+ const request = new skyeye_rpc_pb_1.JSONRequest();
21
+ request.setRequest(baseRequest.toJSONString());
22
+ return request;
23
+ }
24
+ //判断模块是否完全加载成功
15
25
  getModuleStatus() {
16
26
  const baseRequest = new BaseRequest_1.BaseRequest("SE_get_modules_loaded_status");
17
27
  const request = new skyeye_rpc_pb_1.JSONRequest();
@@ -155,6 +165,16 @@ class RequestFactory {
155
165
  request.setRequest(baseRequest.toJSONString());
156
166
  return request;
157
167
  }
168
+ getCpuFreqHz(cpuName) {
169
+ const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_freq_hz");
170
+ const args = {};
171
+ args.cpuname = cpuName;
172
+ baseRequest.setArgs(args);
173
+ const request = new skyeye_rpc_pb_1.JSONRequest();
174
+ request.setRequest(baseRequest.toJSONString());
175
+ // request.setRequest("{\"request\":{\"name\":\"SE_get_cpu_mips\",\"args\":{\"cpuname\":\"" + cpuName + "\"}}}");
176
+ return request;
177
+ }
158
178
  getCpuMips(cpuName) {
159
179
  const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_mips");
160
180
  const args = {};
@@ -273,6 +293,16 @@ class RequestFactory {
273
293
  request.setRequest(baseRequest.toJSONString());
274
294
  return request;
275
295
  }
296
+ step(cpuName, stepNum) {
297
+ const baseRequest = new BaseRequest_1.BaseRequest("step");
298
+ const args = {};
299
+ args.cpuname = cpuName;
300
+ args.step_num = stepNum;
301
+ baseRequest.setArgs(args);
302
+ const request = new skyeye_rpc_pb_1.JSONRequest();
303
+ request.setRequest(baseRequest.toJSONString());
304
+ return request;
305
+ }
276
306
  singleStep(cpuName) {
277
307
  const baseRequest = new BaseRequest_1.BaseRequest("SE_system_step");
278
308
  const args = {};
@@ -15,6 +15,7 @@ import { GetFaultInjectListResponse } from './response/GetFaultInjectListRespons
15
15
  import { GetDisassembleInfoResponse } from './response/GetDisassembleInfoResponse';
16
16
  import { GetCpuRegisterInfoResponse } from './response/GetCpuRegisterInfoResponse';
17
17
  import { BaseResponse } from './response/BaseResponse';
18
+ import { GetAddressWidthResponse } from './response/GetAddressWidthResponse';
18
19
  export declare class SkyEyeClient extends JSONTransmissionClient {
19
20
  private host;
20
21
  private port;
@@ -41,6 +42,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
41
42
  getCpuFreq(cpuName: string): Promise<any>;
42
43
  getPC(cpuName: string): Promise<any>;
43
44
  getCurrentPC(): Promise<any>;
45
+ getCpuFreqHz(cpuName: string): Promise<any>;
44
46
  getCpuMips(cpuName: string): Promise<any>;
45
47
  getCurrentCpuMips(): Promise<any>;
46
48
  getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): Promise<any>;
@@ -59,6 +61,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
59
61
  setCpuRegisterValue(boardName: string, cpuName: string, registerName: string, value: string): Promise<any>;
60
62
  setDeviceRegisterValue(machName: string, deviceName: string, registerName: string, value: string): Promise<any>;
61
63
  getDeviceTree(): Promise<GetDeviceTreeResponse>;
64
+ getAddressWidth(cpuName: string): Promise<GetAddressWidthResponse>;
62
65
  getModuleStatus(): Promise<BaseResponse>;
63
66
  getCurrentRunningState(): Promise<GetRunningStateResponse>;
64
67
  getAllDeviceInfo(): Promise<GetAllDeviceInfoResponse>;
@@ -73,6 +76,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
73
76
  getDisassembleInfo(cpuName: string, startAddr: string, nums: string): Promise<GetDisassembleInfoResponse>;
74
77
  getDisassembleInfoDefault(startAddr: string, nums: string): Promise<GetDisassembleInfoResponse>;
75
78
  SingleStep(cpuName: string): Promise<any>;
79
+ step(cpuName: string, stepNum: number): Promise<any>;
76
80
  SingleStepDefault(): Promise<any>;
77
81
  close(): boolean;
78
82
  getHost(): string;
@@ -56,6 +56,7 @@ const GetCpuRegisterInfoResponse_1 = require("./response/GetCpuRegisterInfoRespo
56
56
  const SkyEyeSDKException_1 = require("./exception/SkyEyeSDKException");
57
57
  const cp = __importStar(require("child_process"));
58
58
  const BaseResponse_1 = require("./response/BaseResponse");
59
+ const GetAddressWidthResponse_1 = require("./response/GetAddressWidthResponse");
59
60
  let client = null;
60
61
  // ----------------------------当前运行程序的设备树----------------------------------------//
61
62
  const boardMap = new Map();
@@ -413,6 +414,17 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
413
414
  }
414
415
  });
415
416
  }
417
+ getCpuFreqHz(cpuName) {
418
+ return __awaiter(this, void 0, void 0, function* () {
419
+ try {
420
+ return yield this.call(RequestFactory_1.RequestFactory.getInstance().getCpuFreqHz(cpuName));
421
+ }
422
+ catch (error) {
423
+ console.error("Error during getCpuMips:", error);
424
+ throw error;
425
+ }
426
+ });
427
+ }
416
428
  getCpuMips(cpuName) {
417
429
  return __awaiter(this, void 0, void 0, function* () {
418
430
  try {
@@ -730,6 +742,23 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
730
742
  return response;
731
743
  });
732
744
  }
745
+ getAddressWidth(cpuName) {
746
+ return __awaiter(this, void 0, void 0, function* () {
747
+ const response = new GetAddressWidthResponse_1.GetAddressWidthResponse();
748
+ try {
749
+ const call = yield this.call(RequestFactory_1.RequestFactory.getInstance().getAddressWidth(cpuName));
750
+ // { result: 2, error: null, name: 'SE_get_running_status' }
751
+ if (call != null) {
752
+ response.isSuccess = true;
753
+ response.result = call.result;
754
+ }
755
+ console.log(call);
756
+ }
757
+ catch (error) {
758
+ }
759
+ return response;
760
+ });
761
+ }
733
762
  getModuleStatus() {
734
763
  return __awaiter(this, void 0, void 0, function* () {
735
764
  const response = new BaseResponse_1.BaseResponse();
@@ -965,6 +994,16 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
965
994
  }
966
995
  });
967
996
  }
997
+ step(cpuName, stepNum) {
998
+ return __awaiter(this, void 0, void 0, function* () {
999
+ try {
1000
+ return yield this.call(RequestFactory_1.RequestFactory.getInstance().step(cpuName, stepNum));
1001
+ }
1002
+ catch (error) {
1003
+ throw error;
1004
+ }
1005
+ });
1006
+ }
968
1007
  SingleStepDefault() {
969
1008
  return __awaiter(this, void 0, void 0, function* () {
970
1009
  const cpuList = (yield this.getCpuList()).getCpuList;
@@ -0,0 +1,4 @@
1
+ import { BaseResponse } from "./BaseResponse";
2
+ export declare class GetAddressWidthResponse extends BaseResponse {
3
+ result: object;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetAddressWidthResponse = void 0;
4
+ const BaseResponse_1 = require("./BaseResponse");
5
+ class GetAddressWidthResponse extends BaseResponse_1.BaseResponse {
6
+ }
7
+ exports.GetAddressWidthResponse = GetAddressWidthResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-sdk-js",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "gRPC to SkyEye",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,17 @@ export class RequestFactory {
16
16
  return this._instance;
17
17
  }
18
18
 
19
+ //判断模块是否完全加载成功
20
+ public getAddressWidth(cpuName: string) {
21
+ const baseRequest = new BaseRequest("SE_get_cpu_address_width");
22
+ const args: { [key: string]: string } = {};
23
+ args.cpuname = cpuName;
24
+ baseRequest.setArgs(args)
25
+ const request = new JSONRequest()
26
+ request.setRequest(baseRequest.toJSONString());
27
+ return request;
28
+ }
29
+
19
30
  //判断模块是否完全加载成功
20
31
  public getModuleStatus() {
21
32
  const baseRequest = new BaseRequest("SE_get_modules_loaded_status");
@@ -186,6 +197,18 @@ export class RequestFactory {
186
197
  return request;
187
198
  }
188
199
 
200
+ public getCpuFreqHz(cpuName: string) {
201
+ const baseRequest = new BaseRequest("SE_get_cpu_freq_hz");
202
+ const args: { [key: string]: string } = {};
203
+ args.cpuname = cpuName;
204
+ baseRequest.setArgs(args)
205
+ const request = new JSONRequest()
206
+ request.setRequest(baseRequest.toJSONString());
207
+ // request.setRequest("{\"request\":{\"name\":\"SE_get_cpu_mips\",\"args\":{\"cpuname\":\"" + cpuName + "\"}}}");
208
+ return request;
209
+ }
210
+
211
+
189
212
  public getCpuMips(cpuName: string) {
190
213
  const baseRequest = new BaseRequest("SE_get_cpu_mips");
191
214
  const args: { [key: string]: string } = {};
@@ -335,6 +358,17 @@ export class RequestFactory {
335
358
  }
336
359
 
337
360
 
361
+ public step(cpuName: string, stepNum: number) {
362
+ const baseRequest = new BaseRequest("step");
363
+ const args: { [key: string]: any } = {};
364
+ args.cpuname = cpuName;
365
+ args.step_num = stepNum;
366
+ baseRequest.setArgs(args)
367
+ const request = new JSONRequest()
368
+ request.setRequest(baseRequest.toJSONString());
369
+ return request;
370
+ }
371
+
338
372
 
339
373
 
340
374
 
@@ -25,6 +25,7 @@ import { ServiceError } from '@grpc/grpc-js';
25
25
  import * as cp from 'child_process';
26
26
  import { Board } from './models/Board';
27
27
  import { BaseResponse } from './response/BaseResponse';
28
+ import { GetAddressWidthResponse } from './response/GetAddressWidthResponse';
28
29
  let client: JSONTransmissionClient | any = null;
29
30
 
30
31
 
@@ -363,7 +364,14 @@ export class SkyEyeClient extends JSONTransmissionClient {
363
364
  }
364
365
 
365
366
 
366
-
367
+ public async getCpuFreqHz(cpuName: string) {
368
+ try {
369
+ return await this.call(RequestFactory.getInstance().getCpuFreqHz(cpuName))
370
+ } catch (error) {
371
+ console.error("Error during getCpuMips:", error);
372
+ throw error;
373
+ }
374
+ }
367
375
 
368
376
 
369
377
 
@@ -662,6 +670,24 @@ export class SkyEyeClient extends JSONTransmissionClient {
662
670
  }
663
671
 
664
672
 
673
+ public async getAddressWidth(cpuName:string) {
674
+ const response = new GetAddressWidthResponse();
675
+
676
+ try {
677
+ const call = await this.call(RequestFactory.getInstance().getAddressWidth(cpuName))
678
+ // { result: 2, error: null, name: 'SE_get_running_status' }
679
+ if (call != null) {
680
+ response.isSuccess = true;
681
+ response.result = call.result
682
+ }
683
+ console.log(call)
684
+ } catch (error) {
685
+ }
686
+ return response;
687
+ }
688
+
689
+
690
+
665
691
  public async getModuleStatus() {
666
692
  const response = new BaseResponse();
667
693
 
@@ -887,6 +913,14 @@ export class SkyEyeClient extends JSONTransmissionClient {
887
913
  }
888
914
  }
889
915
 
916
+ public async step(cpuName: string, stepNum: number) {
917
+ try {
918
+ return await this.call(RequestFactory.getInstance().step(cpuName, stepNum))
919
+ } catch (error) {
920
+ throw error;
921
+ }
922
+ }
923
+
890
924
 
891
925
  public async SingleStepDefault() {
892
926
  const cpuList = (await this.getCpuList()).getCpuList;
@@ -0,0 +1,6 @@
1
+ import { Board } from "../models/Board";
2
+ import { BaseResponse } from "./BaseResponse";
3
+
4
+ export class GetAddressWidthResponse extends BaseResponse{
5
+ result:object
6
+ }