abs-tudelft / abs-tudelft/tydi

Add concrete type definitions

Offen
#51 0 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @mbrobbel Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Rust
Sterne
15
Forks
5
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently, Streamlet Definition Files support only the declaration of multiple streamlets as such:

```tydi
Streamlet foo (
x : in Stream>,
y : out Stream>
)

Streamlet bar ...
```

In the internals of the generator tooling, one file is parsed to one library, containing the declared streamlets.

It would be nice to be able to define types, and use them across multiple libraries that reside in a single project.
Since the files do not only contain streamlet declarations, it would be nice to rename the files to .tydi file, and then be able to type something like the following.

For example, in some file: `mills.tydi`

```tydi
type Wheat = Stream>;
type Flour = Stream>;

Streamlet windmill (
wheat : in Wheat,
flour : out Flour
)
```

And another file: `bakery.tydi`

```tydi
use mills::Flour;

type Cookie = Stream>;

Streamlet bakery (
flour : in Flour,
cookie : out Cookie
)
```

This means the type of the interfaces `windmill.flour` and `bakery.flour` are equal (their in/out mode is not part of the type), and can be connected if their mode corresponds accordingly.

However `windmill.wheat` and `bakery.cookie` do not have the same types. In other words, the windmill outputs the exact same type of Flour that the bakery can use as input, but Wheat is not a Cookie.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.