Skip to content

Commit 31900d9

Browse files
authored
Cleanup for Dart 3.8 (#52)
1 parent f3d6451 commit 31900d9

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

.github/workflows/general.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333

3434
- name: Setup Dart
3535
uses: dart-lang/setup-dart@v1
36-
with:
37-
sdk: 3.6.2 # downgrade pending https://github.com/dart-lang/dartdoc/issues/3996
3836

3937
- name: Install Dart dependencies
4038
run: tool/gh_actions/install_dart_dependencies.sh
@@ -92,8 +90,6 @@ jobs:
9290

9391
- name: Setup Dart
9492
uses: dart-lang/setup-dart@v1
95-
with:
96-
sdk: 3.6.2 # downgrade pending https://github.com/dart-lang/dartdoc/issues/3996
9793

9894
- name: Install dart dependencies
9995
run: tool/gh_actions/install_dart_dependencies.sh

lib/src/configs/cosim_process_config.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ abstract class CosimProcessConfig extends CosimConfig {
8484
outFileSink?.write(message);
8585
}
8686

87-
unawaited(procFuture.then((proc) {
88-
proc.stdout.transform(utf8.decoder).forEach((msg) async {
87+
unawaited(procFuture.then((proc) async {
88+
unawaited(proc.stdout.transform(utf8.decoder).forEach((msg) async {
8989
Cosim.logger?.finest('SIM STDOUT:\n$msg');
9090
cosimLog(msg);
9191

@@ -98,14 +98,14 @@ abstract class CosimProcessConfig extends CosimConfig {
9898
socketConnectionCompleter.complete();
9999
}
100100
}
101-
});
101+
}));
102102

103-
proc.stderr.transform(utf8.decoder).forEach((msg) {
103+
unawaited(proc.stderr.transform(utf8.decoder).forEach((msg) {
104104
Cosim.logger?.warning('SIM STDERR:\n$msg');
105105
cosimLog(msg);
106-
});
106+
}));
107107

108-
proc.exitCode.then((value) {
108+
unawaited(proc.exitCode.then((value) {
109109
Cosim.logger?.fine('SIM EXIT CODE: $value');
110110

111111
if (value != 0) {
@@ -122,7 +122,7 @@ abstract class CosimProcessConfig extends CosimConfig {
122122
}
123123
Cosim.endCosim();
124124
}
125-
});
125+
}));
126126
}));
127127

128128
Cosim.logger?.finer('Waiting for socket to connect...');

lib/src/cosim.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,12 @@ mixin Cosim on ExternalSystemVerilogModule {
366366

367367
_receivedStream
368368
.where((event) => event.cosimMessageType == _CosimMessageType.end)
369-
.listen((event) {
369+
.listen((event) async {
370370
logger?.info('Received an indication that the simulator has finished.');
371371
if (onEnd != null) {
372372
onEnd();
373373
}
374-
Simulator.endSimulation();
374+
unawaited(Simulator.endSimulation());
375375
});
376376

377377
// set up initial values
@@ -392,7 +392,7 @@ mixin Cosim on ExternalSystemVerilogModule {
392392
continue;
393393
}
394394

395-
modInput.glitch.listen((event) {
395+
modInput.glitch.listen((event) async {
396396
// TODO(mkorbel1): test for clock divider bug, https://github.com/intel/rohd-cosim/issues/6
397397

398398
if (Simulator.phase != SimulatorPhase.clkStable) {
@@ -404,7 +404,7 @@ mixin Cosim on ExternalSystemVerilogModule {
404404
// driving it, so hold onto it for later
405405
registree._inputsPendingPostUpdate.add(modInput);
406406
if (!registree._pendingPostUpdate) {
407-
Simulator.postTick.first.then((value) {
407+
unawaited(Simulator.postTick.first.then((value) {
408408
// once the tick has completed, we can update the override maps
409409
for (final driverInput in registree._inputsPendingPostUpdate) {
410410
registree._inputToPreTickInputValuesMap[driverInput] =
@@ -419,7 +419,7 @@ mixin Cosim on ExternalSystemVerilogModule {
419419
await _sendPendingUpdates(
420420
throwOnUnexpectedEnd: throwOnUnexpectedEnd);
421421
});
422-
});
422+
}));
423423
}
424424
registree._pendingPostUpdate = true;
425425
}

0 commit comments

Comments
 (0)