intel / intel/rohd

A helper function to save generated System Verilog string as a file

Open
#239 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
489
Forks
88
Avg merge
3d 23h
Merged PRs (30d)
10

Description

### Motivation

I'm wondering if we can have a helper function to save system Verilog module `generateSynth()` to a file. Its a pain to keep copy pasting the code below to keep track of system verilog code generated.

```dart
import 'dart:io';

final res = mod.generateSynth();
final out = File('output.txt').openWrite();
out. Write(res);

File('temp.sv').writeAsStringSync(myString);
```

I am thinking maybe someone who also beneficial to have the system verilog `.sv` file as well.

### Desired solution

There are two ways I can think of.

First is update:
- `generateSynth()` function to receive arguments like `generateSynth(toFile=true, path='./mypath/simMod.sv)' `

* Note that this might cause breaking changes as `openWrite().close()` will return `Future`.

Second:
- Create a `static helper function` to just dump in `string` to any file format.

### Alternatives considered

_No response_

### Additional details

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.