abs-tudelft / abs-tudelft/tydi

Add concrete type definitions

Đang mở
#51 0 bình luận 0 reaction 1 người được giao Được giao cho @mbrobbel Xem trên GitHub
enhancement
Ngôn ngữ chính
Rust
Star
15
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

The issue describes adding type definitions and cross-file imports to the Tydi language. Start by examining the parser and generator tooling in the codebase, likely in src/parser.rs or similar, to understand how streamlet definitions are currently handled. Look for the library representation and how types are resolved. The change involves modifying the grammar, parsing logic, and type checking to support 'type' declarations and 'use' statements. Verify the changes by creating test .tydi files with type definitions and ensuring they can be connected correctly.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
compilers
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
40/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.