skyeye-sdk-js 1.4.2 → 1.4.4

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.
@@ -12,7 +12,7 @@ export declare class RequestFactory {
12
12
  stopCommand(): JSONRequest;
13
13
  quitCommand(): JSONRequest;
14
14
  getCpuList(): JSONRequest;
15
- getMemoryValue(cpuName: string, baseAddr: string, length: string): JSONRequest;
15
+ getMemoryValue(cpuName: string, baseAddr: string, length: string, addressWidth?: number): JSONRequest;
16
16
  setMemoryValue(cpuName: string, baseAddr: string, value: string, length: string): JSONRequest;
17
17
  enableDeviceWork(deviceName: string): JSONRequest;
18
18
  disableDeviceWork(deviceName: string): JSONRequest;
@@ -23,6 +23,7 @@ export declare class RequestFactory {
23
23
  getCpuFreq(cpuName: string): JSONRequest;
24
24
  runToTimeRequest(cpuName: string, time: string): JSONRequest;
25
25
  getCurrentPC(cpuName: string): JSONRequest;
26
+ getCpuFreqHz(cpuName: string): JSONRequest;
26
27
  getCpuMips(cpuName: string): JSONRequest;
27
28
  getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): JSONRequest;
28
29
  setGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType, value: string): JSONRequest;
@@ -35,6 +36,7 @@ export declare class RequestFactory {
35
36
  deleteFaultInject(machName: string, deviceName: string, addr: string, bit: string, mode: string): JSONRequest;
36
37
  getFaultInjectList(): JSONRequest;
37
38
  getDisassembleInfo(cpuName: string, startAddr: string, nums: string): JSONRequest;
39
+ step(cpuName: string, stepNum: number): JSONRequest;
38
40
  singleStep(cpuName: string): JSONRequest;
39
41
  getcpuRegisterInfo(cpuName: string): JSONRequest;
40
42
  }
@@ -66,12 +66,13 @@ class RequestFactory {
66
66
  request.setRequest(baseRequest.toJSONString());
67
67
  return request;
68
68
  }
69
- getMemoryValue(cpuName, baseAddr, length) {
69
+ getMemoryValue(cpuName, baseAddr, length, addressWidth) {
70
70
  const baseRequest = new BaseRequest_1.BaseRequest("SE_get_memory_value");
71
71
  const args = {};
72
72
  args.cpuname = cpuName;
73
73
  args.baseaddr = "0x" + baseAddr;
74
74
  args.length = length;
75
+ args.address_width = addressWidth;
75
76
  baseRequest.setArgs(args);
76
77
  const request = new skyeye_rpc_pb_1.JSONRequest();
77
78
  request.setRequest(baseRequest.toJSONString());
@@ -165,6 +166,16 @@ class RequestFactory {
165
166
  request.setRequest(baseRequest.toJSONString());
166
167
  return request;
167
168
  }
169
+ getCpuFreqHz(cpuName) {
170
+ const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_freq_hz");
171
+ const args = {};
172
+ args.cpuname = cpuName;
173
+ baseRequest.setArgs(args);
174
+ const request = new skyeye_rpc_pb_1.JSONRequest();
175
+ request.setRequest(baseRequest.toJSONString());
176
+ // request.setRequest("{\"request\":{\"name\":\"SE_get_cpu_mips\",\"args\":{\"cpuname\":\"" + cpuName + "\"}}}");
177
+ return request;
178
+ }
168
179
  getCpuMips(cpuName) {
169
180
  const baseRequest = new BaseRequest_1.BaseRequest("SE_get_cpu_mips");
170
181
  const args = {};
@@ -283,6 +294,16 @@ class RequestFactory {
283
294
  request.setRequest(baseRequest.toJSONString());
284
295
  return request;
285
296
  }
297
+ step(cpuName, stepNum) {
298
+ const baseRequest = new BaseRequest_1.BaseRequest("step");
299
+ const args = {};
300
+ args.cpuname = cpuName;
301
+ args.step_num = stepNum;
302
+ baseRequest.setArgs(args);
303
+ const request = new skyeye_rpc_pb_1.JSONRequest();
304
+ request.setRequest(baseRequest.toJSONString());
305
+ return request;
306
+ }
286
307
  singleStep(cpuName) {
287
308
  const baseRequest = new BaseRequest_1.BaseRequest("SE_system_step");
288
309
  const args = {};
@@ -42,14 +42,15 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
42
42
  getCpuFreq(cpuName: string): Promise<any>;
43
43
  getPC(cpuName: string): Promise<any>;
44
44
  getCurrentPC(): Promise<any>;
45
+ getCpuFreqHz(cpuName: string): Promise<any>;
45
46
  getCpuMips(cpuName: string): Promise<any>;
46
47
  getCurrentCpuMips(): Promise<any>;
47
48
  getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): Promise<any>;
48
49
  getGlobalVarValueDefault(varName: string, valueType: GlobalVarType): Promise<any>;
49
50
  setGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType, value: string): Promise<any>;
50
51
  setGlobalVarValueDefault(varName: string, valueType: GlobalVarType, value: string): Promise<any>;
51
- getAddressingSpace(cpuName: string, baseAddr: string, length: string): Promise<any>;
52
- getMemoryValue(cpuName: string, baseAddr: string, length: string): Promise<any>;
52
+ getAddressingSpace(cpuName: string, baseAddr: string, length: string, addressWidth?: number): Promise<any>;
53
+ getMemoryValue(cpuName: string, baseAddr: string, length: string, addressWidth?: number): Promise<any>;
53
54
  getMemoryValueDefault(baseAddr: string, length: string): Promise<any>;
54
55
  getAddressingSpaceDefault(baseAddr: string, length: string): Promise<any>;
55
56
  setMemoryValue(cpuName: string, baseAddr: string, value: string, length: string): Promise<any>;
@@ -75,6 +76,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
75
76
  getDisassembleInfo(cpuName: string, startAddr: string, nums: string): Promise<GetDisassembleInfoResponse>;
76
77
  getDisassembleInfoDefault(startAddr: string, nums: string): Promise<GetDisassembleInfoResponse>;
77
78
  SingleStep(cpuName: string): Promise<any>;
79
+ step(cpuName: string, stepNum: number): Promise<any>;
78
80
  SingleStepDefault(): Promise<any>;
79
81
  close(): boolean;
80
82
  getHost(): string;
@@ -414,6 +414,17 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
414
414
  }
415
415
  });
416
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
+ }
417
428
  getCpuMips(cpuName) {
418
429
  return __awaiter(this, void 0, void 0, function* () {
419
430
  try {
@@ -502,10 +513,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
502
513
  }
503
514
  });
504
515
  }
505
- getAddressingSpace(cpuName, baseAddr, length) {
516
+ getAddressingSpace(cpuName, baseAddr, length, addressWidth) {
506
517
  return __awaiter(this, void 0, void 0, function* () {
507
518
  try {
508
- return yield this.call(RequestFactory_1.RequestFactory.getInstance().getMemoryValue(cpuName, baseAddr, length));
519
+ return yield this.call(RequestFactory_1.RequestFactory.getInstance().getMemoryValue(cpuName, baseAddr, length, addressWidth));
509
520
  }
510
521
  catch (error) {
511
522
  console.error("Error during getAddressingSpace:", error);
@@ -513,10 +524,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
513
524
  }
514
525
  });
515
526
  }
516
- getMemoryValue(cpuName, baseAddr, length) {
527
+ getMemoryValue(cpuName, baseAddr, length, addressWidth) {
517
528
  return __awaiter(this, void 0, void 0, function* () {
518
529
  try {
519
- return this.getAddressingSpace(cpuName, baseAddr, length);
530
+ return this.getAddressingSpace(cpuName, baseAddr, length, addressWidth);
520
531
  }
521
532
  catch (error) {
522
533
  console.error("Error during getMemoryValue:", error);
@@ -983,6 +994,16 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
983
994
  }
984
995
  });
985
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
+ }
986
1007
  SingleStepDefault() {
987
1008
  return __awaiter(this, void 0, void 0, function* () {
988
1009
  const cpuList = (yield this.getCpuList()).getCpuList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyeye-sdk-js",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "gRPC to SkyEye",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -81,12 +81,13 @@ export class RequestFactory {
81
81
  }
82
82
 
83
83
 
84
- public getMemoryValue(cpuName: string, baseAddr: string, length: string) {
84
+ public getMemoryValue(cpuName: string, baseAddr: string, length: string, addressWidth?: number) {
85
85
  const baseRequest = new BaseRequest("SE_get_memory_value");
86
- const args: { [key: string]: string } = {};
86
+ const args: { [key: string]: any } = {};
87
87
  args.cpuname = cpuName;
88
88
  args.baseaddr = "0x" + baseAddr;
89
89
  args.length = length;
90
+ args.address_width = addressWidth;
90
91
  baseRequest.setArgs(args)
91
92
  const request = new JSONRequest()
92
93
  request.setRequest(baseRequest.toJSONString());
@@ -197,6 +198,18 @@ export class RequestFactory {
197
198
  return request;
198
199
  }
199
200
 
201
+ public getCpuFreqHz(cpuName: string) {
202
+ const baseRequest = new BaseRequest("SE_get_cpu_freq_hz");
203
+ const args: { [key: string]: string } = {};
204
+ args.cpuname = cpuName;
205
+ baseRequest.setArgs(args)
206
+ const request = new JSONRequest()
207
+ request.setRequest(baseRequest.toJSONString());
208
+ // request.setRequest("{\"request\":{\"name\":\"SE_get_cpu_mips\",\"args\":{\"cpuname\":\"" + cpuName + "\"}}}");
209
+ return request;
210
+ }
211
+
212
+
200
213
  public getCpuMips(cpuName: string) {
201
214
  const baseRequest = new BaseRequest("SE_get_cpu_mips");
202
215
  const args: { [key: string]: string } = {};
@@ -346,6 +359,17 @@ export class RequestFactory {
346
359
  }
347
360
 
348
361
 
362
+ public step(cpuName: string, stepNum: number) {
363
+ const baseRequest = new BaseRequest("step");
364
+ const args: { [key: string]: any } = {};
365
+ args.cpuname = cpuName;
366
+ args.step_num = stepNum;
367
+ baseRequest.setArgs(args)
368
+ const request = new JSONRequest()
369
+ request.setRequest(baseRequest.toJSONString());
370
+ return request;
371
+ }
372
+
349
373
 
350
374
 
351
375
 
@@ -364,7 +364,14 @@ export class SkyEyeClient extends JSONTransmissionClient {
364
364
  }
365
365
 
366
366
 
367
-
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
+ }
368
375
 
369
376
 
370
377
 
@@ -454,17 +461,17 @@ export class SkyEyeClient extends JSONTransmissionClient {
454
461
 
455
462
 
456
463
 
457
- public async getAddressingSpace(cpuName: string, baseAddr: string, length: string) {
464
+ public async getAddressingSpace(cpuName: string, baseAddr: string, length: string, addressWidth?: number) {
458
465
  try {
459
- return await this.call(RequestFactory.getInstance().getMemoryValue(cpuName, baseAddr, length));
466
+ return await this.call(RequestFactory.getInstance().getMemoryValue(cpuName, baseAddr, length, addressWidth));
460
467
  } catch (error) {
461
468
  console.error("Error during getAddressingSpace:", error);
462
469
  throw error;
463
470
  }
464
471
  }
465
- public async getMemoryValue(cpuName: string, baseAddr: string, length: string) {
472
+ public async getMemoryValue(cpuName: string, baseAddr: string, length: string, addressWidth?: number) {
466
473
  try {
467
- return this.getAddressingSpace(cpuName, baseAddr, length);
474
+ return this.getAddressingSpace(cpuName, baseAddr, length, addressWidth);
468
475
  } catch (error) {
469
476
  console.error("Error during getMemoryValue:", error);
470
477
  throw error;
@@ -906,6 +913,14 @@ export class SkyEyeClient extends JSONTransmissionClient {
906
913
  }
907
914
  }
908
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
+
909
924
 
910
925
  public async SingleStepDefault() {
911
926
  const cpuList = (await this.getCpuList()).getCpuList;